Revert to simple gt-mayor/gt-deacon session names

Reverts the session naming changes from PR #70. Multi-town support
on a single machine is not a real use case - rigs provide project
isolation, and true isolation should use containers/VMs.

Changes:
- MayorSessionName() and DeaconSessionName() no longer take townName parameter
- ParseSessionName() handles simple gt-mayor and gt-deacon formats
- Removed Town field from AgentIdentity and AgentSession structs
- Updated all callers and tests

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
joe
2026-01-03 14:33:24 -08:00
committed by Steve Yegge
parent d3e47221ac
commit 4bcf50bf1c
23 changed files with 117 additions and 267 deletions

View File

@@ -22,7 +22,6 @@ import (
"github.com/steveyegge/gastown/internal/polecat"
"github.com/steveyegge/gastown/internal/session"
"github.com/steveyegge/gastown/internal/tmux"
"github.com/steveyegge/gastown/internal/workspace"
)
// Daemon is the town-level background service.
@@ -198,13 +197,7 @@ const DeaconRole = "deacon"
// getDeaconSessionName returns the Deacon session name for the daemon's town.
func (d *Daemon) getDeaconSessionName() string {
townName, err := workspace.GetTownName(d.config.TownRoot)
if err != nil {
// Fallback to legacy name if town config can't be loaded
d.logger.Printf("Warning: failed to get town name: %v, using fallback", err)
return "gt-deacon"
}
return session.DeaconSessionName(townName)
return session.DeaconSessionName()
}
// ensureBootRunning spawns Boot to triage the Deacon.

View File

@@ -14,7 +14,6 @@ import (
"github.com/steveyegge/gastown/internal/constants"
"github.com/steveyegge/gastown/internal/session"
"github.com/steveyegge/gastown/internal/tmux"
"github.com/steveyegge/gastown/internal/workspace"
)
// BeadsMessage represents a message from gt mail inbox --json.
@@ -313,15 +312,9 @@ func (d *Daemon) identityToSession(identity string) string {
// Fallback: use default patterns based on role type
switch parsed.RoleType {
case "mayor":
if townName, err := workspace.GetTownName(d.config.TownRoot); err == nil {
return session.MayorSessionName(townName)
}
return ""
return session.MayorSessionName()
case "deacon":
if townName, err := workspace.GetTownName(d.config.TownRoot); err == nil {
return session.DeaconSessionName(townName)
}
return ""
return session.DeaconSessionName()
case "witness", "refinery":
return fmt.Sprintf("gt-%s-%s", parsed.RigName, parsed.RoleType)
case "crew":

View File

@@ -184,9 +184,10 @@ func TestIdentityToSession_Mayor(t *testing.T) {
d, cleanup := testDaemonWithTown(t, "ai")
defer cleanup()
// Mayor session name is now fixed (one per machine, no town qualifier)
result := d.identityToSession("mayor")
if result != "gt-ai-mayor" {
t.Errorf("identityToSession('mayor') = %q, expected 'gt-ai-mayor'", result)
if result != "gt-mayor" {
t.Errorf("identityToSession('mayor') = %q, expected 'gt-mayor'", result)
}
}