fix(core): adapt watchdog role branch to refreshed main

Keep the role-driven watchdog branch aligned with the refreshed list_agents and spawn event APIs after rebasing on the updated subagent inbox branch.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Friel
2026-03-27 20:07:56 -07:00
parent 074216d951
commit 7a079455d3
6 changed files with 12 additions and 3 deletions

View File

@@ -454,7 +454,7 @@ impl AgentControl {
};
reservation.commit(agent_metadata);
state.notify_thread_created(new_thread.thread_id);
self.send_input(new_thread.thread_id, items).await?;
self.send_input(new_thread.thread_id, items.into()).await?;
Ok(new_thread.thread_id)
}
@@ -963,7 +963,7 @@ impl AgentControl {
.join("\n")
}
pub(crate) async fn list_agents(
pub(crate) async fn list_agents_by_path(
&self,
current_session_source: &SessionSource,
path_prefix: Option<&str>,

View File

@@ -30,6 +30,7 @@ use crate::hook_runtime::record_additional_contexts;
use crate::hook_runtime::record_pending_input;
use crate::models_manager::manager::ModelsManager;
use crate::protocol::EventMsg;
use crate::protocol::TokenUsage;
use crate::protocol::TurnAbortReason;
use crate::protocol::TurnAbortedEvent;
use crate::protocol::TurnCompleteEvent;

View File

@@ -1,5 +1,6 @@
use super::*;
use crate::agent::AgentListing;
use crate::agent::agent_resolver::resolve_agent_target;
pub(crate) struct Handler;

View File

@@ -1,4 +1,5 @@
use super::*;
use crate::agent::agent_resolver::resolve_agent_targets;
use crate::agent::status::is_final;
use crate::error::CodexErr;
use futures::FutureExt;

View File

@@ -31,7 +31,7 @@ impl ToolHandler for Handler {
let agents = session
.services
.agent_control
.list_agents(&turn.session_source, args.path_prefix.as_deref())
.list_agents_by_path(&turn.session_source, args.path_prefix.as_deref())
.await
.map_err(collab_spawn_error)?;

View File

@@ -5,6 +5,7 @@ use crate::agent::next_thread_spawn_depth;
use crate::agent::role::DEFAULT_ROLE_NAME;
use crate::agent::role::apply_role_to_config;
use codex_protocol::AgentPath;
use codex_protocol::protocol::AgentSpawnMode;
use codex_protocol::protocol::InterAgentCommunication;
use codex_protocol::protocol::Op;
@@ -170,6 +171,11 @@ impl ToolHandler for Handler {
prompt,
model: effective_model,
reasoning_effort: effective_reasoning_effort,
spawn_mode: if args.fork_context {
AgentSpawnMode::Fork
} else {
AgentSpawnMode::Spawn
},
status,
}
.into(),