feat: runtime-aware tmux agent checks
This commit is contained in:
@@ -1204,6 +1204,18 @@ func BuildCrewStartupCommandWithAgentOverride(rigName, crewName, rigPath, prompt
|
||||
return BuildStartupCommandWithAgentOverride(envVars, rigPath, prompt, agentOverride)
|
||||
}
|
||||
|
||||
// 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.
|
||||
func ExpectedPaneCommands(rc *RuntimeConfig) []string {
|
||||
if rc == nil || rc.Command == "" {
|
||||
return nil
|
||||
}
|
||||
if filepath.Base(rc.Command) == "claude" {
|
||||
return []string{"node"}
|
||||
}
|
||||
return []string{filepath.Base(rc.Command)}
|
||||
}
|
||||
|
||||
// GetRigPrefix returns the beads prefix for a rig from rigs.json.
|
||||
// Falls back to "gt" if the rig isn't found or has no prefix configured.
|
||||
// townRoot is the path to the town directory (e.g., ~/gt).
|
||||
|
||||
@@ -1165,6 +1165,22 @@ func TestGetRuntimeCommand_UsesRigAgentWhenRigPathProvided(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestExpectedPaneCommands(t *testing.T) {
|
||||
t.Run("claude maps to node", 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"})
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("codex maps to executable", func(t *testing.T) {
|
||||
got := ExpectedPaneCommands(&RuntimeConfig{Command: "codex"})
|
||||
if len(got) != 1 || got[0] != "codex" {
|
||||
t.Fatalf("ExpectedPaneCommands(codex) = %v, want %v", got, []string{"codex"})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestLoadRuntimeConfigFromSettings(t *testing.T) {
|
||||
// Create temp rig with custom runtime config
|
||||
dir := t.TempDir()
|
||||
|
||||
Reference in New Issue
Block a user