Skip to content

Add-agent "+" button disappears from the agent tab bar after closing the original agent tab #861

Description

@adamshawvipps

Summary

In the top agent tab bar (the row that shows the Claude / Codex agent tab and its close ×), the "+" (add agent) button disappears once you close the original agent tab that first spawned on the repo, as long as at least one other agent tab remains. After that you can no longer add more agents from the tab bar.

Issue Type

Bug

Priority

Medium — the feature is still reachable by other means, but the primary affordance for adding an agent silently vanishes and leaves the repo in a stuck state.

Agent Context

  • App: Manifold (Claude Code v2.1.185, Opus 4.8, Claude Enterprise)
  • Reported from repo MANIFOLD, worktree fix-issue-context-capture (Stjørdal)

Area

area:renderer — dock tab header (agent tab bar) / agent sibling panels. Not the Repositories sidebar.

Expected Behavior

The "+" add-agent button should remain available on the active agent tab regardless of which agent tab was closed, as long as at least one agent session for that repo/worktree is running or waiting.

Actual Behavior

With two agent tabs open on the same repository, closing the first/original tab (the one created with panel id agent) removes the "+" button from the tab bar. The remaining tab is a sibling panel (id agent:<sessionId>), and it never renders the add-agent button, so no further agents can be added from the tab bar.

Steps to Reproduce

  1. Open a repository and start an agent (creates the primary agent tab, e.g. Claude).
  2. Click "+" in the tab bar to add a second agent to the same repository (creates a sibling tab).
  3. Close the original (first) agent tab.
  4. Observe: the "+" button is gone from the tab bar; you can no longer add agents.

Evidence

Screenshot provided in chat (not uploaded to GitHub): the top tab bar shows a single remaining agent tab (Claude ×) with no "+" affordance.

Suspected Cause

The add-sibling button visibility is gated on the panel id being exactly 'agent', rather than on the panel being any agent panel (primary or sibling).

src/renderer/DockTab.tsx:29:

const showAddSibling = api.id === 'agent'
  && state != null
  && (state.activeSessionStatus === 'running' || state.activeSessionStatus === 'waiting')
  • The initial agent panel is always created with id 'agent' (src/renderer/hooks/dock-layout/dock-layout-builders.ts).
  • Additional agents are created as sibling panels with ids agent:<sessionId> (src/renderer/hooks/agent-siblings.ts, useAgentSiblingDockTabs.ts).

When the primary 'agent' panel is closed, only agent:<sessionId> sibling(s) remain. Since api.id === 'agent' is now false for every remaining panel, showAddSibling is always false and AddSiblingAgentButton is never rendered in the tab bar.

Suggested Next Step

Broaden the showAddSibling check in DockTab.tsx to include sibling agent panels. The existing helper isSiblingPanelId in src/renderer/hooks/agent-siblings.ts already covers the agent: prefix:

import { isSiblingPanelId, parseSiblingSessionId } from './hooks/agent-siblings'

const isAgentPanel = api.id === 'agent' || isSiblingPanelId(api.id)
const showAddSibling = isAgentPanel
  && state != null
  && (state.activeSessionStatus === 'running' || state.activeSessionStatus === 'waiting')

Validation After Fix

  1. Start two agents on the same repository.
  2. Close the original (agent) tab.
  3. Confirm the "+" button still appears in the tab bar on the remaining sibling tab and successfully launches a third agent.
  4. Also confirm closing a sibling tab (leaving only the primary) still shows "+".

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-reportedfor issues created by agentarea:rendererSubsystem: rendererbugSomething isn't workingclaudeClaude createdllm-github-issueQueue for the autonomous issue pipeline: an agent reproduces, fixes, and delivers one PRseverity:mediumMedium severity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions