Add an async user messaging opt-in for spawned subagents (#63069)

## Why

Async user messaging was limited to root agents. Spawned subagents need
their own opt-in so they can send messages without requiring the root
feature flag.

## What changed

Add independent `root_agent` and `subagents` settings under
`features.send_message_to_user_async`. For example, this opts spawned
subagents in and turns off the root feature flag:

```toml
[features.send_message_to_user_async]
root_agent = false
subagents = true
```

The existing boolean shorthand still sets the root feature flag, and the
model catalog can still enable the tool for the root agent. Config layer
merges, CLI overrides, and feature toggle edits preserve the separate
`subagents` setting when changing the root flag.

## Testing

Extend coverage for tool availability across root agents, spawned
subagents, and compaction helpers, and for preserving the subagent
setting when applying boolean overrides.

GitOrigin-RevId: 5f34f182bc107d32797143a58f0d79395767ed49
This commit is contained in:
Won Park
2026-11-22 01:25:05 +00:00
committed by copyberry
parent d4014cb19d
commit 8653ca9e99
17 changed files with 229 additions and 95 deletions
+3 -1
View File
@@ -1408,7 +1408,9 @@ async fn dispatch_cli(
continue;
}
let value = if let Some(table) = value.as_table() {
let Some(enabled) = table.get("enabled") else {
let Some(enabled) =
table.get(codex_features::feature_toggle_field(name))
else {
continue;
};
enabled
+4 -1
View File
@@ -187,6 +187,8 @@ fn explicit_restart_applies_feature_overrides_and_preserves_saved_settings() ->
"connectors",
"-c",
"features.network_proxy.enabled=false",
"-c",
"features.send_message_to_user_async.root_agent=true",
],
true,
),
@@ -216,7 +218,8 @@ fn explicit_restart_applies_feature_overrides_and_preserves_saved_settings() ->
"api_key_model_discovery": discovery,
"auth_elicitation": true,
"apps": false,
"network_proxy": false
"network_proxy": false,
"send_message_to_user_async": true
})
);
assert_eq!(settings["updater"]["autoUpdateEnabled"], false);