mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Simplify multi-agent mode controls (#29324)
## Why Multi-agent delegation policy was split across `multiAgentMode`, `features.multi_agent_mode`, and `usage_hint_enabled`. These controls could disagree: a requested mode could be downgraded by the feature flag, and disabling usage hints also disabled mode instructions. Some clients also need multi-agent tools without adding delegation-policy text to model context. The previous two-mode API could not express that directly. ## What changed `multiAgentMode` is now the only live delegation-policy control: | Mode | Behavior | | --- | --- | | `none` | Keep multi-agent tools available without adding mode instructions. | | `explicitRequestOnly` | Only delegate after an explicit user request. | | `proactive` | Delegate when parallel work materially improves speed or quality. | - new threads default to `explicitRequestOnly`; omitting the mode on later turns keeps the current value - thread start, resume, fork, and settings responses always report the concrete current mode instead of `null` - mode selection remains sticky across turns and resume - usage-hint text no longer controls whether mode instructions apply - `features.multi_agent_mode` and `usage_hint_enabled` remain accepted as ignored compatibility settings so existing configs continue to load - app-server documentation and generated schemas describe the three-mode API ## Tests - `just test -p codex-core multi_agent_mode` - `just test -p codex-core multi_agent_v2_config_from_feature_table` - `just test -p codex-core spawn_agent_description` - `just test -p codex-features` - `just test -p codex-app-server-protocol` - `just test -p codex-app-server multi_agent_mode`
This commit is contained in:
@@ -296,8 +296,10 @@ pub enum Personality {
|
||||
Pragmatic,
|
||||
}
|
||||
|
||||
/// Controls whether the model should only spawn sub-agents after an explicit
|
||||
/// user request or may delegate proactively when doing so would help.
|
||||
/// Controls whether the model receives multi-agent delegation instructions and,
|
||||
/// when it does, whether it should only spawn sub-agents after an explicit user
|
||||
/// request or may delegate proactively when doing so would help. `none` leaves
|
||||
/// the multi-agent tools available without injecting delegation instructions.
|
||||
#[derive(
|
||||
Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Display, JsonSchema, TS, Default,
|
||||
)]
|
||||
@@ -305,6 +307,7 @@ pub enum Personality {
|
||||
#[ts(rename_all = "camelCase")]
|
||||
#[strum(serialize_all = "camelCase")]
|
||||
pub enum MultiAgentMode {
|
||||
None,
|
||||
#[default]
|
||||
ExplicitRequestOnly,
|
||||
Proactive,
|
||||
|
||||
@@ -2005,7 +2005,7 @@ pub struct ThreadSettingsSnapshot {
|
||||
pub personality: Option<Personality>,
|
||||
pub collaboration_mode: CollaborationMode,
|
||||
#[serde(default)]
|
||||
pub multi_agent_mode: Option<MultiAgentMode>,
|
||||
pub multi_agent_mode: MultiAgentMode,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, Default, PartialEq, Eq, JsonSchema, TS)]
|
||||
|
||||
Reference in New Issue
Block a user