mirror of
https://github.com/openai/codex.git
synced 2026-05-03 10:56:37 +00:00
Keep max-depth collab tool schemas stable
This commit is contained in:
@@ -419,16 +419,10 @@ impl AgentControl {
|
||||
|
||||
async fn resume_single_agent_from_rollout(
|
||||
&self,
|
||||
mut config: crate::config::Config,
|
||||
config: crate::config::Config,
|
||||
thread_id: ThreadId,
|
||||
session_source: SessionSource,
|
||||
) -> CodexResult<ThreadId> {
|
||||
if let SessionSource::SubAgent(SubAgentSource::ThreadSpawn { depth, .. }) = &session_source
|
||||
&& *depth >= config.agent_max_depth
|
||||
{
|
||||
let _ = config.features.disable(Feature::SpawnCsv);
|
||||
let _ = config.features.disable(Feature::Collab);
|
||||
}
|
||||
let state = self.upgrade()?;
|
||||
let mut reservation = self.state.reserve_spawn_slot(config.agent_max_threads)?;
|
||||
let (session_source, agent_metadata) = match session_source {
|
||||
|
||||
@@ -496,13 +496,6 @@ impl Codex {
|
||||
);
|
||||
}
|
||||
|
||||
if let SessionSource::SubAgent(SubAgentSource::ThreadSpawn { depth, .. }) = session_source
|
||||
&& depth >= config.agent_max_depth
|
||||
{
|
||||
let _ = config.features.disable(Feature::SpawnCsv);
|
||||
let _ = config.features.disable(Feature::Collab);
|
||||
}
|
||||
|
||||
if config.features.enabled(Feature::JsRepl)
|
||||
&& let Err(err) = resolve_compatible_node(config.js_repl_node_path.as_deref()).await
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@ use crate::models_manager::manager::RefreshStrategy;
|
||||
use crate::tools::context::FunctionToolOutput;
|
||||
use crate::tools::context::ToolOutput;
|
||||
use crate::tools::context::ToolPayload;
|
||||
use codex_features::Feature;
|
||||
use codex_protocol::AgentPath;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_protocol::models::BaseInstructions;
|
||||
@@ -264,12 +263,7 @@ pub(crate) fn apply_spawn_agent_runtime_overrides(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn apply_spawn_agent_overrides(config: &mut Config, child_depth: i32) {
|
||||
if child_depth >= config.agent_max_depth && !config.features.enabled(Feature::MultiAgentV2) {
|
||||
let _ = config.features.disable(Feature::SpawnCsv);
|
||||
let _ = config.features.disable(Feature::Collab);
|
||||
}
|
||||
}
|
||||
pub(crate) fn apply_spawn_agent_overrides(_config: &mut Config, _child_depth: i32) {}
|
||||
|
||||
pub(crate) async fn apply_requested_spawn_agent_model_overrides(
|
||||
session: &Session,
|
||||
|
||||
@@ -1762,6 +1762,10 @@ async fn spawn_agent_allows_depth_up_to_configured_max_depth() {
|
||||
|
||||
let mut config = (*turn.config).clone();
|
||||
config.agent_max_depth = DEFAULT_AGENT_MAX_DEPTH + 1;
|
||||
config
|
||||
.features
|
||||
.enable(Feature::SpawnCsv)
|
||||
.expect("test config should allow spawn_csv");
|
||||
turn.config = Arc::new(config);
|
||||
turn.session_source = SessionSource::SubAgent(SubAgentSource::ThreadSpawn {
|
||||
parent_thread_id: session.conversation_id,
|
||||
@@ -1785,6 +1789,12 @@ async fn spawn_agent_allows_depth_up_to_configured_max_depth() {
|
||||
let result: SpawnAgentResult =
|
||||
serde_json::from_str(&content).expect("spawn_agent result should be json");
|
||||
assert!(!result.agent_id.is_empty());
|
||||
let child_thread = manager
|
||||
.get_thread(parse_agent_id(&result.agent_id))
|
||||
.await
|
||||
.expect("spawned max-depth child thread should exist");
|
||||
assert!(child_thread.enabled(Feature::Collab));
|
||||
assert!(child_thread.enabled(Feature::SpawnCsv));
|
||||
assert!(
|
||||
result
|
||||
.nickname
|
||||
|
||||
Reference in New Issue
Block a user