Skip to content

Name the agent tab for the backend it is actually running (#255) - #260

Merged
scgopi merged 1 commit into
mainfrom
fix/255-agent-tab-backend-name
Sep 3, 2026
Merged

Name the agent tab for the backend it is actually running (#255)#260
scgopi merged 1 commit into
mainfrom
fix/255-agent-tab-backend-name

Conversation

@scgopi

@scgopi scgopi commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Fixes #255.

The bug

A Main loop's terminal tab was labelled Claude Code whatever backend the loop had actually been created with — Copilot CLI, Codex, or OpenCode.

Cause

LoopWorkspaceView.agentTabTitle returned the string as a literal:

case .sketch, .turnBased, .composite: return "Claude Code"

.timeBased ("Loop") and .goalBased ("Goal") were unaffected only because they name what the session is doing rather than what is doing it — so the wrong name showed up on exactly the three attended types, Main among them.

The pane header two rows below it was already correct (store.node.backend.displayName.lowercased()), which is why the strip and the pane disagreed in the reporter's screenshot.

The fix

Return backend.displayName. The rule moved from a private method on the view to a static one taking (loopType, backend, launchesAgent), so which name a tab gets is assertable without a window — the previous shape could only have been caught by looking at it.

Verification

Check Result
xcodebuild test ✅ 1523 tests in 158 suites, up 3
swiftlint lint ✅ 0 errors
swift format lint --strict ✅ clean

New AgentTabTitleTests covers all four backends on the attended types, both unattended types across every backend, and a plain shell pane.

🤖 Generated with Claude Code

https://claude.ai/code/session_011hEyiK8W9XW4Tq6je98kTX

A Main loop's tab strip said "Claude Code" whatever backend the loop had
chosen, because `agentTabTitle` returned that string as a literal for the
three attended loop types. Only `.timeBased` and `.goalBased` escaped it,
and only because they name what the session is doing rather than what is
doing it.

The rule now returns `backend.displayName`, and moved from a private method
on the view to a static one, so which name a tab gets is assertable without
a window.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011hEyiK8W9XW4Tq6je98kTX
@scgopi
scgopi merged commit 8a0a23b into main Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New main loop results in tab title saying "Claude Code" even though Copilot CLI is selected

1 participant