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:
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/steveyegge/gastown/internal/constants"
|
||||
"github.com/steveyegge/gastown/internal/events"
|
||||
"github.com/steveyegge/gastown/internal/lock"
|
||||
"github.com/steveyegge/gastown/internal/session"
|
||||
"github.com/steveyegge/gastown/internal/style"
|
||||
"github.com/steveyegge/gastown/internal/templates"
|
||||
"github.com/steveyegge/gastown/internal/workspace"
|
||||
@@ -304,12 +305,18 @@ func outputPrimeContext(ctx RoleContext) error {
|
||||
}
|
||||
|
||||
// Build template data
|
||||
// Get town name for session names
|
||||
townName, _ := workspace.GetTownName(ctx.TownRoot)
|
||||
|
||||
data := templates.RoleData{
|
||||
Role: roleName,
|
||||
RigName: ctx.Rig,
|
||||
TownRoot: ctx.TownRoot,
|
||||
WorkDir: ctx.WorkDir,
|
||||
Polecat: ctx.Polecat,
|
||||
Role: roleName,
|
||||
RigName: ctx.Rig,
|
||||
TownRoot: ctx.TownRoot,
|
||||
TownName: townName,
|
||||
WorkDir: ctx.WorkDir,
|
||||
Polecat: ctx.Polecat,
|
||||
MayorSession: session.MayorSessionName(townName),
|
||||
DeaconSession: session.DeaconSessionName(townName),
|
||||
}
|
||||
|
||||
// Render and output
|
||||
|
||||
Reference in New Issue
Block a user