feat: add restart subcommands to witness and refinery (gt-9kc2)

- Add `gt witness restart <rig>` command (stop + start)
- Add `gt refinery restart [rig]` command (stop + start)
- Add self-cycling documentation to refinery template
- Clarify that restarts are daemon-managed, not shell loops

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-23 03:56:31 -08:00
parent d51fe0268d
commit 46a5e38fa2
4 changed files with 129 additions and 7 deletions

View File

@@ -225,6 +225,8 @@ func (m *Manager) Start(foreground bool) error {
}
// Start Claude agent with full permissions (like polecats)
// NOTE: No gt prime injection needed - SessionStart hook handles it automatically
// Restarts are handled by daemon via LIFECYCLE mail, not shell loops
command := "claude --dangerously-skip-permissions"
if err := t.SendKeys(sessionID, command); err != nil {
// Clean up the session on failure
@@ -232,13 +234,6 @@ func (m *Manager) Start(foreground bool) error {
return fmt.Errorf("starting Claude agent: %w", err)
}
// Wait for Claude to start (pane command changes from shell to node)
// NOTE: No gt prime injection needed - SessionStart hook handles it automatically
shells := []string{"bash", "zsh", "sh", "fish", "tcsh", "ksh"}
if err := t.WaitForCommand(sessionID, shells, 15*time.Second); err != nil {
fmt.Fprintf(m.output, "Warning: Timeout waiting for Claude to start: %v\n", err)
}
return nil
}