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:
@@ -13,7 +13,6 @@ import (
|
||||
"github.com/steveyegge/gastown/internal/config"
|
||||
"github.com/steveyegge/gastown/internal/session"
|
||||
"github.com/steveyegge/gastown/internal/tmux"
|
||||
"github.com/steveyegge/gastown/internal/workspace"
|
||||
)
|
||||
|
||||
// ErrUnknownList indicates a mailing list name was not found in configuration.
|
||||
@@ -936,13 +935,7 @@ func (r *Router) GetMailbox(address string) (*Mailbox, error) {
|
||||
// Uses send-keys to echo a visible banner to ensure notification is seen.
|
||||
// Supports mayor/, rig/polecat, and rig/refinery addresses.
|
||||
func (r *Router) notifyRecipient(msg *Message) error {
|
||||
// Get town name for session name generation
|
||||
var townName string
|
||||
if r.townRoot != "" {
|
||||
townName, _ = workspace.GetTownName(r.townRoot)
|
||||
}
|
||||
|
||||
sessionID := addressToSessionID(msg.To, townName)
|
||||
sessionID := addressToSessionID(msg.To)
|
||||
if sessionID == "" {
|
||||
return nil // Unable to determine session ID
|
||||
}
|
||||
@@ -959,21 +952,15 @@ func (r *Router) notifyRecipient(msg *Message) error {
|
||||
|
||||
// addressToSessionID converts a mail address to a tmux session ID.
|
||||
// Returns empty string if address format is not recognized.
|
||||
func addressToSessionID(address, townName string) string {
|
||||
func addressToSessionID(address string) string {
|
||||
// Mayor address: "mayor/" or "mayor"
|
||||
if strings.HasPrefix(address, "mayor") {
|
||||
if townName != "" {
|
||||
return session.MayorSessionName(townName)
|
||||
}
|
||||
return "" // Cannot generate session name without town name
|
||||
return session.MayorSessionName()
|
||||
}
|
||||
|
||||
// Deacon address: "deacon/" or "deacon"
|
||||
if strings.HasPrefix(address, "deacon") {
|
||||
if townName != "" {
|
||||
return session.DeaconSessionName(townName)
|
||||
}
|
||||
return "" // Cannot generate session name without town name
|
||||
return session.DeaconSessionName()
|
||||
}
|
||||
|
||||
// Rig-based address: "rig/target"
|
||||
|
||||
Reference in New Issue
Block a user