test(core): cover TOML fork_context override

This commit is contained in:
Friel
2026-04-01 23:46:01 +00:00
parent 2db7fc1034
commit fc08138cf0

View File

@@ -152,6 +152,29 @@ async fn default_fork_context_for_role_uses_explicit_custom_role_override() {
assert!(!default_fork_context_for_role(&config, Some("custom")));
}
#[tokio::test]
async fn default_fork_context_for_role_uses_explicit_custom_role_override_from_config_toml() {
let home = TempDir::new().expect("create temp dir");
tokio::fs::write(
home.path().join(CONFIG_TOML_FILE),
r#"[agents.custom]
description = "Custom role"
fork_context = false
"#,
)
.await
.expect("write config");
let config = ConfigBuilder::default()
.codex_home(home.path().to_path_buf())
.fallback_cwd(Some(home.path().to_path_buf()))
.build()
.await
.expect("load test config");
assert!(!default_fork_context_for_role(&config, Some("custom")));
}
#[tokio::test]
#[ignore = "No role requiring it for now"]
async fn apply_explorer_role_sets_model_and_adds_session_flags_layer() {