Unify agent startup with GUPP propulsion nudge
Witness and Refinery startup was duplicated across cmd/witness.go, cmd/up.go, cmd/rig.go, and daemon.go. Worse, not all code paths sent the propulsion nudge (GUPP - Gas Town Universal Propulsion Principle). Now unified in Manager.Start() which handles everything including nudges. Changes: - witness/manager.go: Full rewrite with session creation, env vars, theming, WaitForClaudeReady, startup nudge, and propulsion nudge (GUPP) - refinery/manager.go: Add propulsion nudge sequence after Claude startup - cmd/witness.go: Simplify to just call mgr.Start(), remove ensureWitnessSession - cmd/rig.go: Use witness.Manager.Start() instead of inline session creation - cmd/start.go: Use witness.Manager.Start() - cmd/up.go: Use witness.Manager.Start(), remove ensureWitness(), add EnsureSettingsForRole in ensureSession() - daemon.go: Use witness.Manager.Start() and refinery.Manager.Start() for unified startup with proper nudges This ensures all agent startup paths (gt witness start, gt rig boot, gt up, daemon restarts) consistently apply GUPP propulsion nudges. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/steveyegge/gastown/internal/session"
|
||||
"github.com/steveyegge/gastown/internal/style"
|
||||
"github.com/steveyegge/gastown/internal/tmux"
|
||||
"github.com/steveyegge/gastown/internal/witness"
|
||||
"github.com/steveyegge/gastown/internal/workspace"
|
||||
)
|
||||
|
||||
@@ -225,10 +226,14 @@ func startRigAgents(t *tmux.Tmux, townRoot string) {
|
||||
if witnessRunning {
|
||||
fmt.Printf(" %s %s witness already running\n", style.Dim.Render("○"), r.Name)
|
||||
} else {
|
||||
created, err := ensureWitnessSession(r.Name, r)
|
||||
if err != nil {
|
||||
fmt.Printf(" %s %s witness failed: %v\n", style.Dim.Render("○"), r.Name, err)
|
||||
} else if created {
|
||||
witMgr := witness.NewManager(r)
|
||||
if err := witMgr.Start(false); err != nil {
|
||||
if err == witness.ErrAlreadyRunning {
|
||||
fmt.Printf(" %s %s witness already running\n", style.Dim.Render("○"), r.Name)
|
||||
} else {
|
||||
fmt.Printf(" %s %s witness failed: %v\n", style.Dim.Render("○"), r.Name, err)
|
||||
}
|
||||
} else {
|
||||
fmt.Printf(" %s %s witness started\n", style.Bold.Render("✓"), r.Name)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user