Handle malformed agent role definitions nonfatally (#14488)

## Summary
- make malformed agent role definitions nonfatal during config loading
- drop invalid agent roles and record warnings in `startup_warnings`
- forward startup warnings through app-server `configWarning`
notifications

## Testing
- `cargo test -p codex-core agent_role_ -- --nocapture`
- `just fix -p codex-core`
- `just fmt`
- `cargo test -p codex-app-server config_warning -- --nocapture`

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
gabec-openai
2026-03-12 11:20:31 -07:00
committed by GitHub
parent cfe3f6821a
commit 4fa7d6f444
4 changed files with 159 additions and 49 deletions

View File

@@ -2085,7 +2085,8 @@ impl Config {
.unwrap_or(WebSearchMode::Cached);
let web_search_config = resolve_web_search_config(&cfg, &config_profile);
let agent_roles = agent_roles::load_agent_roles(&cfg, &config_layer_stack)?;
let agent_roles =
agent_roles::load_agent_roles(&cfg, &config_layer_stack, &mut startup_warnings)?;
let mut model_providers = built_in_model_providers();
// Merge user-defined providers into the built-in list.