feat: add thread spawn source for collab tools (#9769)

This commit is contained in:
jif-oai
2026-01-24 15:21:34 +01:00
committed by GitHub
parent eb7558ba85
commit 515ac2cd19
7 changed files with 75 additions and 26 deletions

View File

@@ -78,6 +78,8 @@ impl ToolHandler for CollabHandler {
mod spawn {
use super::*;
use crate::agent::AgentRole;
use codex_protocol::protocol::SessionSource;
use codex_protocol::protocol::SubAgentSource;
use std::sync::Arc;
#[derive(Debug, Deserialize)]
@@ -125,7 +127,13 @@ mod spawn {
let result = session
.services
.agent_control
.spawn_agent(config, prompt.clone())
.spawn_agent(
config,
prompt.clone(),
Some(SessionSource::SubAgent(SubAgentSource::ThreadSpawn {
parent_thread_id: session.conversation_id,
})),
)
.await
.map_err(collab_spawn_error);
let (new_thread_id, status) = match &result {