Add session beacon for predecessor discovery via /resume
Inject an identity beacon as the first message when Gas Town starts Claude sessions. This beacon becomes the session title in Claude Code '/resume picker, enabling workers to find their predecessor sessions for debugging. Beacon format: [GAS TOWN] <address> • <mol-id or "ready"> • <timestamp> Examples: - [GAS TOWN] gastown/crew/max • gt-abc12 • 2025-12-30T14:32 - [GAS TOWN] gastown/polecats/Toast • ready • 2025-12-30T09:15 - [GAS TOWN] deacon • patrol • 2025-12-30T08:00 Workers can now press / in /resume picker and search for their address (e.g., "gastown/crew/max") to see all predecessor sessions. Note: Respawn-loop agents (deacon/refinery via up.go) skip beacon injection since Claude restarts multiple times - would need post-restart injection. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/steveyegge/gastown/internal/git"
|
||||
"github.com/steveyegge/gastown/internal/polecat"
|
||||
"github.com/steveyegge/gastown/internal/rig"
|
||||
"github.com/steveyegge/gastown/internal/session"
|
||||
"github.com/steveyegge/gastown/internal/style"
|
||||
"github.com/steveyegge/gastown/internal/tmux"
|
||||
"github.com/steveyegge/gastown/internal/workspace"
|
||||
@@ -797,6 +798,13 @@ func runStartCrew(cmd *cobra.Command, args []string) error {
|
||||
// Give Claude time to initialize after process starts
|
||||
time.Sleep(constants.ShutdownNotifyDelay)
|
||||
|
||||
// Inject session beacon for predecessor discovery via /resume
|
||||
address := fmt.Sprintf("%s/crew/%s", rigName, name)
|
||||
beacon := session.SessionBeacon(address, "")
|
||||
if err := t.NudgeSession(sessionID, beacon); err != nil {
|
||||
// Non-fatal: session works without beacon
|
||||
}
|
||||
|
||||
// Send gt prime to initialize context
|
||||
if err := t.SendKeys(sessionID, "gt prime"); err != nil {
|
||||
style.PrintWarning("Could not send prime command: %v", err)
|
||||
@@ -931,6 +939,11 @@ func startCrewMember(rigName, crewName, townRoot string) error {
|
||||
// Give Claude time to initialize
|
||||
time.Sleep(constants.ShutdownNotifyDelay)
|
||||
|
||||
// Inject session beacon for predecessor discovery via /resume
|
||||
address := fmt.Sprintf("%s/crew/%s", rigName, crewName)
|
||||
beacon := session.SessionBeacon(address, "")
|
||||
_ = t.NudgeSession(sessionID, beacon) // Non-fatal
|
||||
|
||||
// Send gt prime to initialize context (non-fatal: session works without priming)
|
||||
_ = t.SendKeys(sessionID, "gt prime")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user