fix: ExpectedPaneCommands returns both node and claude for Claude Code (#740)
Newer versions of Claude Code report the tmux pane command as "claude" instead of "node". This caused gt mayor attach (and similar commands) to incorrectly detect that the runtime had exited and restart the session. The fix adds "claude" to the expected pane commands alongside "node", matching the behavior of IsClaudeRunning() which already handles both. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1465,13 +1465,14 @@ func BuildCrewStartupCommandWithAgentOverride(rigName, crewName, rigPath, prompt
|
||||
}
|
||||
|
||||
// ExpectedPaneCommands returns tmux pane command names that indicate the runtime is running.
|
||||
// For example, Claude runs as "node", while most other runtimes report their executable name.
|
||||
// Claude can report as "node" (older versions) or "claude" (newer versions).
|
||||
// Other runtimes typically report their executable name.
|
||||
func ExpectedPaneCommands(rc *RuntimeConfig) []string {
|
||||
if rc == nil || rc.Command == "" {
|
||||
return nil
|
||||
}
|
||||
if filepath.Base(rc.Command) == "claude" {
|
||||
return []string{"node"}
|
||||
return []string{"node", "claude"}
|
||||
}
|
||||
return []string{filepath.Base(rc.Command)}
|
||||
}
|
||||
|
||||
@@ -1437,10 +1437,11 @@ func TestGetRuntimeCommand_UsesRigAgentWhenRigPathProvided(t *testing.T) {
|
||||
|
||||
func TestExpectedPaneCommands(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Run("claude maps to node", func(t *testing.T) {
|
||||
t.Run("claude maps to node and claude", func(t *testing.T) {
|
||||
got := ExpectedPaneCommands(&RuntimeConfig{Command: "claude"})
|
||||
if len(got) != 1 || got[0] != "node" {
|
||||
t.Fatalf("ExpectedPaneCommands(claude) = %v, want %v", got, []string{"node"})
|
||||
want := []string{"node", "claude"}
|
||||
if len(got) != 2 || got[0] != "node" || got[1] != "claude" {
|
||||
t.Fatalf("ExpectedPaneCommands(claude) = %v, want %v", got, want)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user