Skip to content

[Feature]: Automatically close successful workspace setup tabs #25071

Open

Description

@mmarabel

Problem or use case

Creating a fresh worktree with Pi leaves two tabs: the Pi conversation and a terminal showing the completed repository setup (pnpm install) at a shell prompt. I expected to continue with just the agent tab after setup succeeded, rather than close the setup terminal manually each time.

This happened during new worktree creation, not a session resume. The extra tab displayed a shell title instead of “Setup,” which initially made it look like an unexplained duplicate launch. The title is a separate concern; this request is about the successful setup terminal remaining open.

Observed sequence

  1. Create a new worktree with Pi and repository setup enabled.
  2. Setup runs in a separate terminal and completes successfully.
  3. Pi remains available, but the completed setup terminal stays open at a shell prompt.

Read-only inspection of the affected Linux runtime (Orca 1.4.219, accessed from a macOS client) found two distinct terminals, not two Pi sessions. The daemon log records fresh terminal creation on 2026-10-03:

20:10:22.265Z  session-created  <workspace>@@8cce6516  [Pi terminal]
20:10:22.298Z  session-created  <workspace>@@75a7083a  [setup terminal]

The labels in brackets come from matching the session IDs to the live terminal inventory, not from the log itself. The terminals were created 33 ms apart. The second terminal's retained output ends with:

Done in 4.5s using pnpm v12.0.0
<shell prompt>

Proposed solution

Offer an option to close the setup tab automatically when setup succeeds, while keeping it open on failure so errors can be inspected.

Existing PR #22611 would address this request. Its proposed “Close Setup Tab When It Succeeds” setting is the behavior I want. This issue records a real user case for that PR, not a request for a competing implementation.

Alternatives or additional context

  • Current workaround: close the completed setup tab manually.
  • Separate setup tabs are intentional today; this is a workflow improvement, not a claim that Pi launched twice.
  • This is distinct from fix(terminal): prevent duplicate resumes of completed live agents #19736, which addressed duplicate recovery of an already-live agent session.
  • Source checked at upstream/main 752871bd678935e07a36e84b64a7a1ce944377e4: src/renderer/src/lib/worktree-setup-issue-command-queue.ts explicitly creates a separate setup tab in new-tab mode.
  • The evidence above describes the released runtime. I have not tested feat(setup): optionally close the setup tab when setup succeeds #22611's branch or verified its auto-close behavior on a paired runtime.

Activity

  1. xflykkk commented on Nov 4, 2026

    @xflykkk

    Same on macOS, Orca 1.4.248, with Claude Code as the agent. Repo setup is npm install (setupRunPolicy: run-by-default, setupAgentStartupPolicy: start-immediately). Each new worktree leaves a second tab showing the raw wrapper command (bash -lc '... setup-runner.sh; ... __ORCA_SETUP_COMPLETE__:<id>:0') at a shell prompt, which looked like a duplicate Claude launch until I traced it to the setup hook. +1 for #22611's close-on-success option.

  2. unitea1992 commented on Nov 13, 2026

    @unitea1992

    Another data point for this request, from a headless setup, plus a consequence beyond tab clutter.

    Setup: Orca 1.4.257 on Linux, running as orca serve. A repo setup script is configured (setupRunPolicy: run-by-default, setupAgentStartupPolicy: wait-for-setup). When a worktree is created, Orca opens an interactive shell terminal titled "Setup" and runs bash <git-common-dir>/orca/setup-runner.sh in it. When the script finishes, the shell stays open indefinitely.

    Why this matters beyond the extra tab: the leftover shell is a live terminal. After a worktree's PR is merged and its agent is gone, orca worktree ps still reports it as status "active" with liveTerminalCount 1-2, only because of the leftover Setup shell (plus the initial startup shell). Finished worktrees therefore look in use and are not cleaned up. In our case the leftover agents and MCP servers in those worktrees accumulated memory and contributed to a host OOM that killed the Orca server.

    So the opt-in "close the Setup tab when setup succeeds" behavior proposed in #22611 would also fix this. Two requirements from our side:

    1. Keep the tab open when setup fails, so the error stays visible (as feat(setup): optionally close the setup tab when setup succeeds #22611 already does).
    2. With wait-for-setup, the completion marker the waiting agent depends on must still be written before the shell exits. feat(setup): optionally close the setup tab when setup succeeds #22611's description says this is the case. Closing the shell from inside the setup script by hand (killing the parent shell) can race that marker, so a built-in option is much safer than a script-side workaround; exit inside the script only ends the child bash, so it does not help.

    Happy to test a build of #22611 on a Linux orca serve host if that is useful.

  3. Lamer217 commented on Nov 13, 2026

    @Lamer217

    I need this too! I'm tired of closing idle terminal tabs that have long done their job.

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