Skip to content

[Feature]: no way to close a terminal from the CLI — worker-start reports residualResources the orchestrator cannot reclaim #15826

Closed as not planned

Description

@Tauri-EPO

Summary

The CLI can create terminals but cannot close them. orca terminal exposes only list, show, read and send. An agent-driven orchestrator therefore accumulates dead terminals it can see, can prove are dead, and cannot reclaim — closing them requires a human in the UI.

Why this is not cosmetic

worker-start itself reports the leak. When a dispatch fails at agent_readiness, the result carries:

"residualResources": [
  { "kind": "terminal", "role": "agent", "action": "created",
    "id": "term_fe97e956-...", "surface": "visible" }
]

Orca names the resource as residual, in a machine-readable field, and then offers no command to reclaim it. The orchestrator is told about a leak it is structurally unable to fix.

What I accumulated in one session

Over ~8 hours orchestrating a 5-PR merge queue I ended with 21 terminals, of which two were mine and provably dead:

  1. A Cursor agent that died with Error: Connection stalled. The connection stalled 10 times. — terminal list still reports status: running, connected: true, orphaned: false, because the pty is alive; only the agent inside it is gone.
  2. The residualResource above: a bare PowerShell left behind by a failed launch (invalid --model).

Neither is distinguishable from a healthy terminal by any field terminal list returns except by reading the preview text — and neither could be closed from the CLI.

Why orphaned does not help

orphaned: false is correct in both cases: the pty has a live process (pwsh). The thing that died is the agent, not the shell. So the existing signal does not partition "reclaimable" from "in use", and an orchestrator that used it to decide what to close would close the wrong things.

Request

orca terminal close --terminal <handle> (plus --json), with whatever safety the team considers right — e.g. refusing while a dispatch is dispatched against it unless --force, or a dedicated worker-release --reclaim-terminal.

The minimum that would unblock automation: a way to reclaim exactly the handles worker-start already reports in residualResources, since those are unambiguous by construction — Orca created them, Orca knows the launch failed, and nothing else can be using them.

Environment

Windows 11, Orca CLI as of 2026-08-21, agents cursor and claude. Two orchestrator sessions sharing one host.

Activity

  1. Tauri-EPO commented on Aug 22, 2026

    @Tauri-EPO
    ContributorAuthor

    Correction, and closing

    The central claim in this report is wrong. I am closing it rather than editing it into something else, and the narrow part that survives is filed as #15944.

    What I claimed:

    The CLI can create terminals but cannot close them. orca terminal exposes only list, show, read and send.

    What is actually there, and has been since well before v1.4.186:

    tag        verbs in src/cli/handlers/terminal.ts
    v1.4.186   list show read send wait stop rename create switch close split
    v1.4.187   list show read send wait stop rename create switch close split
    v1.4.188   list show read send wait stop rename create switch close split
    main       list show read send wait stop rename create switch close split
    

    orca terminal close --terminal <handle> --json is documented in the orca-cli skill guide, with terminal stop --worktree beside it. So an orchestrator holding a residual terminal handle can reclaim it, and this report's "structurally unable to fix" framing is false. I asserted the absence of a command without grepping for it, and the rest of the report was built on that.

    What was accurate, and where it already lives. The two terminals I described really were dead in a way terminal list does not express — a Cursor agent that had exited inside a live pwsh still reports status: running, connected: true, orphaned: false, because the shell is alive and only the agent is gone. That is #15313, which is open and is the right home for it.

    What survives as its own report. worker-start names the leak in residualResources, the spec promises "recovery commands when needed", and the emitted recovery command covers the mutation (--retry-request) but not the resource. The orchestration guide tells the orchestrator to inspect residualResources and never says what to do with it, while its only mention of terminal close is a prohibition scoped to a settled Dispatch. That is #15944.

    Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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