Repository navigation
Description
Summary
Steering a running Codex thread that has used sub-agents can target the wrong turn. After a sub-agent (child) is resumed, its turn start is treated as a root-turn lifecycle event and replaces the stored root turn id, so a later steer is sent to a stale/incorrect turn id instead of the running one.
Versions and environment
- bb 0.46.0, Codex provider, local host
- Code inspected at base commit
98ea40bb
Steps to reproduce
Unverified as a live deterministic repro (needs a Codex thread that spawns then resumes a sub-agent). Closest faithful repro is a translator unit test in plugins/provider-codex/src/translator.test.ts:
- Root turn starts; a sub-agent is spawned (
spawnactivity); child turn 1 starts and completes. - Child turn 2 starts on the same agent thread (resume) before its follow-up activity event arrives.
- Follow-up activity arrives, then child turn 2 completes.
Expected vs actual
- Expected: child turn 2 is linked to its parent tool call and never treated as the root turn; steering targets the running root turn.
- Actual (live): in thread
thr_sntrwk26wna steer was delivered to Codex turn01a142a5…while the running turn was01a14239…, and the send failed.
Evidence
Cause (my reading): in translator.ts the parent-tool-call mapping for a turn start is looked up only via delegationParentToolCallIdsByProviderThreadId; a resumed child that is already tracked (findTrackedSubAgentByAgentThreadId) but not yet in that map falls through and is handled as a root turn. Also beginCodexTrackedSubAgent does not re-point existing turn-to-call mappings when the same agent thread gets a new activity id.
Fix with regression test: commit 7b2fd41.
What you ruled out
- Not Bug - Refusing to start a competing turn for thread "<threadid>" while another turn is active or starting (Codex) #2538 (competing turn refusal): that is about starting a second turn; here the wrong id is used for steering.
Suggested priority and effort
Medium; steering is rejected or lost on affected threads, workaround is to wait for the turn to finish. Effort likely Low.
A fix is available in #5646 (closed automatically by the new-contributor bot); happy for maintainers to take it or use it as reference.
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 17, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotprovidersandprovider-codex; no existing classifications were replaced.confirmed-repro.git diff --checkpass.Keep resumed Codex child lifecycles nested (#5675)