mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
8ac304c299
## Summary - accept non-empty model-defined reasoning effort values while preserving built-in effort behavior - propagate the non-Copy effort type through core, app-server, TUI, telemetry, and persistence call sites - preserve string wire encoding and expose an open-string schema for clients - update model selection and shortcut behavior for model-advertised effort values ## Root cause `ReasoningEffort` gained a string-backed custom variant, so it could no longer implement `Copy` or rely on derived closed-enum serialization. Existing consumers still moved effort values from shared references and assumed a fixed built-in value set. ## Validation - `just fmt` - Local tests and compilation were not run per request; relying on CI.
45 lines
1.4 KiB
Rust
45 lines
1.4 KiB
Rust
use codex_core::config::Config;
|
|
use codex_model_provider_info::WireApi;
|
|
|
|
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
|
|
.legacy_sandbox_policy(config.cwd.as_path()),
|
|
),
|
|
),
|
|
];
|
|
if config.model_provider.wire_api == WireApi::Responses {
|
|
let reasoning_effort = config
|
|
.model_reasoning_effort
|
|
.as_ref()
|
|
.map(std::string::ToString::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
|
|
}
|