mirror of
https://github.com/openai/codex.git
synced 2026-11-08 20:40:33 +00:00
codex: address PR review feedback (#25032)
This commit is contained in:
@@ -97,6 +97,7 @@ use codex_protocol::models::SandboxEnforcement;
|
||||
use codex_protocol::models::format_allow_prefixes;
|
||||
use codex_protocol::openai_models::ModelInfo;
|
||||
use codex_protocol::openai_models::ModelPreset;
|
||||
use codex_protocol::openai_models::MultiAgentVersion;
|
||||
use codex_protocol::permissions::FileSystemSandboxPolicy;
|
||||
use codex_protocol::permissions::NetworkSandboxPolicy;
|
||||
use codex_protocol::protocol::AdditionalContextEntry;
|
||||
@@ -1650,7 +1651,7 @@ impl Session {
|
||||
turn_context: &TurnContext,
|
||||
msg: &EventMsg,
|
||||
) {
|
||||
if !self.enabled(Feature::MultiAgentV2) {
|
||||
if turn_context.multi_agent_version != Some(MultiAgentVersion::V2) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::session::turn_context::TurnContext;
|
||||
use codex_features::Feature;
|
||||
use codex_protocol::openai_models::MultiAgentVersion;
|
||||
use codex_protocol::protocol::SessionSource;
|
||||
use codex_protocol::protocol::SubAgentSource;
|
||||
|
||||
@@ -7,7 +7,7 @@ pub(super) fn usage_hint_text<'a>(
|
||||
turn_context: &'a TurnContext,
|
||||
session_source: &SessionSource,
|
||||
) -> Option<&'a str> {
|
||||
if !turn_context.features.enabled(Feature::MultiAgentV2) {
|
||||
if turn_context.multi_agent_version != Some(MultiAgentVersion::V2) {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
@@ -230,6 +230,8 @@ async fn remote_multi_agent_version_selector_overrides_feature_flags() -> Result
|
||||
.features
|
||||
.enable(Feature::MultiAgentV2)
|
||||
.expect("test config should allow feature update");
|
||||
config.multi_agent_v2.root_agent_usage_hint_text =
|
||||
Some("V2 guidance must not reach v1 models.".to_string());
|
||||
})
|
||||
.await?;
|
||||
assert_eq!(
|
||||
@@ -246,6 +248,12 @@ async fn remote_multi_agent_version_selector_overrides_feature_flags() -> Result
|
||||
selected_tool_names(&v1_body, &["send_message", "followup_task", "list_agents"]),
|
||||
Vec::<String>::new()
|
||||
);
|
||||
assert!(
|
||||
!v1_body
|
||||
.to_string()
|
||||
.contains("V2 guidance must not reach v1 models."),
|
||||
"v1 models should not receive v2 usage hints: {v1_body:?}"
|
||||
);
|
||||
|
||||
let mut v2_model = remote_model("test-multi-agent-v2");
|
||||
v2_model.multi_agent_version = Some(MultiAgentVersion::V2);
|
||||
@@ -259,6 +267,8 @@ async fn remote_multi_agent_version_selector_overrides_feature_flags() -> Result
|
||||
.disable(Feature::MultiAgentV2)
|
||||
.expect("test config should allow feature update");
|
||||
config.multi_agent_v2.max_concurrent_threads_per_session = 17;
|
||||
config.multi_agent_v2.root_agent_usage_hint_text =
|
||||
Some("V2 guidance should reach v2 models.".to_string());
|
||||
})
|
||||
.await?;
|
||||
assert_eq!(
|
||||
@@ -292,6 +302,12 @@ async fn remote_multi_agent_version_selector_overrides_feature_flags() -> Result
|
||||
),
|
||||
"v2 spawn_agent should advertise the configured concurrency cap: {v2_body:?}"
|
||||
);
|
||||
assert!(
|
||||
v2_body
|
||||
.to_string()
|
||||
.contains("V2 guidance should reach v2 models."),
|
||||
"v2 models should receive v2 usage hints: {v2_body:?}"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user