Refactor startup paths to use RuntimeConfig (gt-j0546)
Replaced all hardcoded 'claude --dangerously-skip-permissions' invocations with configurable helpers from internal/config: - GetRuntimeCommand(rigPath) - simple command string - GetRuntimeCommandWithPrompt(rigPath, prompt) - with initial prompt - BuildAgentStartupCommand(role, bdActor, rigPath, prompt) - generic agent - BuildPolecatStartupCommand(rigName, polecatName, rigPath, prompt) - polecat - BuildCrewStartupCommand(rigName, crewName, rigPath, prompt) - crew - BuildStartupCommand(envVars, rigPath, prompt) - custom env vars Files updated: - internal/cmd/start.go (4 locations) - internal/cmd/crew_lifecycle.go (2 locations) - internal/cmd/crew_at.go (2 locations) - internal/cmd/deacon.go - internal/cmd/witness.go - internal/cmd/up.go (2 locations) - internal/cmd/handoff.go (2 locations) - internal/daemon/daemon.go (3 locations) - internal/daemon/lifecycle.go - internal/session/manager.go - internal/refinery/manager.go - internal/boot/boot.go This enables future support for alternative LLM runtimes (aider, etc.) via rig/town settings configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
0c75088727
commit
626a24e013
@@ -416,21 +416,19 @@ func (d *Daemon) getNeedsPreSync(config *beads.RoleConfig, parsed *ParsedIdentit
|
||||
|
||||
// getStartCommand determines the startup command for an agent.
|
||||
// Uses role bead config if available, falls back to hardcoded defaults.
|
||||
func (d *Daemon) getStartCommand(config *beads.RoleConfig, parsed *ParsedIdentity) string {
|
||||
func (d *Daemon) getStartCommand(roleConfig *beads.RoleConfig, parsed *ParsedIdentity) string {
|
||||
// If role bead has explicit config, use it
|
||||
if config != nil && config.StartCommand != "" {
|
||||
if roleConfig != nil && roleConfig.StartCommand != "" {
|
||||
// Expand any patterns in the command
|
||||
return beads.ExpandRolePattern(config.StartCommand, d.config.TownRoot, parsed.RigName, parsed.AgentName, parsed.RoleType)
|
||||
return beads.ExpandRolePattern(roleConfig.StartCommand, d.config.TownRoot, parsed.RigName, parsed.AgentName, parsed.RoleType)
|
||||
}
|
||||
|
||||
// Default command for all agents
|
||||
defaultCmd := "exec claude --dangerously-skip-permissions"
|
||||
// Default command for all agents - use runtime config
|
||||
defaultCmd := "exec " + config.GetRuntimeCommand("")
|
||||
|
||||
// Polecats need environment variables set in the command
|
||||
if parsed.RoleType == "polecat" {
|
||||
bdActor := fmt.Sprintf("%s/polecats/%s", parsed.RigName, parsed.AgentName)
|
||||
return fmt.Sprintf("export GT_ROLE=polecat GT_RIG=%s GT_POLECAT=%s BD_ACTOR=%s GIT_AUTHOR_NAME=%s && %s",
|
||||
parsed.RigName, parsed.AgentName, bdActor, bdActor, defaultCmd)
|
||||
return config.BuildPolecatStartupCommand(parsed.RigName, parsed.AgentName, "", "")
|
||||
}
|
||||
|
||||
return defaultCmd
|
||||
|
||||
Reference in New Issue
Block a user