feat(daemon): add lifecycle support for refinery and crew

- Add refinery and crew patterns to identityToSession()
- Add refinery and crew handling to restartSession() with pre-sync
- Add refinery and crew to identityToStateFile()
- Fix gt refinery start to send gt prime after Claude starts
- New syncWorkspace() helper for agents with persistent clones
This commit is contained in:
Steve Yegge
2025-12-20 17:42:21 -08:00
parent 58cf789eee
commit a9d204aa22
3 changed files with 95 additions and 2 deletions

View File

@@ -209,7 +209,6 @@ func (m *Manager) Start(foreground bool) error {
}
// Start Claude agent with full permissions (like polecats)
// The agent will run gt prime to load refinery context and start processing
command := "claude --dangerously-skip-permissions"
if err := t.SendKeys(sessionID, command); err != nil {
// Clean up the session on failure
@@ -217,6 +216,12 @@ func (m *Manager) Start(foreground bool) error {
return fmt.Errorf("starting Claude agent: %w", err)
}
// Prime the agent after Claude starts to load refinery context
if err := t.SendKeysDelayed(sessionID, "gt prime", 2000); err != nil {
// Warning only - don't fail startup
fmt.Printf("Warning: could not send prime command: %v\n", err)
}
return nil
}