Skip to content

Commit cc70fee

Browse files
committed
Fix full-history model override guidance
1 parent 34c5303 commit cc70fee

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

‎codex-rs/core/src/config/config_tests.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11668,6 +11668,7 @@ fn multi_agent_v2_exposes_model_overrides_by_default() {
1166811668
.expect("model-override guidance should extend the base usage hint");
1166911669
for required_fragment in [
1167011670
"Full-history forks",
11671+
"accept explicit `model` and `reasoning_effort` overrides",
1167111672
"`fork_turns`",
1167211673
"`model`",
1167311674
"`reasoning_effort`",
@@ -11677,6 +11678,10 @@ fn multi_agent_v2_exposes_model_overrides_by_default() {
1167711678
"model-override guidance should contain {required_fragment}"
1167811679
);
1167911680
}
11681+
assert!(
11682+
!model_override_guidance.contains("do not accept overrides"),
11683+
"model-override guidance should not retain the obsolete prohibition"
11684+
);
1168011685
}
1168111686
}
1168211687

‎codex-rs/core/src/session/multi_agents.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Payload:
4747
```
4848
You may also see them addressed as to=/root/..., which indicates your identity is /root/...
4949
"#;
50-
const DEFAULT_MULTI_AGENT_V2_MODEL_OVERRIDE_USAGE_HINT_TEXT: &str = "Full-history forks (`fork_turns` omitted or `\"all\"`) inherit the parent model and reasoning effort and do not accept overrides. Only set `model` or `reasoning_effort` when explicitly requested by the user, applicable `AGENTS.md` instructions, or skill instructions; when doing so, set `fork_turns` to `\"none\"` or a positive integer string.";
50+
const DEFAULT_MULTI_AGENT_V2_MODEL_OVERRIDE_USAGE_HINT_TEXT: &str = "Full-history forks (`fork_turns` omitted or `\"all\"`) accept explicit `model` and `reasoning_effort` overrides. Only set these overrides when explicitly requested by the user, applicable `AGENTS.md` instructions, or skill instructions.";
5151
const DEFAULT_MULTI_AGENT_V2_WAIT_AGENT_USAGE_HINT_TEXT: &str =
5252
"When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling.";
5353
const DEFAULT_MULTI_AGENT_V2_SHARED_USAGE_HINT_TEXT: &str = r#"Note that collaboration tools cannot be called from inside `functions.exec`. Call `spawn_agent`, `send_message`, `followup_task`, `wait_agent`, `interrupt_agent`, and `list_agents` only as direct tool calls using the recipient shown in their tool definitions, such as `to=functions.collaboration.spawn_agent`, since they are intentionally absent from the `functions.exec` `tools.*` namespace. Available tools in `functions.exec` are explicitly described with a `tools` namespace in the developer message.

‎codex-rs/core/src/tools/handlers/multi_agents_spec.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ use std::collections::BTreeMap;
1414
pub const MULTI_AGENT_V1_NAMESPACE: &str = "multi_agent_v1";
1515
const MULTI_AGENT_V1_NAMESPACE_DESCRIPTION: &str = "Tools for spawning and managing sub-agents.";
1616

17-
const SPAWN_AGENT_INHERITED_MODEL_GUIDANCE: &str = "Spawned agents inherit your current model by default. Omit `model` to use that preferred default; set `model` only when an explicit override is needed.";
17+
const SPAWN_AGENT_INHERITED_MODEL_GUIDANCE: &str = "Spawned agents normally inherit your current model unless configured subagent defaults or a selected role apply. Omit `model` to use the resulting default; set `model` only when an explicit override is needed.";
1818
const SPAWN_AGENT_TYPE_OVERRIDE_DESCRIPTION_V1: &str = "Agent type override for the new agent. Omit to inherit the parent agent type with a full-history fork; otherwise, `default` is used.";
1919
const SPAWN_AGENT_MODEL_OVERRIDE_DESCRIPTION: &str =
2020
"Model override for the new agent. Omit unless an explicit override is needed.";
21+
const SPAWN_AGENT_REASONING_EFFORT_OVERRIDE_DESCRIPTION: &str =
22+
"Reasoning effort override for the new agent. Omit unless an explicit override is needed.";
2123
const SPAWN_AGENT_SERVICE_TIER_OVERRIDE_DESCRIPTION: &str =
2224
"Service tier override for the new agent. Omit unless explicitly requested.";
2325
const MAX_REASONING_EFFORT_CHARS_IN_SPAWN_AGENT_DESCRIPTION: usize = 64;
@@ -615,8 +617,7 @@ fn spawn_agent_common_properties_v1(agent_type_description: &str) -> BTreeMap<St
615617
(
616618
"reasoning_effort".to_string(),
617619
JsonSchema::string(Some(
618-
"Reasoning effort override for the new agent. Omit to inherit the parent effort."
619-
.to_string(),
620+
SPAWN_AGENT_REASONING_EFFORT_OVERRIDE_DESCRIPTION.to_string(),
620621
)),
621622
),
622623
(
@@ -659,8 +660,7 @@ fn spawn_agent_common_properties_v2(agent_type_description: &str) -> BTreeMap<St
659660
(
660661
"reasoning_effort".to_string(),
661662
JsonSchema::string(Some(
662-
"Reasoning effort override for the new agent. Omit to inherit the parent effort."
663-
.to_string(),
663+
SPAWN_AGENT_REASONING_EFFORT_OVERRIDE_DESCRIPTION.to_string(),
664664
)),
665665
),
666666
(

‎codex-rs/core/src/tools/handlers/multi_agents_spec_tests.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn spawn_agent_tool_v2_requires_task_name_and_lists_visible_models() {
113113
properties
114114
.get("reasoning_effort")
115115
.and_then(|schema| schema.description.as_deref()),
116-
Some("Reasoning effort override for the new agent. Omit to inherit the parent effort.")
116+
Some(SPAWN_AGENT_REASONING_EFFORT_OVERRIDE_DESCRIPTION)
117117
);
118118
assert_eq!(
119119
properties

0 commit comments

Comments
 (0)