You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Deleting a thread leaves its subagent threads live #39199
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Start a Codex turn that spawns subagents, so the thread has subagent threads.
Delete the parent thread.
Read the shell snapshot, or look at orchestration_v2_projection_threads for rows whose lineage names the deleted thread with relationshipToParent: "subagent".
Expected behavior
Deleting a thread deletes its subagent threads too, as it already deletes its side chats and as deleting a project deletes all of its threads. A subagent's unfinished run is cancelled.
Actual behavior
The subagent threads stay live, with their full history, so the purge in #32378 never reaches them. An unfinished subagent run, such as one still starting, is not cancelled, although its result can no longer reach the deleted parent. On my install, 8 subagent threads were still live under deleted parents.
There is also a race: Codex reports a subagent's thread before the parent's subagent record, so a delete that reads the parent's subagent records can miss a child that is already there, and a child reported after the delete is created live.
#23900, #30363 and #30370 each work around these leftover children. #33884 is the same gap for archive.
Activity