Skip to content

fix(workspace): use persisted agent type when reconnecting tmux sessions#150

Merged
marcus merged 1 commit intomarcus:mainfrom
jacola:fix/reconnect-agent-type
Feb 19, 2026
Merged

fix(workspace): use persisted agent type when reconnecting tmux sessions#150
marcus merged 1 commit intomarcus:mainfrom
jacola:fix/reconnect-agent-type

Conversation

@jacola
Copy link
Contributor

@jacola jacola commented Feb 12, 2026

Problem

reconnectAgents() hardcodes AgentClaude for every reconnected tmux session, ignoring the .sidecar-agent file persisted in each worktree. This causes non-Claude agents (Copilot, Codex, Gemini, etc.) to display as "claude" in the workspace sidebar after restarting sidecar.

Fix

Read wt.ChosenAgentType (already loaded from .sidecar-agent at startup) when creating the agent record during reconnection. Falls back to AgentClaude only when no agent type was persisted.

Testing

  1. Launch a worktree with a non-Claude agent (e.g. Copilot)
  2. Exit and restart sidecar
  3. Verify the workspace sidebar shows the correct agent name instead of "claude"

reconnectAgents() hardcoded AgentClaude for every reconnected session,
ignoring the .sidecar-agent file. This caused non-Claude agents (e.g.
Copilot, Codex, Gemini) to display as 'claude' after restarting sidecar.

Now reads wt.ChosenAgentType (loaded from .sidecar-agent) and only
falls back to AgentClaude when no agent type was persisted.
@Amolith
Copy link
Contributor

Amolith commented Feb 18, 2026

Thank you, I was just about to fix this and open a PR myself!

@marcus marcus merged commit 609705e into marcus:main Feb 19, 2026
@marcus
Copy link
Owner

marcus commented Feb 19, 2026

Merged — thanks for tracking this down, @jacola! And thanks @Amolith for confirming the issue. 🎉

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.

3 participants