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
Agent runtime: process-ownership fix (#3308) covers Claude chat and headless only — Codex/Gemini keep a stale registry entry, and a failure before the reader starts leaks one #3408
Follow-up to #3308 (fixes #3307), found while validating it for the merge train. Neither blocks that PR.
1. The fix covers two of four runtimes
#3308 makes process_registry.unregister() refuse to drop an entry whose process is still alive, and adds worker-completion cleanup so the executor thread unregisters once the child exits. The registry change is global; the worker cleanup was added only to Claude chat and headless.
codex_runtime.py and gemini_runtime.py still rely on the waiter's finally. When the waiter is cancelled while the child is alive, that finally is now a no-op, and nothing unregisters after the child exits: the entry stays, and log subscribers never receive stream_end.
Found by reading the code; no test covers it.
2. A failure between register() and the reader start leaks the entry
Paths that call registry.unregister() after a failed stdin write (claude_code.py, gemini_runtime.py in two places, headless_executor.py) are now a no-op when the child is still alive, and nothing retries.
Reproduced with a probe (live child, stdin write forced to raise): on the #3308 head the child stays registered, listed as running and allowlisted from the orphan sweep, and the entry and its log buffer remain after the child dies. On dev before #3308 the entry is dropped.
Reachability is unproven: in the realistic broken-pipe case the child is already dead or dying.
Acceptance criteria
Codex and Gemini runtimes unregister on worker completion after an abandoned waiter, with a test per runtime that executes the path (cancel the waiter with a live child, let the child exit, assert the entry is gone and stream_end is delivered).
The failed-write paths terminate the process group before unregistering, with a test that drives a live child through a failing stdin write and asserts no entry and no live child remain.
Activity
AndriiPasternak31 commentedon Oct 27, 2026
/claim
github-actions commentedon Oct 27, 2026
Claimed by @AndriiPasternak31. Label
status-in-progressadded.Next steps:
feature/3408-<short-slug>Fixes #3408fix(codex): release an abandoned Codex waiter's child when its reader…
fix(agent-runtime): a failed prompt handoff kills the child and obser…
fix(agent-runtime): name termination_unconfirmed in the agent's termi…
fix(gemini): reap the headless child before the reader raises (#4011)
fix(agent-runtime): an abandoned Gemini waiter hands release to its s…