Crew workers are human-managed and should never be auto-killed by
gt doctor --fix. This adds defense-in-depth protection:
1. OrphanSessionCheck.Fix() now skips any session matching the
gt-<rig>-crew-<name> pattern
2. OrphanProcessCheck.Fix() now checks if a process has a crew
session pane as an ancestor before killing it
Even if detection fails (like the pgrep bug we just fixed), crew
sessions and their processes will be protected.
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The orphan-processes check was incorrectly killing active crew sessions
because pgrep -x tmux does not reliably find the tmux server on macOS.
Root cause:
- pgrep -x tmux was finding tmux attach-session processes but missing
the actual tmux server process
- Claude processes running in tmux panes were incorrectly flagged as
orphaned because their parent (tmux server) was not in the allowed list
Fixes:
1. Use ps + awk instead of pgrep to find tmux processes more reliably
2. Exclude Claude.app desktop processes from orphan detection (they are
not Gas Town CLI processes)
Closes: gt-ronyn
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When slinging a bead that has the template label (a proto), and --var
flags are provided, automatically call bd --no-daemon pour to
instantiate the proto with variable substitution before slinging.
This enables the seamless workflow:
gt sling mol-release beads --var version=0.38.0
Instead of the manual two-step:
bd --no-daemon pour mol-release --var version=0.38.0 --json
gt sling <resulting-mol-id> beads
Also adds a warning when slinging a proto without --var, since
{{variables}} will not be substituted.
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds comprehensive "Theory of Operation" section explaining WHY agents
must execute work immediately when found on their hook. Uses steam engine
metaphor to convey that this is physics, not politeness.
Each role gets a tailored metaphor:
- Mayor: main drive shaft
- Crew/Polecat: piston
- Deacon: flywheel
- Witness: pressure gauge
- Refinery: exhaust valve
The section explains the failure mode (agent waits, human is AFK,
Gas Town stops) and reinforces the propulsion principle.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- gt unsling: clear your own hook
- gt unsling <bead>: only unsling if that bead is hooked
- gt unsling <target>: clear another agent's hook
- gt unsling <bead> <target>: unsling specific bead from agent
- gt unhook: alias for gt unsling
Symmetric with gt sling/hook commands.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Beads CLI restructured: pour and wisp are now subcommands of mol.
- bd pour → bd mol pour
- bd wisp → bd mol wisp
Updated all documentation, templates, and code to use new command structure.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Delete all .formula.json files (TOML versions exist)
- Update sling.go comment to say TOML only
Note: Doc updates were prepared but those docs were deleted
upstream in the recent refactoring.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix crew next/prev: Pass session name via key binding to avoid run-shell context issue
- Add TouchTownActivity() for town-level activity signaling
- Implement daemon exponential backoff based on activity.json:
- 0-5 min idle → 5 min heartbeat
- 5-15 min idle → 10 min heartbeat
- 15-45 min idle → 30 min heartbeat
- 45+ min idle → 60 min heartbeat (max)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously, gt doctor --fix would kill workers whose spawning process had
exited, even though the Claude session was still running in tmux.
Now both identity_check.go and CleanStaleLocks check if the tmux session
exists before declaring a lock stale. A lock is only truly stale if BOTH
the PID is dead AND the session does not exist.
Also added ListSessionIDs() to tmux package to handle locks that store
session IDs (%N or $N format) instead of session names.
Adds CloneDivergenceCheck that detects when git clones have drifted
significantly behind origin/main:
- >10 commits behind: WARNING
- >50 commits behind: ERROR (EMERGENCY)
Only checks clones on main branch, since off-main clones are already
caught by BranchCheck. This distinguishes from beads-sync divergence
which is expected behavior.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add internal/beads/routes.go with helpers to manage routes.jsonl
- Update gt rig add to auto-append routes for new rigs
- Add prefix-conflict check to gt doctor
bd already has prefix routing via routes.jsonl - this wires up
Gas Town to maintain routes when rigs are added and detect conflicts.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bd defaults to $BD_ACTOR → git config user.name → $USER, which is
more accurate for system tools like doctor and rig init.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
gt start now reads rig settings (settings/config.json) and auto-starts
configured crew members. The crew.startup field supports:
- Single name: "dave"
- Multiple names: "max and joe" or "max, joe"
- All crew: "all"
- None: "none" or empty
Configured:
- beads: dave
- gastown: max and joe
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add CreatedBy field to Issue struct (matches beads GH#748)
- Add Actor field to CreateOptions, pass --actor to bd create
- Add ActorString() method to RoleInfo for identity formatting
- Update all beads.Create() callers to pass Actor
- Update direct bd create exec calls with --actor:
- mail/router.go: uses sender identity
- patrol_helpers.go: uses role name
- doctor/patrol_check.go: uses "gt-doctor"
- rig/manager.go: uses "gt-rig-init"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The crash logging fallback assumed users might have their town at
~/gastown, which only works if the gastown rig is installed. Now
only tries ~/gt as the conventional town root.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When GT_ROLE is set to a simple value like "crew", the role detection
was not reading GT_RIG and GT_CREW to get the full identity. This caused
gt mol status to show "/crew/" instead of "gastown/crew/max".
Now GetRoleWithContext checks these additional env vars when the rig
or polecat fields are empty after parsing the role string.
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Messages now show [from mayor] or [from beads/crew/dave] etc.
so recipients know who sent the nudge.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Detect crew/ prefix in polecatName and use crewSessionName() instead
of polecat session manager. This produces correct session names like
gt-beads-crew-dave instead of gt-beads-p-crew/dave.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add guard that checks if bead is already pinned before slinging.
Shows current assignee and requires --force to override.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Deacon propulsion was broken because:
1. outputDeaconPatrolContext() created patrols in gastown/mayor/rig/.beads
2. checkSlungWork() looked in ~/gt/deacon/.beads/ (empty)
3. These were different locations - pinned work never found
Fix:
- Created redirect: ~/gt/deacon/.beads/redirect -> ../.beads (town beads)
- Changed outputDeaconPatrolContext() to use ctx.WorkDir instead of
hardcoded gastown path
- Updated deacon template to remove hardcoded gastown references
- Updated wisp creation docs to use two-step pattern (create then pin)
Also cleaned up 14 stale patrol wisps that accumulated in rig beads
from repeated startup attempts.
Filed gt-0pdhj to track remaining hardcoded gastown dependencies.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Complete unification of work assignment commands:
- Add spawn flags to sling: --naked, --create, --molecule, --force, --account
- SpawnPolecatForSling now accepts SlingSpawnOptions struct
- Deprecate gt spawn with warning pointing to gt sling
- Update no-tmux-mode.md to use sling examples
gt sling now handles:
- Existing agents (mayor, crew, witness, refinery)
- Auto-spawning polecats when target is a rig
- Formula instantiation and wisp creation
- No-tmux mode for manual agent operation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Enable Gas Town to operate without tmux by using beads for args transport:
- Add `attached_args` field to beads AttachmentFields
- gt sling: Store args in bead description, graceful fallback if no tmux
- gt prime: Display attached args prominently on startup
- gt mol status: Include attached_args in status output
- gt spawn --naked: Assign work via mail only, skip tmux session
Agents discover args via gt prime / bd show when starting manually.
Docs added explaining what works vs degraded behavior in no-tmux mode.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes issues with the auto-replace logic:
- Use `bd close --force` for pinned beads (required by bd CLI)
- Naked beads (no molecule) get unpinned instead of closed
- Remove unused verifyBeadExistsForHook function
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>