fix: Detect mayor role from any rig's mayor/ folder (gt-0nh8)
Previously gt prime only detected the Mayor role from town root (~/gt) or ~/gt/mayor/. Now it also detects Mayor from <rig>/mayor/ paths like ~/gt/gastown/mayor/rig, enabling mayor sessions to work correctly regardless of which rig directory they're attached to. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,7 @@ var primeCmd = &cobra.Command{
|
|||||||
Long: `Detect the agent role from the current directory and output context.
|
Long: `Detect the agent role from the current directory and output context.
|
||||||
|
|
||||||
Role detection:
|
Role detection:
|
||||||
- Town root or mayor/rig/ → Mayor context
|
- Town root, mayor/, or <rig>/mayor/ → Mayor context
|
||||||
- <rig>/witness/rig/ → Witness context
|
- <rig>/witness/rig/ → Witness context
|
||||||
- <rig>/refinery/rig/ → Refinery context
|
- <rig>/refinery/rig/ → Refinery context
|
||||||
- <rig>/polecats/<name>/ → Polecat context
|
- <rig>/polecats/<name>/ → Polecat context
|
||||||
@@ -186,6 +186,12 @@ func detectRole(cwd, townRoot string) RoleInfo {
|
|||||||
rigName := parts[0]
|
rigName := parts[0]
|
||||||
ctx.Rig = rigName
|
ctx.Rig = rigName
|
||||||
|
|
||||||
|
// Check for mayor: <rig>/mayor/ or <rig>/mayor/rig/
|
||||||
|
if len(parts) >= 2 && parts[1] == "mayor" {
|
||||||
|
ctx.Role = RoleMayor
|
||||||
|
return ctx
|
||||||
|
}
|
||||||
|
|
||||||
// Check for witness: <rig>/witness/rig/
|
// Check for witness: <rig>/witness/rig/
|
||||||
if len(parts) >= 2 && parts[1] == "witness" {
|
if len(parts) >= 2 && parts[1] == "witness" {
|
||||||
ctx.Role = RoleWitness
|
ctx.Role = RoleWitness
|
||||||
|
|||||||
Reference in New Issue
Block a user