fix: Make Mayor/Deacon session names include town name
Session names `gt-mayor` and `gt-deacon` were hardcoded, causing tmux
session name collisions when running multiple towns simultaneously.
Changed to `gt-{town}-mayor` and `gt-{town}-deacon` format (e.g.,
`gt-ai-mayor`) to allow concurrent multi-town operation.
Key changes:
- session.MayorSessionName() and DeaconSessionName() now take townName param
- Added workspace.GetTownName() helper to load town name from config
- Updated all callers in cmd/, daemon/, doctor/, mail/, rig/, templates/
- Updated tests with new session name format
- Bead IDs remain unchanged (already scoped by .beads/ directory)
Fixes #60
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,15 +49,17 @@ func TestDeriveSessionName(t *testing.T) {
|
||||
name: "mayor session",
|
||||
envVars: map[string]string{
|
||||
"GT_ROLE": "mayor",
|
||||
"GT_TOWN": "ai",
|
||||
},
|
||||
expected: "gt-mayor",
|
||||
expected: "gt-ai-mayor",
|
||||
},
|
||||
{
|
||||
name: "deacon session",
|
||||
envVars: map[string]string{
|
||||
"GT_ROLE": "deacon",
|
||||
"GT_TOWN": "ai",
|
||||
},
|
||||
expected: "gt-deacon",
|
||||
expected: "gt-ai-deacon",
|
||||
},
|
||||
{
|
||||
name: "no env vars",
|
||||
@@ -70,7 +72,7 @@ func TestDeriveSessionName(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// Save and clear relevant env vars
|
||||
saved := make(map[string]string)
|
||||
envKeys := []string{"GT_ROLE", "GT_RIG", "GT_POLECAT", "GT_CREW"}
|
||||
envKeys := []string{"GT_ROLE", "GT_RIG", "GT_POLECAT", "GT_CREW", "GT_TOWN"}
|
||||
for _, key := range envKeys {
|
||||
saved[key] = os.Getenv(key)
|
||||
os.Unsetenv(key)
|
||||
|
||||
Reference in New Issue
Block a user