Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions codex-rs/core/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,6 @@
"browser_use_external": {
"type": "boolean"
},
"child_agents_md": {
"type": "boolean"
},
"chronicle": {
"type": "boolean"
},
Expand Down Expand Up @@ -4689,9 +4686,6 @@
"browser_use_external": {
"type": "boolean"
},
"child_agents_md": {
"type": "boolean"
},
"chronicle": {
"type": "boolean"
},
Expand Down
9 changes: 0 additions & 9 deletions codex-rs/core/src/agents_md.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ use codex_config::merge_toml_values;
use codex_config::project_root_markers_from_config;
use codex_exec_server::ExecutorFileSystem;
use codex_extension_api::UserInstructions;
use codex_features::Feature;
use codex_prompts::HIERARCHICAL_AGENTS_MESSAGE;
use codex_utils_absolute_path::AbsolutePathBuf;
use codex_utils_path_uri::PathUri;
use std::io;
Expand Down Expand Up @@ -72,13 +70,6 @@ pub(crate) async fn load_project_instructions(
}
}

if config.features.enabled(Feature::ChildAgentsMd) {
loaded.entries.push(InstructionEntry {
contents: HIERARCHICAL_AGENTS_MESSAGE.to_string(),
provenance: InstructionProvenance::Internal,
});
}

(!loaded.is_empty()).then_some(loaded)
}

Expand Down
96 changes: 0 additions & 96 deletions codex-rs/core/src/agents_md_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,32 +909,6 @@ async fn secondary_environment_invalid_utf8_does_not_suppress_other_docs() {
assert!(loaded.text().contains("secondary\u{FFFD}doc"));
}

#[tokio::test]
async fn child_agents_guidance_is_appended_once_after_environment_groups() {
let primary = tempfile::tempdir().expect("primary tempdir");
let secondary = tempfile::tempdir().expect("secondary tempdir");
fs::write(primary.path().join("AGENTS.md"), "primary doc").unwrap();
fs::write(secondary.path().join("AGENTS.md"), "secondary doc").unwrap();
let mut config = make_config(&primary, /*limit*/ 4096, /*instructions*/ None).await;
config.features.enable(Feature::ChildAgentsMd).unwrap();
let environments = resolved_local_environments([
("primary", config.cwd.clone()),
("secondary", secondary.abs()),
]);

let loaded = load_project_instructions(
&config.config,
/*user_instructions*/ None,
&environments,
)
.await
.expect("instructions expected");
let text = loaded.text();

assert_eq!(text.matches(HIERARCHICAL_AGENTS_MESSAGE).count(), 1);
assert!(text.ends_with(HIERARCHICAL_AGENTS_MESSAGE));
}

/// If there are existing system instructions but AGENTS.md docs are
/// missing we expect the original instructions to be returned unchanged.
#[tokio::test]
Expand Down Expand Up @@ -1098,32 +1072,6 @@ async fn agents_md_paths_preserve_symlinked_cwd() {
assert_eq!(res, "project doc");
}

#[tokio::test]
async fn child_agents_message_after_global_instructions_uses_plain_separator() {
let tmp = tempfile::tempdir().expect("tempdir");
let mut cfg = make_config(&tmp, /*limit*/ 4096, Some("global doc")).await;
cfg.features.enable(Feature::ChildAgentsMd).unwrap();

let loaded = load_agents_md(&cfg).await.expect("instructions expected");
let global_agents = cfg.codex_home.join(DEFAULT_AGENTS_MD_FILENAME);
let expected = LoadedAgentsMd {
user_instructions: Some(UserInstructions {
text: "global doc".to_string(),
source: global_agents,
}),
entries: vec![InstructionEntry {
contents: HIERARCHICAL_AGENTS_MESSAGE.to_string(),
provenance: InstructionProvenance::Internal,
}],
};

assert_eq!(loaded, expected);
assert_eq!(
loaded.text(),
format!("global doc\n\n{HIERARCHICAL_AGENTS_MESSAGE}")
);
}

#[tokio::test]
async fn instruction_sources_include_global_before_agents_md_docs() {
let tmp = tempfile::tempdir().expect("tempdir");
Expand Down Expand Up @@ -1162,50 +1110,6 @@ async fn instruction_sources_include_global_before_agents_md_docs() {
);
}

