mirror of
https://github.com/openai/codex.git
synced 2026-05-04 21:32:21 +03:00
## Summary - make `Config.model_reasoning_summary` optional so unset means use model default - resolve the optional config value to a concrete summary when building `TurnContext` - add protocol support for `default_reasoning_summary` in model metadata ## Validation - `cargo test -p codex-core --lib client::tests -- --nocapture` --------- Co-authored-by: Codex <noreply@openai.com>
40 lines
1.3 KiB
Rust
40 lines
1.3 KiB
Rust
use codex_core::WireApi;
|
|
use codex_core::config::Config;
|
|
|
|
use crate::sandbox_summary::summarize_sandbox_policy;
|
|
|
|
/// Build a list of key/value pairs summarizing the effective configuration.
|
|
pub fn create_config_summary_entries(config: &Config, model: &str) -> Vec<(&'static str, String)> {
|
|
let mut entries = vec![
|
|
("workdir", config.cwd.display().to_string()),
|
|
("model", model.to_string()),
|
|
("provider", config.model_provider_id.clone()),
|
|
(
|
|
"approval",
|
|
config.permissions.approval_policy.value().to_string(),
|
|
),
|
|
(
|
|
"sandbox",
|
|
summarize_sandbox_policy(config.permissions.sandbox_policy.get()),
|
|
),
|
|
];
|
|
if config.model_provider.wire_api == WireApi::Responses {
|
|
let reasoning_effort = config
|
|
.model_reasoning_effort
|
|
.map(|effort| effort.to_string());
|
|
entries.push((
|
|
"reasoning effort",
|
|
reasoning_effort.unwrap_or_else(|| "none".to_string()),
|
|
));
|
|
entries.push((
|
|
"reasoning summaries",
|
|
config
|
|
.model_reasoning_summary
|
|
.map(|summary| summary.to_string())
|
|
.unwrap_or_else(|| "none".to_string()),
|
|
));
|
|
}
|
|
|
|
entries
|
|
}
|