mirror of
https://github.com/openai/codex.git
synced 2026-04-29 02:41:12 +03:00
This adds support for `allowed_sandbox_modes` in `requirements.toml` and provides legacy support for constraining sandbox modes in `managed_config.toml`. This is converted to `Constrained<SandboxPolicy>` in `ConfigRequirements` and applied to `Config` such that constraints are enforced throughout the harness. Note that, because `managed_config.toml` is deprecated, we do not add support for the new `external-sandbox` variant recently introduced in https://github.com/openai/codex/pull/8290. As noted, that variant is not supported in `config.toml` today, but can be configured programmatically via app server.
34 lines
1.1 KiB
Rust
34 lines
1.1 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.approval_policy.value().to_string()),
|
|
(
|
|
"sandbox",
|
|
summarize_sandbox_policy(config.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.to_string(),
|
|
));
|
|
}
|
|
|
|
entries
|
|
}
|