#[tokio::test]
async fn child_agents_message_after_project_docs_is_not_an_instruction_source() {
let tmp = tempfile::tempdir().expect("tempdir");
fs::write(tmp.path().join("AGENTS.md"), "project doc").unwrap();

let mut cfg = make_config(&tmp, /*limit*/ 4096, Some("global doc")).await;
cfg.features.enable(Feature::ChildAgentsMd).unwrap();
let global_agents = cfg.codex_home.join(DEFAULT_AGENTS_MD_FILENAME);
fs::create_dir_all(&cfg.codex_home).unwrap();
fs::write(&global_agents, "global doc").unwrap();

let loaded = load_agents_md(&cfg).await.expect("instructions expected");
let project_agents = cfg.cwd.join("AGENTS.md");

let expected = LoadedAgentsMd {
user_instructions: Some(UserInstructions {
text: "global doc".to_string(),
source: global_agents.clone(),
}),
entries: vec![
InstructionEntry {
contents: "project doc".to_string(),
provenance: project_provenance(project_agents.clone(), cfg.cwd.clone()),
},
InstructionEntry {
contents: HIERARCHICAL_AGENTS_MESSAGE.to_string(),
provenance: InstructionProvenance::Internal,
},
],
};
assert_eq!(loaded, expected);
assert_eq!(
loaded.sources().collect::<Vec<_>>(),
vec![
PathUri::from_abs_path(&global_agents),
PathUri::from_abs_path(&project_agents),
]
);
assert_eq!(
loaded.text(),
format!("global doc{AGENTS_MD_SEPARATOR}project doc\n\n{HIERARCHICAL_AGENTS_MESSAGE}")
);
}

