mirror of
https://github.com/openai/codex.git
synced 2026-12-03 00:41:03 +00:00
Deprecate --config and limit it to legacy keys (#65357)
## What changed Mark `-c` and `--config` as deprecated in CLI help and direct users to dedicated flags or `config.toml`. Check explicit overrides against a fixed list of legacy keys before expanding dedicated flags. Reject unknown keys even without `--strict-config`, including keys inside inline tables and arrays of tables. The `app-server` subcommand skips the legacy-key check. Preserve the meaning of positional `features.guardianv3.housekeeper` overrides by mapping the legacy positions to named fields. ## Testing Cover unknown nested keys and verify that `codex-exec resume` checks overrides on both sides of the subcommand while preserving their order. Test that a legacy positional housekeeper override still sets `batch_timeout_ms`. GitOrigin-RevId: ae13d976ad5e13068096c0f2548fdf0ab35535f3
This commit is contained in:
committed by
copyberry
parent
3a6ecd7366
commit
7aa5d4ea3a
@@ -952,11 +952,11 @@ async fn run_debug_app_server_command(cmd: DebugAppServerCommand) -> anyhow::Res
|
||||
|
||||
#[derive(Debug, Default, Parser, Clone)]
|
||||
struct FeatureToggles {
|
||||
/// Enable a feature (repeatable). Equivalent to `-c features.<name>=true`.
|
||||
/// Enable a feature (repeatable).
|
||||
#[arg(long = "enable", value_name = "FEATURE", action = clap::ArgAction::Append, global = true)]
|
||||
enable: Vec<String>,
|
||||
|
||||
/// Disable a feature (repeatable). Equivalent to `-c features.<name>=false`.
|
||||
/// Disable a feature (repeatable).
|
||||
#[arg(long = "disable", value_name = "FEATURE", action = clap::ArgAction::Append, global = true)]
|
||||
disable: Vec<String>,
|
||||
}
|
||||
@@ -1086,6 +1086,11 @@ async fn dispatch_cli(
|
||||
anyhow::bail!("Cloud does not support fork");
|
||||
}
|
||||
reject_unsupported_worktree_for_subcommand(cli.interactive.shared.worktree, &cli.subcommand)?;
|
||||
if !matches!(&cli.subcommand, Some(Subcommand::AppServer(_))) {
|
||||
cli.config_overrides
|
||||
.legacy_keys()
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
}
|
||||
config_override_args::expand_flags(&mut cli)?;
|
||||
let MultitoolCli {
|
||||
config_overrides: mut root_config_overrides,
|
||||
|
||||
@@ -60,7 +60,7 @@ fn configure_help(command: Command) -> Command {
|
||||
let interactive = TuiCli::command();
|
||||
command.mut_args(|arg| {
|
||||
if arg.get_long() == Some("config") {
|
||||
arg.long_help(None).help("Override a startup configuration value (key=value). Queued messages use the thread's model.")
|
||||
arg.long_help(None).help("Deprecated. Override a legacy startup configuration key. Queued messages use the thread's model.")
|
||||
} else if !restricted_options(&interactive).any(|shared| shared.get_id() == arg.get_id()) {
|
||||
arg
|
||||
} else if arg.get_long() == Some("cd") {
|
||||
|
||||
+6
-10
@@ -12,25 +12,21 @@ Commands:
|
||||
|
||||
Options:
|
||||
-c, --config <key=value>
|
||||
Override a configuration value that would otherwise be loaded from
|
||||
`~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override
|
||||
nested values. The `value` portion is parsed as TOML. If it fails to
|
||||
parse as TOML, the raw string is used as a literal.
|
||||
Deprecated. Override a legacy configuration key.
|
||||
|
||||
Examples: - `-c model="o3"` - `-c
|
||||
'sandbox_permissions=["disk-full-read-access"]'` - `-c
|
||||
shell_environment_policy.inherit=all`
|
||||
Prefer a dedicated flag or set the key in `config.toml`. Use dotted
|
||||
paths for nested keys. Values are parsed as TOML or, if parsing fails,
|
||||
as literal strings.
|
||||
|
||||
--enable <FEATURE>
|
||||
Enable a feature (repeatable). Equivalent to `-c features.<name>=true`
|
||||
Enable a feature (repeatable)
|
||||
|
||||
--strict-config
|
||||
Error out when config.toml contains fields that are not recognized by
|
||||
this version of Codex
|
||||
|
||||
--disable <FEATURE>
|
||||
Disable a feature (repeatable). Equivalent to `-c
|
||||
features.<name>=false`
|
||||
Disable a feature (repeatable)
|
||||
|
||||
--linux-sandbox-pid-namespace <MODE>
|
||||
Linux PID namespace: isolate (default) or inherit. Inherit allows
|
||||
|
||||
@@ -26,19 +26,30 @@ fn codex_command(codex_home: &Path) -> Result<assert_cmd::Command> {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn strict_config_rejects_unknown_config_override() -> Result<()> {
|
||||
fn config_overrides_reject_new_fields_even_without_strict_config() -> Result<()> {
|
||||
for (config_override, ignored_path) in [
|
||||
("foo=bar", "foo"),
|
||||
("tui.bogus_key_xyz=1", "tui.bogus_key_xyz"),
|
||||
("tui={bogus_key_xyz=1}", "tui.bogus_key_xyz"),
|
||||
(
|
||||
"skills.config=[{future_key=true}]",
|
||||
"skills.config.future_key",
|
||||
),
|
||||
] {
|
||||
let codex_home = TempDir::new()?;
|
||||
let mut cmd = codex_command(codex_home.path())?;
|
||||
cmd.args(["--strict-config", "-c", config_override, "exec", "hello"])
|
||||
.assert()
|
||||
.failure()
|
||||
.stderr(contains(format!(
|
||||
"unknown configuration field `{ignored_path}`"
|
||||
)));
|
||||
cmd.args([
|
||||
"-c",
|
||||
config_override,
|
||||
"exec",
|
||||
"--config=model=example",
|
||||
"hello",
|
||||
])
|
||||
.assert()
|
||||
.failure()
|
||||
.stderr(contains(format!(
|
||||
"unknown configuration field `{ignored_path}`"
|
||||
)));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -30,6 +30,9 @@ pub fn run_standalone() -> anyhow::Result<()> {
|
||||
let mut cli = ExecServerCli::parse_from(&args);
|
||||
cli.config_overrides = collect_config_overrides(ExecServerCli::command(), args)
|
||||
.unwrap_or_else(|error| error.exit());
|
||||
cli.config_overrides
|
||||
.legacy_keys()
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
cli.command.run(&paths, &cli.config_overrides).await
|
||||
})
|
||||
}
|
||||
|
||||
+4
-7
@@ -13,14 +13,11 @@ Commands:
|
||||
|
||||
Options:
|
||||
-c, --config <key=value>
|
||||
Override a configuration value that would otherwise be loaded from
|
||||
`~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override
|
||||
nested values. The `value` portion is parsed as TOML. If it fails to
|
||||
parse as TOML, the raw string is used as a literal.
|
||||
Deprecated. Override a legacy configuration key.
|
||||
|
||||
Examples: - `-c model="o3"` - `-c
|
||||
'sandbox_permissions=["disk-full-read-access"]'` - `-c
|
||||
shell_environment_policy.inherit=all`
|
||||
Prefer a dedicated flag or set the key in `config.toml`. Use dotted
|
||||
paths for nested keys. Values are parsed as TOML or, if parsing fails,
|
||||
as literal strings.
|
||||
|
||||
--strict-config
|
||||
Error out when config.toml contains fields that are not recognized by
|
||||
|
||||
@@ -13,12 +13,15 @@
|
||||
//!
|
||||
//! This allows us to ship a completely separate set of functionality as part
|
||||
//! of the `codex-exec` binary.
|
||||
use clap::CommandFactory;
|
||||
use clap::Parser;
|
||||
use codex_arg0::Arg0DispatchPaths;
|
||||
use codex_arg0::arg0_dispatch_or_else;
|
||||
use codex_exec::Cli;
|
||||
use codex_exec::run_main;
|
||||
use codex_utils_cli::CliConfigOverrides;
|
||||
use codex_utils_cli::collect_config_overrides;
|
||||
use std::ffi::OsString;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
struct TopCli {
|
||||
@@ -29,15 +32,26 @@ struct TopCli {
|
||||
inner: Cli,
|
||||
}
|
||||
|
||||
fn parse_cli(args: impl IntoIterator<Item = impl Into<OsString>>) -> anyhow::Result<Cli> {
|
||||
let args: Vec<OsString> = args.into_iter().map(Into::into).collect();
|
||||
let mut top_cli = TopCli::parse_from(&args);
|
||||
if top_cli.inner.command.is_some() && !top_cli.config_overrides.raw_overrides.is_empty() {
|
||||
top_cli.config_overrides = collect_config_overrides(TopCli::command(), args)?;
|
||||
}
|
||||
top_cli
|
||||
.config_overrides
|
||||
.legacy_keys()
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
let mut inner = top_cli.inner;
|
||||
inner
|
||||
.config_overrides
|
||||
.prepend_root_overrides(top_cli.config_overrides);
|
||||
Ok(inner)
|
||||
}
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
arg0_dispatch_or_else(|arg0_paths: Arg0DispatchPaths| async move {
|
||||
let top_cli = TopCli::parse();
|
||||
// Merge root-level overrides into inner CLI struct so downstream logic remains unchanged.
|
||||
let mut inner = top_cli.inner;
|
||||
inner
|
||||
.config_overrides
|
||||
.prepend_root_overrides(top_cli.config_overrides);
|
||||
|
||||
let inner = parse_cli(std::env::args_os())?;
|
||||
run_main(inner, arg0_paths).await?;
|
||||
Ok(())
|
||||
})
|
||||
|
||||
@@ -4,8 +4,9 @@ use pretty_assertions::assert_eq;
|
||||
#[test]
|
||||
fn top_cli_parses_resume_prompt_after_config_flag() {
|
||||
const PROMPT: &str = "echo resume-with-global-flags-after-subcommand";
|
||||
let cli = TopCli::parse_from([
|
||||
let inner = parse_cli([
|
||||
"codex-exec",
|
||||
"-cmodel_reasoning_effort=low",
|
||||
"resume",
|
||||
"--strict-config",
|
||||
"--last",
|
||||
@@ -13,16 +14,12 @@ fn top_cli_parses_resume_prompt_after_config_flag() {
|
||||
"--model",
|
||||
"gpt-5.2-codex",
|
||||
"--config",
|
||||
"reasoning_level=xhigh",
|
||||
"model_reasoning_effort=xhigh",
|
||||
"--dangerously-bypass-approvals-and-sandbox",
|
||||
"--skip-git-repo-check",
|
||||
PROMPT,
|
||||
]);
|
||||
let mut inner = cli.inner;
|
||||
inner
|
||||
.config_overrides
|
||||
.prepend_root_overrides(cli.config_overrides);
|
||||
|
||||
])
|
||||
.expect("parse");
|
||||
let Some(codex_exec::Command::Resume(args)) = inner.command.as_ref() else {
|
||||
panic!("expected resume command");
|
||||
};
|
||||
@@ -34,10 +31,26 @@ fn top_cli_parses_resume_prompt_after_config_flag() {
|
||||
}
|
||||
});
|
||||
assert_eq!(effective_prompt.as_deref(), Some(PROMPT));
|
||||
assert_eq!(inner.config_overrides.raw_overrides.len(), 1);
|
||||
assert_eq!(
|
||||
inner.config_overrides.raw_overrides[0],
|
||||
"reasoning_level=xhigh"
|
||||
inner.config_overrides.raw_overrides,
|
||||
["model_reasoning_effort=low", "model_reasoning_effort=xhigh"]
|
||||
);
|
||||
assert!(inner.strict_config);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rejects_unknown_root_override_even_with_resume_overrides() {
|
||||
let error = parse_cli([
|
||||
"codex-exec",
|
||||
"-cfuture=true",
|
||||
"resume",
|
||||
"--last",
|
||||
"-cmodel=example",
|
||||
])
|
||||
.expect_err("unknown root field");
|
||||
assert!(
|
||||
error
|
||||
.to_string()
|
||||
.contains("unknown configuration field `future`")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ async fn exec_resume_accepts_global_flags_after_subcommand() -> anyhow::Result<(
|
||||
.arg("--model")
|
||||
.arg("gpt-5.2-codex")
|
||||
.arg("--config")
|
||||
.arg("reasoning_level=xhigh")
|
||||
.arg("model_reasoning_effort=xhigh")
|
||||
.arg("--dangerously-bypass-approvals-and-sandbox")
|
||||
.arg("--skip-git-repo-check")
|
||||
.arg("echo resume-with-global-flags-after-subcommand")
|
||||
|
||||
@@ -25,6 +25,10 @@ fn main() -> anyhow::Result<()> {
|
||||
codex_build_info::initialize!();
|
||||
arg0_dispatch_or_else(|arg0_paths: Arg0DispatchPaths| async move {
|
||||
let top_cli = TopCli::parse();
|
||||
top_cli
|
||||
.config_overrides
|
||||
.legacy_keys()
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
let mut inner = top_cli.inner;
|
||||
inner
|
||||
.config_overrides
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
use clap::ArgAction;
|
||||
use clap::Parser;
|
||||
use serde::de::Error as SerdeError;
|
||||
use std::collections::BTreeSet;
|
||||
use toml::Value;
|
||||
|
||||
/// CLI option that captures arbitrary configuration overrides specified as
|
||||
@@ -17,15 +18,11 @@ use toml::Value;
|
||||
/// calling code can decide how to interpret the right-hand side.
|
||||
#[derive(Parser, Debug, Default, Clone)]
|
||||
pub struct CliConfigOverrides {
|
||||
/// Override a configuration value that would otherwise be loaded from
|
||||
/// `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override
|
||||
/// nested values. The `value` portion is parsed as TOML. If it fails to
|
||||
/// parse as TOML, the raw string is used as a literal.
|
||||
/// Deprecated. Override a legacy configuration key.
|
||||
///
|
||||
/// Examples:
|
||||
/// - `-c model="o3"`
|
||||
/// - `-c 'sandbox_permissions=["disk-full-read-access"]'`
|
||||
/// - `-c shell_environment_policy.inherit=all`
|
||||
/// Prefer a dedicated flag or set the key in `config.toml`.
|
||||
/// Use dotted paths for nested keys. Values are parsed as TOML
|
||||
/// or, if parsing fails, as literal strings.
|
||||
#[arg(
|
||||
short = 'c',
|
||||
long = "config",
|
||||
@@ -37,6 +34,22 @@ pub struct CliConfigOverrides {
|
||||
}
|
||||
|
||||
impl CliConfigOverrides {
|
||||
/// Validate explicit `-c` arguments before dedicated flags are expanded.
|
||||
/// Returned names come from the frozen vocabulary, never from user data.
|
||||
pub fn legacy_keys(&self) -> Result<BTreeSet<String>, String> {
|
||||
let mut keys = BTreeSet::new();
|
||||
// Leave syntax errors to each command's usual channel, including startup JSON.
|
||||
for entry in self.entries(/*validating*/ true) {
|
||||
let (path, value) = entry?;
|
||||
let mut field = String::new();
|
||||
for segment in path.split('.') {
|
||||
field = legacy_field(&field, segment)?;
|
||||
}
|
||||
collect_legacy_keys(&field, &value, &mut keys)?;
|
||||
}
|
||||
Ok(keys)
|
||||
}
|
||||
|
||||
/// Prepend root-level config flags so they have lower precedence than
|
||||
/// command-specific flags parsed after a subcommand.
|
||||
pub fn prepend_root_overrides(&mut self, root_overrides: Self) {
|
||||
@@ -44,12 +57,20 @@ impl CliConfigOverrides {
|
||||
.splice(0..0, root_overrides.raw_overrides);
|
||||
}
|
||||
|
||||
/// Parse the raw strings captured from the CLI into a list of `(path,
|
||||
/// value)` tuples where `value` is a `serde_json::Value`.
|
||||
/// Parse CLI overrides into ordered paths and TOML values.
|
||||
pub fn parse_overrides(&self) -> Result<Vec<(String, Value)>, String> {
|
||||
self.entries(/*validating*/ false).collect()
|
||||
}
|
||||
|
||||
fn entries(&self, validating: bool) -> impl Iterator<Item = Result<(String, Value), String>> {
|
||||
self.raw_overrides
|
||||
.iter()
|
||||
.map(|s| {
|
||||
.filter(move |s| {
|
||||
!validating
|
||||
|| s.split_once('=')
|
||||
.is_some_and(|(key, _)| !key.trim().is_empty())
|
||||
})
|
||||
.map(move |s| {
|
||||
// Only split on the *first* '=' so values are free to contain
|
||||
// the character.
|
||||
let mut parts = s.splitn(2, '=');
|
||||
@@ -69,7 +90,7 @@ impl CliConfigOverrides {
|
||||
// Attempt to parse as TOML. If that fails, treat it as a raw
|
||||
// string. This allows convenient usage such as
|
||||
// `-c model=o3` without the quotes.
|
||||
let value: Value = match parse_toml_value(value_str) {
|
||||
let mut value: Value = match parse_toml_value(value_str) {
|
||||
Ok(v) => v,
|
||||
Err(_) => {
|
||||
// Strip leading/trailing quotes if present
|
||||
@@ -78,12 +99,97 @@ impl CliConfigOverrides {
|
||||
}
|
||||
};
|
||||
|
||||
name_guardian_positions(key, &mut value, validating)?;
|
||||
Ok((canonicalize_override_key(key), value))
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
fn legacy_field(parent: &str, segment: &str) -> Result<String, String> {
|
||||
let fields = crate::legacy_fields::fields(parent);
|
||||
if fields == "**" {
|
||||
return Ok(parent.to_owned());
|
||||
}
|
||||
let separator = if parent.is_empty() { "" } else { "." };
|
||||
let name = fields
|
||||
.split_ascii_whitespace()
|
||||
.find(|name| *name == segment)
|
||||
.or_else(|| fields.split_ascii_whitespace().find(|name| *name == "*"))
|
||||
.ok_or_else(|| format!(
|
||||
"unknown configuration field `{parent}{separator}{segment}` for -c/--config. Use a dedicated flag or set the key in config.toml."
|
||||
))?;
|
||||
Ok(format!("{parent}{separator}{name}"))
|
||||
}
|
||||
|
||||
// Serde positions depend on declaration order. Name the frozen fields before
|
||||
// loading so inserted fields cannot reinterpret an existing positional override.
|
||||
fn name_guardian_positions(path: &str, value: &mut Value, validating: bool) -> Result<(), String> {
|
||||
let path = match path.strip_prefix("profiles.") {
|
||||
Some(profile) => profile.split_once('.').map_or("", |(_, key)| key),
|
||||
None => path,
|
||||
};
|
||||
if matches!(
|
||||
path,
|
||||
"features.guardianv3" | "features.guardianv3.housekeeper" | "features.guardianv3.reviewer"
|
||||
) && let Value::Array(items) = value
|
||||
{
|
||||
let mut fields = crate::legacy_fields::fields(path).split_ascii_whitespace();
|
||||
// Arrays replace lower layers. Only the housekeeper layout changed
|
||||
// (batch_limit was inserted before batch_timeout_ms).
|
||||
if !validating && path != "features.guardianv3.housekeeper" {
|
||||
for (item, field) in items.iter_mut().zip(fields) {
|
||||
name_guardian_positions(&format!("{path}.{field}"), item, validating)?;
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
let mut table = toml::Table::new();
|
||||
for item in std::mem::take(items) {
|
||||
let field = fields
|
||||
.next()
|
||||
.ok_or_else(|| format!("too many positional fields for `{path}` in -c/--config"))?;
|
||||
table.insert(field.to_string(), item);
|
||||
}
|
||||
*value = Value::Table(table);
|
||||
}
|
||||
if let Value::Table(table) = value {
|
||||
for (name, child) in table.iter_mut() {
|
||||
let child_path = match (path, name.as_str()) {
|
||||
("profiles", _) => "",
|
||||
("", "features") => "features",
|
||||
("features", "guardianv3") => "features.guardianv3",
|
||||
("features.guardianv3", "housekeeper") => "features.guardianv3.housekeeper",
|
||||
("features.guardianv3", "reviewer") => "features.guardianv3.reviewer",
|
||||
_ => continue,
|
||||
};
|
||||
name_guardian_positions(child_path, child, validating)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn collect_legacy_keys(
|
||||
path: &str,
|
||||
value: &Value,
|
||||
keys: &mut BTreeSet<String>,
|
||||
) -> Result<(), String> {
|
||||
match value {
|
||||
Value::Table(table) if !table.is_empty() && crate::legacy_fields::fields(path) != "**" => {
|
||||
for (name, child) in table {
|
||||
collect_legacy_keys(&legacy_field(path, name)?, child, keys)?;
|
||||
}
|
||||
}
|
||||
Value::Array(items) if !items.is_empty() => {
|
||||
for item in items {
|
||||
collect_legacy_keys(path, item, keys)?;
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
keys.insert(path.to_owned());
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn canonicalize_override_key(key: &str) -> String {
|
||||
if key == "use_legacy_landlock" {
|
||||
"features.use_legacy_landlock".to_string()
|
||||
@@ -138,6 +244,66 @@ fn localize_config_arg(mut command: clap::Command) -> clap::Command {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn legacy_override_labels_mask_names_and_deduplicate_spellings() {
|
||||
let overrides = CliConfigOverrides {
|
||||
raw_overrides: [
|
||||
"mcp_servers.dev.env.SECRET='example'",
|
||||
"mcp_servers.dev.http_headers_helper_env_vars=[]",
|
||||
"mcp_servers = { 'example.org' = { env = { OTHER = 'value' } } }",
|
||||
"use_legacy_landlock=true",
|
||||
"tui.whimsy=false",
|
||||
"hooks.Stop=[{hooks=[{command_windows='example'}]}]",
|
||||
"permissions.local.filesystem = { '/tmp/example' = 'read' }",
|
||||
"skills.config = [{path='example', enabled=true}]",
|
||||
"features = {'guardianv3.shadow_enabled'=true, 'guardianv2.thread_context'=false}",
|
||||
"profiles.dev.features = {'guardianv3.shadow_enabled'=true}",
|
||||
]
|
||||
.map(String::from)
|
||||
.into(),
|
||||
};
|
||||
pretty_assertions::assert_eq!(
|
||||
overrides.legacy_keys().expect("legacy keys"),
|
||||
BTreeSet::from([
|
||||
"features.guardianv2.thread_context".to_string(),
|
||||
"features.guardianv3.shadow_enabled".to_string(),
|
||||
"features.use_legacy_landlock".to_string(),
|
||||
"hooks.Stop.hooks.command_windows".to_string(),
|
||||
"mcp_servers.*.env.*".to_string(),
|
||||
"mcp_servers.*.http_headers_helper_env_vars".to_string(),
|
||||
"permissions.*.filesystem.*".to_string(),
|
||||
"profiles.*.features.guardianv3.shadow_enabled".to_string(),
|
||||
"skills.config.enabled".to_string(),
|
||||
"skills.config.path".to_string(),
|
||||
"tui.whimsy".to_string(),
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn malformed_overrides_do_not_hide_unknown_fields() {
|
||||
let overrides = CliConfigOverrides {
|
||||
raw_overrides: vec!["missing-equals".into(), "future_setting=true".into()],
|
||||
};
|
||||
let error = overrides.legacy_keys().expect_err("unknown field");
|
||||
assert!(error.contains("unknown configuration field `future_setting`"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn guardian_positions_follow_the_frozen_field_order() {
|
||||
let overrides = CliConfigOverrides {
|
||||
raw_overrides: vec!["features.guardianv3=[512,true,true,true,['route',100],{retrieval_instructions='read'},1]".into()],
|
||||
};
|
||||
let parsed = overrides.parse_overrides().expect("named positions");
|
||||
assert_eq!(parsed[0].1[4]["batch_timeout_ms"].as_integer(), Some(100));
|
||||
let keys = overrides.legacy_keys().expect("positional settings");
|
||||
assert!(keys.contains("features.guardianv3.housekeeper.batch_timeout_ms"));
|
||||
let extra = CliConfigOverrides {
|
||||
raw_overrides: vec!["profiles.dev.features.guardianv3.reviewer=['read',true]".into()],
|
||||
};
|
||||
assert!(extra.legacy_keys().is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parses_basic_scalar() {
|
||||
let v = parse_toml_value("42").expect("parse");
|
||||
|
||||
@@ -0,0 +1,355 @@
|
||||
//! Frozen field names from the config schema, including serde aliases, flattened maps,
|
||||
//! and accepted fields omitted from the schema. Do not regenerate with new config fields.
|
||||
//! The last addition preserves per-launch revocation of MCP helper environment grants.
|
||||
//! `*` matches one map key. `**` denotes an opaque user payload.
|
||||
|
||||
pub(super) fn fields(path: &str) -> &'static str {
|
||||
match path {
|
||||
"" => concat!(
|
||||
"agents allow_login_shell allow_symlinked_codex_home analytics approval_policy approvals_reviewer
|
||||
apps apps_mcp_product_sku audio auto_review background_terminal_max_timeout browser_use
|
||||
chatgpt_base_url check_for_update_on_startup cli_auth_credentials_store cloud code_mode
|
||||
compact_prompt computer_use daybreak default_permissions desktop developer_instructions
|
||||
disable_paste_burst experimental_compact_prompt_file experimental_realtime_start_instructions
|
||||
experimental_realtime_webrtc_call_base_url experimental_realtime_ws_backend_prompt
|
||||
experimental_realtime_ws_base_url experimental_realtime_ws_model
|
||||
experimental_realtime_ws_startup_context experimental_thread_store
|
||||
experimental_thread_store_endpoint experimental_use_unified_exec_tool features feedback file_opener
|
||||
forced_chatgpt_workspace_id forced_login_method ghost_snapshot goals hide_agent_reasoning history
|
||||
hooks include_apps_instructions include_collaboration_mode_instructions include_environment_context
|
||||
include_environment_context_time include_permissions_instructions instructions
|
||||
js_repl_node_module_dirs js_repl_node_path log_dir marketplaces mcp_enterprise_managed_auth
|
||||
mcp_oauth_callback_port mcp_oauth_callback_url mcp_oauth_credentials_store
|
||||
mcp_optional_startup_grace_ms mcp_servers memories model model_auto_compact_token_limit
|
||||
model_auto_compact_token_limit_scope model_catalog_json model_context_window model_instructions_file
|
||||
model_post_turn_compact_threshold_percent model_provider model_providers model_reasoning_effort
|
||||
model_reasoning_summary model_verbosity notice notify openai_base_url orchestrator oss_provider otel
|
||||
permissions personality plan_mode_reasoning_effort plugins profile profiles
|
||||
project_doc_fallback_filenames project_doc_max_bytes project_root_markers projects realtime
|
||||
responses responses_api_metadata review_model rollout_trace sandbox_mode sandbox_workspace_write
|
||||
service_tier shell_environment_policy show_raw_agent_reasoning skills sqlite_home
|
||||
suppress_unstable_features_warning thread_unload_delay_secs tool_output_token_limit tool_suggest
|
||||
tools tui web_search windows",
|
||||
),
|
||||
"agents" => "* default_subagent_model default_subagent_reasoning_effort enabled interrupt_message
|
||||
job_max_runtime_seconds max_concurrent_threads_per_session max_depth max_threads",
|
||||
"agents.*" => "config_file description nickname_candidates",
|
||||
"analytics" | "cloud.skills" | "feedback" | "orchestrator.mcp" | "orchestrator.skills"
|
||||
| "plugins._default" | "profiles.*.analytics"
|
||||
| "profiles.*.tools.experimental_request_user_input" | "profiles.*.tools.update_plan"
|
||||
| "skills.bundled" | "tools.experimental_request_user_input" | "tools.update_plan" => "enabled",
|
||||
"approval_policy" | "profiles.*.approval_policy" => "granular",
|
||||
"approval_policy.granular" | "profiles.*.approval_policy.granular" => "mcp_elicitations request_permissions rules sandbox_approval skill_approval",
|
||||
"apps" | "plugins" => "* _default",
|
||||
"apps.*" | "plugins.*.apps.*" => "approvals_reviewer default_tools_approval_mode default_tools_enabled destructive_enabled enabled
|
||||
links omit_tools_from open_world_enabled tools",
|
||||
"apps.*.links" | "apps.*.tools" | "browser_use.origins" | "computer_use.macos.bundle_ids"
|
||||
| "computer_use.windows.aumids" | "features.guardianv2.async_elastic_sections"
|
||||
| "features.guardianv2.sync_elastic_sections" | "features.network_proxy.credentials"
|
||||
| "features.network_proxy.domains" | "features.network_proxy.unix_sockets" | "hooks.state"
|
||||
| "marketplaces" | "mcp_servers" | "mcp_servers.*.env" | "mcp_servers.*.env_http_headers"
|
||||
| "mcp_servers.*.http_headers" | "mcp_servers.*.tools" | "model_providers"
|
||||
| "model_providers.*.env_http_headers" | "model_providers.*.http_headers"
|
||||
| "model_providers.*.query_params"
|
||||
| "notice.external_config_migration_prompts.project_last_prompted_at"
|
||||
| "notice.external_config_migration_prompts.projects" | "notice.model_migrations"
|
||||
| "otel.exporter.otlp-grpc.headers" | "otel.exporter.otlp-http.headers"
|
||||
| "otel.metrics_exporter.otlp-grpc.headers" | "otel.metrics_exporter.otlp-http.headers"
|
||||
| "otel.span_attributes" | "otel.trace_exporter.otlp-grpc.headers"
|
||||
| "otel.trace_exporter.otlp-http.headers" | "otel.tracestate" | "otel.tracestate.*"
|
||||
| "permissions" | "permissions.*.filesystem.*" | "permissions.*.network.domains"
|
||||
| "permissions.*.network.mitm.actions" | "permissions.*.network.mitm.hooks"
|
||||
| "permissions.*.network.mitm.hooks.*.headers"
|
||||
| "permissions.*.network.mitm.hooks.*.query" | "permissions.*.network.unix_sockets"
|
||||
| "permissions.*.workspace_roots" | "plugins.*.apps" | "plugins.*.apps.*.links"
|
||||
| "plugins.*.apps.*.tools" | "plugins.*.mcp_servers" | "plugins.*.mcp_servers.*.tools"
|
||||
| "profiles" | "profiles.*.features.guardianv2.async_elastic_sections"
|
||||
| "profiles.*.features.guardianv2.sync_elastic_sections"
|
||||
| "profiles.*.features.network_proxy.credentials"
|
||||
| "profiles.*.features.network_proxy.domains"
|
||||
| "profiles.*.features.network_proxy.unix_sockets" | "projects" | "responses_api_metadata"
|
||||
| "shell_environment_policy.filters" | "shell_environment_policy.set"
|
||||
| "tui.default_hosts" | "tui.default_hosts.*" | "tui.model_availability_nux"
|
||||
| "tui.presets" => "*",
|
||||
"apps.*.links.*" | "plugins.*.apps.*.links.*" => "approvals_reviewer default_tools_approval_mode",
|
||||
"apps.*.tools.*" | "plugins.*.apps.*.tools.*" => "approval_mode approvals_reviewer enabled",
|
||||
"apps._default" => "approvals_reviewer default_tools_approval_mode destructive_enabled enabled open_world_enabled",
|
||||
"audio" => "microphone microphone_channel speaker",
|
||||
"auto_review" => "circuit_break_action conversation_history_max_output_tokens experimental_conversation_history_prompt
|
||||
policy timeout_ms",
|
||||
"browser_use" => "allow_history_access default_origin_policy origins",
|
||||
"browser_use.default_origin_policy" | "browser_use.origins.*" => "access downloads full_cdp_access uploads",
|
||||
"cloud" => "skills",
|
||||
"code_mode" => "heartbeat_interval_s",
|
||||
"computer_use" => "default_app_access macos windows",
|
||||
"computer_use.macos" => "bundle_ids",
|
||||
"computer_use.windows" => "aumids exes",
|
||||
"computer_use.windows.exes" => "access binary_name product_name publisher_name",
|
||||
"desktop" | "hooks.Interrupt.hooks.input" | "hooks.PermissionRequest.hooks.input"
|
||||
| "hooks.PostCompact.hooks.input" | "hooks.PostModelRequest.hooks.input"
|
||||
| "hooks.PostToolUse.hooks.input" | "hooks.PreCompact.hooks.input"
|
||||
| "hooks.PreModelRequest.hooks.input" | "hooks.PreToolUse.hooks.input"
|
||||
| "hooks.SessionEnd.hooks.input" | "hooks.SessionStart.hooks.input"
|
||||
| "hooks.Stop.hooks.input" | "hooks.SubagentStart.hooks.input"
|
||||
| "hooks.SubagentStop.hooks.input" | "hooks.UserPromptSubmit.hooks.input"
|
||||
| "plugins.*.mcp_servers.*.ema_auth" => "**",
|
||||
"experimental_thread_store" | "tool_suggest.disabled_tools" | "tool_suggest.discoverables" => "id type",
|
||||
"features" | "profiles.*.features" => concat!(
|
||||
"agent_message_board agent_message_board_mcp analytics_plan_history api_key_cyber_access_programs
|
||||
api_key_model_discovery app_server_websocket_compression apply_patch_freeform
|
||||
apply_patch_preserve_line_endings apply_patch_streaming_events apps apps_early_resource_discovery
|
||||
apps_mcp_path_override artifact async_compaction async_compaction_root_only auth_elicitation
|
||||
background_paginated_rollout_migration bedrock_setup_wizard browser_annotation_api browser_use
|
||||
browser_use_external browser_use_full_cdp_access catalog_apps_instructions chronicle cli_daybreak
|
||||
cli_resume_account_check code_mode code_mode_buffered_exec code_mode_host code_mode_host_grpc
|
||||
code_mode_host_output_truncation code_mode_interrupt code_mode_mcp_result_dedup code_mode_only
|
||||
code_mode_only_strict_3p_tools code_mode_prewarm code_mode_tool_description_first
|
||||
code_mode_tool_search codex_apps_mcp_2026_07_28 codex_git_commit codex_hooks collab
|
||||
collaboration_modes command_sessions_world_state compact_filesystem_context compaction_image_budget
|
||||
computer_use concurrent_reasoning_summaries connector_tool_result_passthrough connectors
|
||||
content_item_kinds context_management credential_masking critical_path_timing current_time_reminder
|
||||
cwd_relative_turn_diffs daemon_auto_start daemon_updates daybreak_program_propagation
|
||||
default_mode_request_user_input defer_image_generation defer_mailbox_preemption deferred_executor
|
||||
deferred_tool_world_state elevated_windows_sandbox enable_experimental_windows_sandbox enable_fanout
|
||||
enable_mcp_apps enable_request_compression exec_permission_approvals executed_tool_call_metadata
|
||||
executor_capability_discovery executor_capability_discovery_v2 experimental_use_unified_exec_tool
|
||||
experimental_windows_sandbox external_agent_memory_import external_migration fast_mode
|
||||
file_backed_tool_audio gateway_setup_wizard gcp_setup_wizard goals guardian_approval
|
||||
guardian_conversation_history_tools guardian_denial_reconsideration
|
||||
guardian_enhanced_node_repl_transcripts guardian_ext guardian_include_additional_context
|
||||
guardian_native_action_framing guardian_native_multi_agent_history guardian_nested_approval_context
|
||||
guardian_node_repl_transcript_images guardian_recorded_items guardian_reuse_parent_compaction
|
||||
guardian_root_handoff_context guardian_trust_orchestrator_connectors guardianv2
|
||||
guardianv2.thread_context guardianv2_decisions_comparison guardianv3 guardianv3.shadow_enabled
|
||||
hooks image_detail_original image_generation
|
||||
image_generation_animation image_resize_notice imagegenext in_app_browser in_app_chat
|
||||
in_app_dictation in_app_local_automation in_app_updates in_app_voice incremental_exec_tools
|
||||
incremental_tools incremental_tools_legacy incremental_tools_legacy_gcp instant_interrupt
|
||||
interrupt_on_cancel item_ids js_repl js_repl_tools_only local_thread_store_compression
|
||||
local_thread_store_shared_compression login_shell_package_path mcp_2026_07_28 mcp_connection_sharing
|
||||
mcp_lazy_stdio_startup mcp_oauth_refresh_coordination mcp_shared_repl_cwd mcp_tool_list_changed
|
||||
memories memory_tool mentions_v2 model_catalog_in_context multi_agent multi_agent_mode
|
||||
multi_agent_v2 multi_agent_v2_dynamic_tools multi_env_copy_file multi_environment_mcp network_proxy
|
||||
non_prefixed_mcp_tool_names nonfatal_clock_read_errors omit_app_server_notification_media
|
||||
omit_skill_descriptions output_token_replay per_environment_context personality
|
||||
plugin_discovery_prefetch plugin_hooks plugin_sharing plugins powershell_shell_version
|
||||
prediction_preserve_parent_tools prefer_mxc prevent_idle_sleep psp realtime_conversation
|
||||
realtime_frames_local reasoning_effort_override recommended_plugins remote_compaction_v2
|
||||
remote_control remote_models remote_plugin request_permissions request_permissions_tool request_rule
|
||||
resize_all_images respect_system_proxy responses_websockets responses_websockets_v2
|
||||
restored_history_prewarm retain_client_developer_messages retain_client_tool_outputs rollout_budget
|
||||
runtime_agent_instances runtime_metrics safe_image_decoder search_tool secret_auth_storage
|
||||
send_async_message send_message_to_user_async shell_snapshot shell_snapshot_v2 shell_tool
|
||||
shell_zsh_fork simplified_selection_hints skill_catalog_deltas skill_env_var_dependency_prompt
|
||||
skill_mcp_dependency_install skill_search skip_host_skill_discovery sleep_tool sqlite
|
||||
stable_environment_tools standalone_web_search statsig_gates steer step_model_switching
|
||||
subagent_default_context_limits subagent_thread_environments suppress_model_change_announcements
|
||||
system_proxy_fallback telepathy terminal_resize_reflow terminal_visualization_instructions
|
||||
token_budget tool_call_mcp_elicitation tool_registry tool_search tool_search_always_defer_mcp_tools
|
||||
tool_suggest transcript_v2 tui_app_server tui_extensions_statusline tui_multi_backend tui_workspace
|
||||
ultrafast_mode unavailable_dummy_tools unbounded_connection_retries undo unified_exec
|
||||
unified_exec_tty unified_exec_zsh_fork unified_image_budget untrusted_as_tool_output
|
||||
use_agent_identity use_legacy_landlock use_linux_sandbox_bwrap use_xaa utc_environment_date
|
||||
view_image wake_on_agent_messages web_search web_search_cached web_search_indexed_default
|
||||
web_search_request windows_sandbox_service workspace_dependencies workspace_owner_usage_nudge
|
||||
worktrees write_stdin_approval",
|
||||
),
|
||||
"features.apps_mcp_path_override" | "profiles.*.features.apps_mcp_path_override" => "enabled path",
|
||||
"features.async_compaction" | "profiles.*.features.async_compaction" => "enabled model_async_compact_threshold_percent",
|
||||
"features.code_mode" | "profiles.*.features.code_mode" => "default_exec_yield_time_ms direct_only_tool_namespaces enabled excluded_tool_namespaces
|
||||
experimental_show_cell_overhead tool_input_schema_max_bytes",
|
||||
"features.code_mode_host" | "profiles.*.features.code_mode_host" => "disable_in_process_fallback enabled",
|
||||
"features.context_management" | "profiles.*.features.context_management" => "experimental_mode",
|
||||
"features.current_time_reminder" | "profiles.*.features.current_time_reminder" => "clock_source delivery_mode enabled reminder_interval_seconds sleep_tool",
|
||||
"features.guardianv2" | "profiles.*.features.guardianv2" => "async_classifier_conversation_token_limit async_classifier_mode async_elastic_budgeting
|
||||
async_elastic_sections classifier_instructions enabled free_guardian max_action_tokens
|
||||
max_classifier_instruction_tokens max_parent_compaction_tokens max_tool_call_lag persist_scores
|
||||
reasoning_effort reuse_parent_compaction review_scope review_threshold sync_elastic_budgeting
|
||||
sync_elastic_sections thread_context transcript transcript_mode",
|
||||
"features.guardianv2.async_elastic_sections.*" | "features.guardianv2.sync_elastic_sections.*"
|
||||
| "profiles.*.features.guardianv2.async_elastic_sections.*"
|
||||
| "profiles.*.features.guardianv2.sync_elastic_sections.*" => "max_section_entry_tokens max_total_section_tokens min_total_section_tokens nested_tool_names",
|
||||
"features.guardianv2.review_scope" | "profiles.*.features.guardianv2.review_scope" => "computer_use_only sandboxed_exec_commands",
|
||||
"features.guardianv2.transcript" | "profiles.*.features.guardianv2.transcript" => "include_images max_message_entry_tokens max_message_transcript_tokens max_recent_non_user_entries
|
||||
max_tool_entry_tokens max_tool_transcript_tokens sources",
|
||||
// Serde accepts these three structs as arrays in declaration order.
|
||||
"features.guardianv3" | "profiles.*.features.guardianv3" => "shadow_board_limit_mib message_board_in_memory enabled shadow_enabled housekeeper reviewer
|
||||
max_instruction_tokens",
|
||||
"features.guardianv3.housekeeper" | "profiles.*.features.guardianv3.housekeeper" => "routing_instructions batch_timeout_ms",
|
||||
"features.guardianv3.reviewer" | "profiles.*.features.guardianv3.reviewer" => "retrieval_instructions",
|
||||
"features.multi_agent_v2" | "profiles.*.features.multi_agent_v2" => concat!(
|
||||
"default_wait_timeout_ms disable_direct_message disable_native_tools enabled
|
||||
expose_spawn_agent_model_overrides expose_spawn_agent_service_tier hide_spawn_agent_metadata
|
||||
interrupt_at_item_boundary max_concurrent_threads_per_session max_wait_timeout_ms
|
||||
message_board_in_memory message_board_remote min_wait_timeout_ms multi_agent_mode_hint_text
|
||||
non_code_mode_only preserve_fork_prefix root_agent_usage_hint_text subagent_developer_instructions
|
||||
subagent_usage_hint_text tool_namespace usage_hint_enabled
|
||||
usage_hint_text wait_agent_enabled",
|
||||
),
|
||||
"features.multi_agent_v2.message_board_remote"
|
||||
| "profiles.*.features.multi_agent_v2.message_board_remote" => "bearer_token bearer_token_env_var url",
|
||||
"features.network_proxy" | "profiles.*.features.network_proxy" => "allow_local_binding allow_upstream_proxy credential_broker credentials
|
||||
dangerously_allow_all_unix_sockets dangerously_allow_non_loopback_proxy domains enable_socks5
|
||||
enable_socks5_udp enabled mode proxy_url socks_url transparent_tcp unix_sockets",
|
||||
"features.network_proxy.credentials.*" | "profiles.*.features.network_proxy.credentials.*" => "auth env header patterns prefix url_prefix_from_env url_prefixes",
|
||||
"features.non_prefixed_mcp_tool_names" | "profiles.*.features.non_prefixed_mcp_tool_names" => "enabled server_names",
|
||||
"features.rollout_budget" | "profiles.*.features.rollout_budget" => concat!(
|
||||
"enabled enforce_limit limit_budget limit_tokens prefill_token_weight reminder_at_context_start
|
||||
reminder_at_remaining_tokens sampling_token_weight",
|
||||
),
|
||||
"features.runtime_agent_instances" | "features.sleep_tool"
|
||||
| "profiles.*.features.runtime_agent_instances" | "profiles.*.features.sleep_tool" => "enabled mode",
|
||||
"features.send_message_to_user_async" | "profiles.*.features.send_message_to_user_async" => "direct_only root_agent subagents",
|
||||
"features.token_budget" | "profiles.*.features.token_budget" => concat!(
|
||||
"auto_compact_fallback_buffer_tokens auto_compact_fallback_prompt context_window_as_tool_output
|
||||
enabled guidance_message reminder_message_template
|
||||
reminder_threshold_tokens use_history_notes_extension",
|
||||
),
|
||||
"features.tool_registry" | "profiles.*.features.tool_registry" => "error_on_tool_collisions turn_metadata_includes_tool_info",
|
||||
"ghost_snapshot" => "disable_warnings ignore_large_untracked_dirs ignore_large_untracked_files
|
||||
ignore_untracked_files_over_bytes large_untracked_dir_warning_threshold",
|
||||
"goals" => "max_goal_token_budget",
|
||||
"history" => "max_bytes persistence",
|
||||
"hooks" => "Interrupt PermissionRequest PostCompact PostModelRequest PostToolUse PreCompact PreModelRequest
|
||||
PreToolUse SessionEnd SessionStart Stop SubagentStart SubagentStop UserPromptSubmit state",
|
||||
"hooks.Interrupt" | "hooks.PermissionRequest" | "hooks.PostCompact" | "hooks.PostModelRequest"
|
||||
| "hooks.PostToolUse" | "hooks.PreCompact" | "hooks.PreModelRequest" | "hooks.PreToolUse"
|
||||
| "hooks.SessionEnd" | "hooks.SessionStart" | "hooks.Stop" | "hooks.SubagentStart"
|
||||
| "hooks.SubagentStop" | "hooks.UserPromptSubmit" => "hooks matcher",
|
||||
"hooks.Interrupt.hooks" | "hooks.PermissionRequest.hooks" | "hooks.PostCompact.hooks"
|
||||
| "hooks.PostModelRequest.hooks" | "hooks.PostToolUse.hooks" | "hooks.PreCompact.hooks"
|
||||
| "hooks.PreModelRequest.hooks" | "hooks.PreToolUse.hooks" | "hooks.SessionEnd.hooks"
|
||||
| "hooks.SessionStart.hooks" | "hooks.Stop.hooks" | "hooks.SubagentStart.hooks"
|
||||
| "hooks.SubagentStop.hooks" | "hooks.UserPromptSubmit.hooks" => "additionalContextLimit async command commandWindows command_windows input onFailure server statusMessage timeout
|
||||
tool type",
|
||||
"hooks.state.*" => "enabled trusted_content_hash trusted_hash",
|
||||
"marketplaces.*" => "auto_update last_revision last_updated ref source source_type sparse_paths",
|
||||
"mcp_enterprise_managed_auth" => "idp",
|
||||
"mcp_enterprise_managed_auth.idp" => "client_id client_secret issuer token_endpoint_auth_method",
|
||||
"mcp_servers.*" => "args auth bearer_token bearer_token_env_var command cwd default_tools_approval_mode disabled_tools
|
||||
enabled enabled_tools env env_http_headers env_vars environment_id http_headers http_headers_helper
|
||||
http_headers_helper_env_vars name oauth oauth_resource omit_tools_from required scopes
|
||||
startup_readiness startup_timeout_ms startup_timeout_sec supports_parallel_tool_calls
|
||||
tool_input_schema_max_bytes tool_timeout_sec tools url",
|
||||
"mcp_servers.*.env_vars" => "name source",
|
||||
"mcp_servers.*.oauth" => "authorization_server_issuer callback_port callback_url client_id client_secret
|
||||
token_endpoint_auth_method",
|
||||
"mcp_servers.*.tools.*" | "plugins.*.mcp_servers.*.tools.*" => "approval_mode output_token_limit",
|
||||
"memories" => "consolidation_model consolidation_service_tier dedicated_tools disable_on_external_context
|
||||
dual_write extract_model generate_memories max_raw_memories_for_consolidation max_rollout_age_days
|
||||
max_rollouts_per_startup max_unused_days min_rate_limit_remaining_percent min_rollout_idle_hours
|
||||
no_memories_if_mcp_or_web_search use_memories version",
|
||||
"model_providers.*" => "auth aws base_url capabilities credential_file env_http_headers env_key env_key_instructions
|
||||
experimental_bearer_token gateway_oauth http_headers location model_catalog_url name project_id
|
||||
query_params request_max_retries requires_openai_auth stream_idle_timeout_ms stream_max_retries
|
||||
supports_standalone_web_search supports_websockets websocket_connect_timeout_ms wire_api",
|
||||
"model_providers.*.auth" => "args command cwd refresh_interval_ms timeout_ms",
|
||||
"model_providers.*.aws" => "auth_refresh credential_export profile region",
|
||||
"model_providers.*.aws.auth_refresh" | "model_providers.*.aws.credential_export"
|
||||
| "model_providers.*.gateway_oauth.credential_export" => "args command timeout_ms",
|
||||
"model_providers.*.capabilities" => "cyber_access_programs external_web_access remote_compaction",
|
||||
"model_providers.*.gateway_oauth" => "authorization_url client_id credential_export credentials_store delivery device_authorization_url
|
||||
redirect_port resource scopes token_url",
|
||||
"model_providers.*.gateway_oauth.delivery" => "kind name scheme",
|
||||
"notice" => "external_config_migration_prompts fast_default_opt_out hide_full_access_warning
|
||||
hide_gov_cloud_guidance hide_gpt-5.1-codex-max_migration_prompt hide_gpt5_1_migration_prompt
|
||||
hide_rate_limit_model_nudge hide_world_writable_warning model_migrations",
|
||||
"notice.external_config_migration_prompts" => "home home_last_prompted_at project_last_prompted_at projects",
|
||||
"orchestrator" => "mcp skills",
|
||||
"otel" => "environment exporter headers_helper headers_helper_refresh_interval_ms log_agent_responses
|
||||
log_guardian_assessments log_sse_deltas log_user_prompt metrics_exporter span_attributes tool_result
|
||||
trace_exporter tracestate",
|
||||
"otel.exporter" | "otel.metrics_exporter" | "otel.trace_exporter" => "otlp-grpc otlp-http",
|
||||
"otel.exporter.otlp-grpc" | "otel.metrics_exporter.otlp-grpc" | "otel.trace_exporter.otlp-grpc" => "endpoint headers tls",
|
||||
"otel.exporter.otlp-grpc.tls" | "otel.exporter.otlp-http.tls"
|
||||
| "otel.metrics_exporter.otlp-grpc.tls" | "otel.metrics_exporter.otlp-http.tls"
|
||||
| "otel.trace_exporter.otlp-grpc.tls" | "otel.trace_exporter.otlp-http.tls" => "ca-certificate client-certificate client-private-key",
|
||||
"otel.exporter.otlp-http" | "otel.metrics_exporter.otlp-http" | "otel.trace_exporter.otlp-http" => "endpoint headers protocol tls",
|
||||
"otel.tool_result" => "max_bytes",
|
||||
"permissions.*" => "credentials description extends filesystem network workspace_roots",
|
||||
"permissions.*.filesystem" => "* glob_scan_max_depth",
|
||||
"permissions.*.network" => "allow_local_binding allow_upstream_proxy dangerously_allow_all_unix_sockets
|
||||
dangerously_allow_non_loopback_proxy domains enable_socks5 enable_socks5_udp enabled mitm mode
|
||||
proxy_url socks_url transparent_tcp unix_sockets",
|
||||
"permissions.*.network.mitm" => "actions hooks version",
|
||||
"permissions.*.network.mitm.actions.*" => "aws_sigv4 body_secret_substitution inject_request_headers strip_request_headers",
|
||||
"permissions.*.network.mitm.actions.*.aws_sigv4" => "access_key_id max_body_bytes placeholder_access_key_id port region secret_access_key service
|
||||
session_token",
|
||||
"permissions.*.network.mitm.actions.*.aws_sigv4.access_key_id"
|
||||
| "permissions.*.network.mitm.actions.*.aws_sigv4.secret_access_key"
|
||||
| "permissions.*.network.mitm.actions.*.aws_sigv4.session_token"
|
||||
| "permissions.*.network.mitm.actions.*.body_secret_substitution.replacements.secret" => "env_var file",
|
||||
"permissions.*.network.mitm.actions.*.body_secret_substitution" => "max_body_bytes port replacements",
|
||||
"permissions.*.network.mitm.actions.*.body_secret_substitution.replacements" => "placeholder secret",
|
||||
"permissions.*.network.mitm.actions.*.inject_request_headers" => "name placeholder prefix secret_env_var secret_file",
|
||||
"permissions.*.network.mitm.hooks.*" => "action body headers host methods path_prefixes ports query schemes",
|
||||
"plugins.*" => "apps auto_provision enabled mcp_servers release_id remote_plugin_id",
|
||||
"plugins.*.mcp_servers.*" => "default_tools_approval_mode disabled_tools ema_auth enabled enabled_tools tools",
|
||||
"profiles.*" => "analytics approval_policy approvals_reviewer chatgpt_base_url experimental_compact_prompt_file
|
||||
experimental_use_unified_exec_tool features include_apps_instructions
|
||||
include_collaboration_mode_instructions include_environment_context include_environment_context_time
|
||||
include_permissions_instructions js_repl_node_module_dirs js_repl_node_path model model_catalog_json
|
||||
model_instructions_file model_provider model_reasoning_effort model_reasoning_summary
|
||||
model_verbosity oss_provider personality plan_mode_reasoning_effort sandbox_mode service_tier tools
|
||||
tui web_search windows",
|
||||
"profiles.*.tools" | "tools" => "experimental_request_user_input update_plan web_search",
|
||||
"profiles.*.tools.web_search" | "tools.web_search" => "allowed_domains context_size location",
|
||||
"profiles.*.tools.web_search.location" | "tools.web_search.location" => "city country region timezone",
|
||||
"profiles.*.tui" => "session_picker_view whimsy",
|
||||
"profiles.*.windows" | "windows" => "allow_mxc sandbox",
|
||||
"projects.*" => "trust_level",
|
||||
"realtime" => "transport type version voice",
|
||||
"responses" => "process_mode",
|
||||
"rollout_trace" => "max_bytes max_payload_bytes",
|
||||
"sandbox_workspace_write" => "exclude_slash_tmp exclude_tmpdir_env_var network_access writable_roots",
|
||||
"shell_environment_policy" => "exclude experimental_use_profile filters ignore_default_excludes include_only inherit set",
|
||||
"skills" => "bundled config include_instructions max_context_tokens",
|
||||
"skills.config" => "enabled name path",
|
||||
"tool_suggest" => "disabled_tools discoverables",
|
||||
"tui" => "agents_overview_grouping alternate_screen animations auto_recap collapse_turn_details copy_on_select
|
||||
copy_on_select_clear_selection default_hosts disable_paste_burst effects fullscreen_transcript
|
||||
keymap model_availability_nux mouse_scroll_speed notification_condition notification_method
|
||||
notifications pet pet_anchor presets question_esc_back raw_output_mode rendering resume_cwd
|
||||
right_click_paste screen_reader_detection_done session_picker_view show_server_version_notice
|
||||
show_tooltips sidebar_width_percent status_line status_line_provider status_line_use_colors
|
||||
terminal_resize_reflow_max_rows terminal_title theme vim_mode_default whimsy",
|
||||
"tui.effects" => "effort progress shimmer starfield title welcome",
|
||||
"tui.keymap" => "agents approval chat composer editor global list pager vim_normal vim_operator vim_search
|
||||
vim_text_object",
|
||||
"tui.keymap.agents" => "archive delete fork hide new_task new_worktree next_group previous_group rename resume search stop
|
||||
toggle_grouping toggle_pin",
|
||||
"tui.keymap.approval" => "approve approve_for_prefix approve_for_session cancel decline deny open_fullscreen open_thread",
|
||||
"tui.keymap.chat" => "decrease_reasoning_effort edit_queued_message increase_reasoning_effort interrupt_turn
|
||||
next_permission_mode open_presets previous_permission_mode prompt_stack_back skip_question
|
||||
toggle_voice toggle_voice_mute",
|
||||
"tui.keymap.composer" => "history_search_next history_search_previous queue redo submit toggle_shortcuts undo",
|
||||
"tui.keymap.editor" => "delete_backward delete_backward_word delete_forward delete_forward_word insert_newline kill_line_end
|
||||
kill_line_start kill_whole_line move_down move_left move_line_end move_line_start move_right move_up
|
||||
move_word_left move_word_right yank",
|
||||
"tui.keymap.global" => "change_host choose_cloud_environment clear_terminal close_sidebar_tab copy equalize_pane_widths
|
||||
find_transcript focus_activity focus_main_composer focus_pane_left focus_pane_right
|
||||
focus_sidebar_content focus_sidebar_tabs hide_pane leader maximize_pane_width minimize_pane_width
|
||||
move_divider_left move_divider_right open_agents open_external_editor open_transcript queue
|
||||
resize_panes select_transcript sidebar_down sidebar_up submit toggle_fast_mode toggle_pane_zoom
|
||||
toggle_raw_output toggle_shortcuts toggle_side_conversation toggle_vim_mode",
|
||||
"tui.keymap.list" => "accept cancel jump_bottom jump_top move_down move_left move_right move_up page_down page_up",
|
||||
"tui.keymap.pager" => "close close_transcript find half_page_down half_page_up jump_bottom jump_top mark_markdown page_down
|
||||
page_up scroll_down scroll_up",
|
||||
"tui.keymap.vim_normal" => "append_after_cursor append_line_end cancel_operator change_to_line_end delete_char
|
||||
delete_to_line_end enter_insert enter_replace_mode find_backward find_forward insert_line_start
|
||||
jump_bottom jump_top move_down move_left move_line_end move_line_start move_right move_up
|
||||
move_word_backward move_word_end move_word_forward open_line_above open_line_below paste_after redo
|
||||
repeat_last_change replace_char start_change_operator start_delete_operator start_yank_operator
|
||||
substitute_char till_backward till_forward undo yank_line",
|
||||
"tui.keymap.vim_operator" => "cancel delete_line motion_down motion_find_backward motion_find_forward motion_jump_bottom
|
||||
motion_jump_top motion_left motion_line_end motion_line_start motion_right motion_till_backward
|
||||
motion_till_forward motion_up motion_word_backward motion_word_end motion_word_forward
|
||||
select_around_text_object select_inner_text_object yank_line",
|
||||
"tui.keymap.vim_search" => "backward forward next previous",
|
||||
"tui.keymap.vim_text_object" => "backtick big_word braces brackets cancel double_quote parentheses single_quote word",
|
||||
"tui.presets.*" => "input label",
|
||||
"tui.rendering" => "lists math mermaid tables",
|
||||
"tui.status_line_provider" => "server tool",
|
||||
_ => "",
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ mod approval_mode_cli_arg;
|
||||
mod cloud_options;
|
||||
mod config_override;
|
||||
pub(crate) mod format_env_display;
|
||||
mod legacy_fields;
|
||||
mod resume_command;
|
||||
mod sandbox_mode_cli_arg;
|
||||
mod shared_options;
|
||||
|
||||
@@ -479,8 +479,8 @@ describe("Codex", () => {
|
||||
config: {
|
||||
approval_policy: "never",
|
||||
sandbox_workspace_write: { network_access: true },
|
||||
retry_budget: 3,
|
||||
tool_rules: { allow: ["git status", "git diff"] },
|
||||
project_doc_max_bytes: 4096,
|
||||
shell_environment_policy: { exclude: ["VAR_A", "VAR_B"] },
|
||||
},
|
||||
});
|
||||
|
||||
@@ -492,8 +492,8 @@ describe("Codex", () => {
|
||||
expect(commandArgs).toBeDefined();
|
||||
expectPair(commandArgs, ["--config", 'approval_policy="never"']);
|
||||
expectPair(commandArgs, ["--config", "sandbox_workspace_write.network_access=true"]);
|
||||
expectPair(commandArgs, ["--config", "retry_budget=3"]);
|
||||
expectPair(commandArgs, ["--config", 'tool_rules.allow=["git status", "git diff"]']);
|
||||
expectPair(commandArgs, ["--config", "project_doc_max_bytes=4096"]);
|
||||
expectPair(commandArgs, ["--config", 'shell_environment_policy.exclude=["VAR_A", "VAR_B"]']);
|
||||
} finally {
|
||||
cleanup();
|
||||
restore();
|
||||
|
||||
Reference in New Issue
Block a user