Fix collab tools at max agent depth

This commit is contained in:
Dave Aitel
2026-02-05 12:45:18 -05:00
parent e112e79b8a
commit 001cfb5bba
2 changed files with 3 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ pub(crate) mod status;
pub(crate) use codex_protocol::protocol::AgentStatus;
pub(crate) use control::AgentControl;
#[cfg(test)]
pub(crate) use guards::MAX_THREAD_SPAWN_DEPTH;
pub(crate) use guards::exceeds_thread_spawn_depth_limit;
pub(crate) use guards::next_thread_spawn_depth;

View File

@@ -10,8 +10,8 @@ use crate::CodexAuth;
use crate::SandboxState;
use crate::agent::AgentControl;
use crate::agent::AgentStatus;
use crate::agent::MAX_THREAD_SPAWN_DEPTH;
use crate::agent::agent_status_from_event;
use crate::agent::exceeds_thread_spawn_depth_limit;
use crate::analytics_client::AnalyticsEventsClient;
use crate::analytics_client::build_track_events_context;
use crate::compact;
@@ -274,7 +274,7 @@ impl Codex {
}
if let SessionSource::SubAgent(SubAgentSource::ThreadSpawn { depth, .. }) = session_source
&& depth >= MAX_THREAD_SPAWN_DEPTH
&& exceeds_thread_spawn_depth_limit(depth)
{
config.features.disable(Feature::Collab);
}