This commit is contained in:
Ben Kraus
2026-01-02 09:21:49 -07:00
committed by Cameron Palmer
parent f4cbcb4ce9
commit 38adfa4d8b
33 changed files with 1044 additions and 172 deletions

View File

@@ -185,7 +185,7 @@ func (d *Daemon) heartbeat(state *State) {
// 3. Trigger pending polecat spawns (bootstrap mode - ZFC violation acceptable)
// This ensures polecats get nudged even when Deacon isn't in a patrol cycle.
// Uses regex-based WaitForClaudeReady, which is acceptable for daemon bootstrap.
// Uses regex-based WaitForRuntimeReady, which is acceptable for daemon bootstrap.
d.triggerPendingSpawns()
// 4. Process lifecycle requests
@@ -528,7 +528,7 @@ func (d *Daemon) isRigOperational(rigName string) (bool, string) {
}
// triggerPendingSpawns polls pending polecat spawns and triggers those that are ready.
// This is bootstrap mode - uses regex-based WaitForClaudeReady which is acceptable
// This is bootstrap mode - uses regex-based WaitForRuntimeReady which is acceptable
// for daemon operations when no AI agent is guaranteed to be running.
// The timeout is short (2s) to avoid blocking the heartbeat.
func (d *Daemon) triggerPendingSpawns() {
@@ -547,7 +547,7 @@ func (d *Daemon) triggerPendingSpawns() {
d.logger.Printf("Found %d pending spawn(s), attempting to trigger...", len(pending))
// Trigger pending spawns (uses WaitForClaudeReady with short timeout)
// Trigger pending spawns (uses WaitForRuntimeReady with short timeout)
results, err := polecat.TriggerPendingSpawns(d.config.TownRoot, triggerTimeout)
if err != nil {
d.logger.Printf("Error triggering spawns: %v", err)

View File

@@ -466,6 +466,10 @@ func (d *Daemon) getStartCommand(roleConfig *beads.RoleConfig, parsed *ParsedIde
// Default command for all agents - use runtime config
defaultCmd := "exec " + config.GetRuntimeCommand(rigPath)
runtimeConfig := config.LoadRuntimeConfig(rigPath)
if runtimeConfig.Session != nil && runtimeConfig.Session.SessionIDEnv != "" {
defaultCmd = config.PrependEnv(defaultCmd, map[string]string{"GT_SESSION_ID_ENV": runtimeConfig.Session.SessionIDEnv})
}
// Polecats need environment variables set in the command
if parsed.RoleType == "polecat" {