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]: Automation terminal is retired ~60s after the agent idles, killing its pending background sub-agents #23942
Summary. A fresh (non-reused) terminal automation session is retired about 60 seconds after the Claude agent ends a turn. That still happens when the turn ended only to wait for background sub-agents. The pending sub-agents are killed with the session, and the agent never runs its final step. This looks like the terminal retirement added in #9493 (for #9479). The run's result is treated as final as soon as the agent is idle.
Setup. Local host, claude agent, sessionKind: terminal, workspaceMode: existing, reuseSession: false, every 10 minutes with a precheck. The prompt asks the agent to process a queue with one Claude Code sub-agent per item, then run a finishing command.
Timeline of one run (2026-09-29, UTC):
22:21:09: session created. The agent starts 3 background sub-agents and ends its turn.
22:22:47: the second sub-agent's notification is handled. The agent says "Waiting on " and ends its turn again.
22:23:48.6: Orca captures the output snapshot and marks the run completed.
22:23:48.7: the third sub-agent's completion notification is queued in the Claude transcript, but it is never processed.
22:23:50: daemon logs session-exited (cause: signaled) and session-killed (immediate: true) from the app's control client.
Every run of this kind since the app restarted that morning ends the same way: roughly 60 s after the last idle turn, with sub-agents still pending. Before that restart, the same automations kept their terminals. Their run records have a terminalSessionId, which is now null.
Expected. One of these:
An agent with pending background work is not treated as finished. Claude Code records pendingBackgroundAgentCount on its turn-end entries in the transcript.
A per-automation option to turn off retirement or lengthen the idle window.
The retirement behaviour documented, so automation prompts can avoid ending a turn early.
Workaround we're using. The prompt now makes the agent do all the work in a single turn, with no background sub-agents.
Activity
AmethystLiang commentedon Sep 30, 2026
Thanks for reporting. Looking into it
Fix premature Claude automation completion and inherited CI failures (#…