feat: add initial prompt for autonomous patrol startup (deacon & witness) (#769)

Add initial prompt to deacon and witness startup commands to trigger
autonomous patrol. Without this, agents sit idle at the prompt after
SessionStart hooks run.

Implements GUPP (Gas Town Universal Propulsion Principle): agents start
patrol immediately when Claude launches.
This commit is contained in:
dustin
2026-01-21 05:10:30 +07:00
committed by GitHub
parent 6a22b47ef6
commit fd61259336
2 changed files with 9 additions and 4 deletions

View File

@@ -79,9 +79,11 @@ func (m *Manager) Start(agentOverride string) error {
return fmt.Errorf("ensuring Claude settings: %w", err)
}
// Build startup command first
// Restarts are handled by daemon via ensureDeaconRunning on each heartbeat
startupCmd, err := config.BuildAgentStartupCommandWithAgentOverride("deacon", "", m.townRoot, "", "", agentOverride)
// Build startup command with initial prompt for autonomous patrol.
// The prompt triggers GUPP: deacon starts patrol immediately without waiting for input.
// This prevents the agent from sitting idle at the prompt after SessionStart hooks run.
initialPrompt := "I am Deacon. Start patrol: check gt hook, if empty create mol-deacon-patrol wisp and execute it."
startupCmd, err := config.BuildAgentStartupCommandWithAgentOverride("deacon", "", m.townRoot, "", initialPrompt, agentOverride)
if err != nil {
return fmt.Errorf("building startup command: %w", err)
}

View File

@@ -277,7 +277,10 @@ func buildWitnessStartCommand(rigPath, rigName, townRoot, agentOverride string,
if roleConfig != nil && roleConfig.StartCommand != "" {
return beads.ExpandRolePattern(roleConfig.StartCommand, townRoot, rigName, "", "witness"), nil
}
command, err := config.BuildAgentStartupCommandWithAgentOverride("witness", rigName, townRoot, rigPath, "", agentOverride)
// Add initial prompt for autonomous patrol startup.
// The prompt triggers GUPP: witness starts patrol immediately without waiting for input.
initialPrompt := "I am Witness for " + rigName + ". Start patrol: check gt hook, if empty create mol-witness-patrol wisp and execute it."
command, err := config.BuildAgentStartupCommandWithAgentOverride("witness", rigName, townRoot, rigPath, initialPrompt, agentOverride)
if err != nil {
return "", fmt.Errorf("building startup command: %w", err)
}