/// AGENTS.override.md is preferred over AGENTS.md when both are present.
#[tokio::test]
async fn agents_local_md_preferred() {
Expand Down
97 changes: 0 additions & 97 deletions codex-rs/core/tests/suite/hierarchical_agents.rs

This file was deleted.

1 change: 0 additions & 1 deletion codex-rs/core/tests/suite/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ mod extension_sandbox;
mod fork_thread;
#[cfg(not(target_os = "windows"))]
mod guardian_review;
mod hierarchical_agents;
#[cfg(not(target_os = "windows"))]
mod hooks;
#[cfg(not(target_os = "windows"))]
Expand Down
10 changes: 5 additions & 5 deletions codex-rs/core/tests/suite/unstable_features_warning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ async fn emits_warning_when_unstable_features_enabled_via_config() {
let mut config = load_default_config_for_test(&home).await;
config
.features
.enable(Feature::ChildAgentsMd)
.enable(Feature::ApplyPatchStreamingEvents)
.expect("test config should allow feature update");
let user_config_path =
AbsolutePathBuf::from_absolute_path(config.codex_home.join(CONFIG_TOML_FILE))
.expect("absolute user config path");
config.config_layer_stack = config.config_layer_stack.with_user_config(
&user_config_path,
toml! { features = { child_agents_md = true } }.into(),
toml! { features = { apply_patch_streaming_events = true } }.into(),
);

let thread_manager = codex_core::test_support::thread_manager_with_models_provider(
Expand Down Expand Up @@ -56,7 +56,7 @@ async fn emits_warning_when_unstable_features_enabled_via_config() {
let EventMsg::Warning(WarningEvent { message }) = warning else {
panic!("expected warning event");
};
assert!(message.contains("child_agents_md"));
assert!(message.contains("apply_patch_streaming_events"));
assert!(message.contains("Under-development features enabled"));
assert!(message.contains("suppress_unstable_features_warning = true"));
}
Expand All @@ -67,15 +67,15 @@ async fn suppresses_warning_when_configured() {
let mut config = load_default_config_for_test(&home).await;
config
.features
.enable(Feature::ChildAgentsMd)
.enable(Feature::ApplyPatchStreamingEvents)
.expect("test config should allow feature update");
config.suppress_unstable_features_warning = true;
let user_config_path =
AbsolutePathBuf::from_absolute_path(config.codex_home.join(CONFIG_TOML_FILE))
.expect("absolute user config path");
config.config_layer_stack = config.config_layer_stack.with_user_config(
&user_config_path,
toml! { features = { child_agents_md = true } }.into(),
toml! { features = { apply_patch_streaming_events = true } }.into(),
);

let thread_manager = codex_core::test_support::thread_manager_with_models_provider(
Expand Down
8 changes: 0 additions & 8 deletions codex-rs/features/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ pub enum Feature {
LocalThreadStoreCompression,
/// Enable the Chronicle sidecar for passive screen-context memories.
Chronicle,
/// Append additional AGENTS.md guidance to user instructions.
ChildAgentsMd,
/// Compress request bodies (zstd) when sending streaming requests to codex-backend.
EnableRequestCompression,
/// Start the managed network proxy for sandboxed sessions.
Expand Down Expand Up @@ -910,12 +908,6 @@ pub const FEATURES: &[FeatureSpec] = &[
stage: Stage::UnderDevelopment,
default_enabled: false,
},
FeatureSpec {
id: Feature::ChildAgentsMd,
key: "child_agents_md",
stage: Stage::UnderDevelopment,
default_enabled: false,
},
FeatureSpec {
id: Feature::ApplyPatchFreeform,
key: "apply_patch_freeform",
Comment on lines 912 to 913

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve child_agents_md as a removed compatibility flag

When a user or wrapper still passes --enable child_agents_md, or runs --strict-config with [features].child_agents_md in config.toml, this key is now unknown because is_known_feature_key only recognizes entries from FEATURES and legacy aliases. That blocks CLI startup or strict config loading instead of treating the removed experiment as a no-op; keep a Stage::Removed registry entry/alias for child_agents_md like the other removed feature flags.

AGENTS.md reference: AGENTS.md:L103-L110

Useful? React with 👍 / 👎.

Expand Down
9 changes: 6 additions & 3 deletions codex-rs/features/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,12 +707,15 @@ fn materialize_resolved_enabled_writes_all_features_and_preserves_custom_config(
#[test]
fn unstable_warning_event_only_mentions_enabled_under_development_features() {
let mut configured_features = Table::new();
configured_features.insert("child_agents_md".to_string(), TomlValue::Boolean(true));
configured_features.insert(
"apply_patch_streaming_events".to_string(),
TomlValue::Boolean(true),
);
configured_features.insert("personality".to_string(), TomlValue::Boolean(true));
configured_features.insert("unknown".to_string(), TomlValue::Boolean(true));

let mut features = Features::with_defaults();
features.enable(Feature::ChildAgentsMd);
features.enable(Feature::ApplyPatchStreamingEvents);

let warning = unstable_features_warning_event(
Some(&configured_features),
Expand All @@ -725,7 +728,7 @@ fn unstable_warning_event_only_mentions_enabled_under_development_features() {
let EventMsg::Warning(WarningEvent { message }) = warning.msg else {
panic!("expected warning event");
};
assert!(message.contains("child_agents_md"));
assert!(message.contains("apply_patch_streaming_events"));
assert!(!message.contains("personality"));
assert!(message.contains("/tmp/config.toml"));
}
Expand Down
1 change: 0 additions & 1 deletion codex-rs/prompts/src/agents.rs

This file was deleted.

2 changes: 0 additions & 2 deletions codex-rs/prompts/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mod agents;
mod apply_patch;
mod compact;
mod goals;
Expand All @@ -7,7 +6,6 @@ mod realtime;
mod review_exit;
mod review_request;

pub use agents::HIERARCHICAL_AGENTS_MESSAGE;
pub use apply_patch::APPLY_PATCH_TOOL_INSTRUCTIONS;
pub use compact::SUMMARIZATION_PROMPT;
pub use compact::SUMMARY_PREFIX;
Expand Down
7 changes: 0 additions & 7 deletions codex-rs/prompts/templates/agents/hierarchical.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/agents_md.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# AGENTS.md

For information about AGENTS.md, see [this documentation](https://developers.openai.com/codex/guides/agents-md).

## Hierarchical agents message

When the `child_agents_md` feature flag is enabled (via `[features]` in `config.toml`), Codex appends additional guidance about AGENTS.md scope and precedence to the user instructions message and emits that message even when no AGENTS.md is present.
Loading