fix: prefer witness agent override
This commit is contained in:
@@ -36,3 +36,20 @@ func TestBuildWitnessStartCommand_DefaultsToRuntime(t *testing.T) {
|
||||
t.Errorf("expected BD_ACTOR=gastown/witness in command, got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildWitnessStartCommand_AgentOverrideWins(t *testing.T) {
|
||||
roleConfig := &beads.RoleConfig{
|
||||
StartCommand: "exec run --role {role}",
|
||||
}
|
||||
|
||||
got, err := buildWitnessStartCommand("/town/rig", "gastown", "/town", "codex", roleConfig)
|
||||
if err != nil {
|
||||
t.Fatalf("buildWitnessStartCommand: %v", err)
|
||||
}
|
||||
if strings.Contains(got, "exec run") {
|
||||
t.Fatalf("expected agent override to bypass role start_command, got %q", got)
|
||||
}
|
||||
if !strings.Contains(got, "GT_ROLE=witness") {
|
||||
t.Errorf("expected GT_ROLE=witness in command, got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user