mirror of
https://github.com/openai/codex.git
synced 2026-11-02 19:43:24 +00:00
Keep request_user_input visible in subagents
This commit is contained in:
@@ -2,6 +2,8 @@ use crate::codex::Session;
|
||||
use crate::codex::TurnContext;
|
||||
use crate::function_tool::FunctionCallError;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_protocol::protocol::SessionSource;
|
||||
use codex_protocol::protocol::SubAgentSource;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Resolves a single tool-facing agent target to a thread id.
|
||||
@@ -14,6 +16,13 @@ pub(crate) async fn resolve_agent_target(
|
||||
if let Ok(thread_id) = ThreadId::from_string(target) {
|
||||
return Ok(thread_id);
|
||||
}
|
||||
if matches!(target, "parent" | "root")
|
||||
&& let SessionSource::SubAgent(SubAgentSource::ThreadSpawn {
|
||||
parent_thread_id, ..
|
||||
}) = &turn.session_source
|
||||
{
|
||||
return Ok(*parent_thread_id);
|
||||
}
|
||||
|
||||
session
|
||||
.services
|
||||
|
||||
Reference in New Issue
Block a user