mirror of
https://github.com/openai/codex.git
synced 2026-09-10 20:26:47 +00:00
## Why Model catalog instructions can include a baked-in `# Personality` section. An explicit `none` setting should omit that section instead of sending it as part of the model's base instructions. ## What changed - Pass the configured personality into the models manager. - When personality support is enabled and the setting is explicitly `none`, remove the `# Personality` section through the next level-one heading from catalog base instructions and instruction templates. - Preserve explicit `base_instructions` overrides and avoid warning when no personality was requested. ## Testing Added unit and integration coverage for section removal, heading boundaries, CRLF input, preserved configurations, and explicit base instructions. GitOrigin-RevId: 452c88d3ac6001c2ac7d4fef269cd75dc239fa61
14 lines
478 B
Rust
14 lines
478 B
Rust
use codex_protocol::config_types::Personality;
|
|
use codex_protocol::openai_models::ModelsResponse;
|
|
|
|
#[derive(Debug, Clone, Default)]
|
|
pub struct ModelsManagerConfig {
|
|
pub model_context_window: Option<i64>,
|
|
pub model_auto_compact_token_limit: Option<i64>,
|
|
pub tool_output_token_limit: Option<usize>,
|
|
pub base_instructions: Option<String>,
|
|
pub personality_enabled: bool,
|
|
pub personality: Option<Personality>,
|
|
pub model_catalog: Option<ModelsResponse>,
|
|
}
|