All agents now receive their startup beacon + role-specific instructions via the CLI prompt, making sessions identifiable in /resume picker while removing unreliable post-startup nudges. Changes: - Rename FormatStartupNudge → FormatStartupBeacon, StartupNudgeConfig → BeaconConfig - Remove StartupNudge() function (no longer needed) - Remove PropulsionNudge() and PropulsionNudgeForRole() functions - Update deacon, witness, refinery, polecat managers to include beacon in CLI prompt - Update boot to inline beacon (can't import session due to import cycle) - Update daemon/lifecycle.go to include beacon via BuildCommandWithPrompt - Update cmd/deacon.go to include beacon in startup command - Remove redundant StartupNudge and PropulsionNudge calls from all startup paths The beacon is now part of the CLI prompt which is queued before Claude starts, making it more reliable than post-startup nudges which had timing issues. SessionStart hook runs gt prime automatically, so PropulsionNudge was redundant. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.8 KiB
Go
55 lines
1.8 KiB
Go
// Package session provides polecat session lifecycle management.
|
|
package session
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// Prefix is the common prefix for rig-level Gas Town tmux sessions.
|
|
const Prefix = "gt-"
|
|
|
|
// HQPrefix is the prefix for town-level services (Mayor, Deacon).
|
|
const HQPrefix = "hq-"
|
|
|
|
// MayorSessionName returns the session name for the Mayor agent.
|
|
// One mayor per machine - multi-town requires containers/VMs for isolation.
|
|
func MayorSessionName() string {
|
|
return HQPrefix + "mayor"
|
|
}
|
|
|
|
// DeaconSessionName returns the session name for the Deacon agent.
|
|
// One deacon per machine - multi-town requires containers/VMs for isolation.
|
|
func DeaconSessionName() string {
|
|
return HQPrefix + "deacon"
|
|
}
|
|
|
|
// WitnessSessionName returns the session name for a rig's Witness agent.
|
|
func WitnessSessionName(rig string) string {
|
|
return fmt.Sprintf("%s%s-witness", Prefix, rig)
|
|
}
|
|
|
|
// RefinerySessionName returns the session name for a rig's Refinery agent.
|
|
func RefinerySessionName(rig string) string {
|
|
return fmt.Sprintf("%s%s-refinery", Prefix, rig)
|
|
}
|
|
|
|
// CrewSessionName returns the session name for a crew worker in a rig.
|
|
func CrewSessionName(rig, name string) string {
|
|
return fmt.Sprintf("%s%s-crew-%s", Prefix, rig, name)
|
|
}
|
|
|
|
// PolecatSessionName returns the session name for a polecat in a rig.
|
|
func PolecatSessionName(rig, name string) string {
|
|
return fmt.Sprintf("%s%s-%s", Prefix, rig, name)
|
|
}
|
|
|
|
// BootSessionName returns the session name for the Boot watchdog.
|
|
// Note: We use "gt-boot" instead of "hq-deacon-boot" to avoid tmux prefix
|
|
// matching collisions. Tmux matches session names by prefix, so "hq-deacon-boot"
|
|
// would match when checking for "hq-deacon", causing HasSession("hq-deacon")
|
|
// to return true when only Boot is running.
|
|
func BootSessionName() string {
|
|
return Prefix + "boot"
|
|
}
|
|
|