Skip to content

[Bug]: Automation terminal is retired ~60s after the agent idles, killing its pending background sub-agents #23942

Closed

Description

@jimmyclaw-ai

Operating system

Linux (Ubuntu, kernel 5.15)

Orca version

1.4.216

Details

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

  1. AmethystLiang commented on Sep 30, 2026

    @AmethystLiang
    Contributor

    Thanks for reporting. Looking into it

  2. added a commit that references this issue on Oct 6, 2026
    634c437
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions