feat(crew): mail mayor before actions requiring human intervention#3508
Open
n43-ryan wants to merge 4 commits intogastownhall:mainfrom
Open
feat(crew): mail mayor before actions requiring human intervention#3508n43-ryan wants to merge 4 commits intogastownhall:mainfrom
n43-ryan wants to merge 4 commits intogastownhall:mainfrom
Conversation
When a polecat works on a cross-rig bead (e.g., hq-xxx), bd.Create for the MR bead would resolve to the town-level database instead of the rig's database. The refinery scans only its own database, so it never found the MR and the branch sat unmerged indefinitely. Fix: add Rig field to CreateOptions (passes --rig to bd create) and set Rig: rigName when creating the MR bead in done.go. The rig name is already available in the done context (written to the MR description's rig: field), so no new lookups are required. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…-gpy) Add ValidateRigPrefix() to internal/beads/routes.go — a post-creation guard that warns when a newly created bead's prefix doesn't match the expected rig prefix. This catches cases where bd create routing resolves to the wrong database despite Rig being set. Apply the guard (warning-only, never blocks) at: - cmd/done.go: MR bead creation (primary path) - cmd/mq_submit.go: MR bead creation (alternate path) + add Rig: rigName - refinery/engineer.go: conflict resolution task creation + add Rig: rigName Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…t-02c) Adds HUMAN_INPUT_REQUIRED protocol to crew agent context. When a crew agent anticipates an action that will block on a permission prompt (.claude/ edits, destructive ops, dangerously-skip-permissions-protected actions), it should mail mayor with subject 'HUMAN_INPUT_REQUIRED: <description>' and nudge mayor, then proceed immediately. Mayor notifies the user to come unblock the prompt. - Bumps gastown-agent-instructions to v2 in AGENTS.md - Adds "When Human Approval is Required" section to crew.md.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HUMAN_INPUT_REQUIREDmail to mayor before attempting actions that will block on a permission prompt.claude/directory edits, destructive ops, and any tool call that triggers a permission dialogContext
Upstream already addresses permission prompts at the infrastructure layer (
--dangerously-skip-permissions,AcceptStartupDialogstmux auto-dismiss, witness dialog auto-dismiss inDismissStartupDialogsBlind). This PR targets the residual case those mechanisms don't cover: Claude Code's own.claude/configuration files, which remain protected even under--dangerously-skip-permissions.When a crew agent attempts to edit
.claude/commands/orsettings.json, Claude Code presents an interactive confirmation that blocks indefinitely in an autonomous session. This protocol gives the human a path to unblock it.Protocol added
Follow-up (out of scope for this PR)
A PreToolUse hook that auto-detects
.claude/write attempts and fires the mail+nudge automatically would be more robust than an instructions-layer protocol. Tracked separately.Test plan
.claude/edit mails mayor before attemptingHUMAN_INPUT_REQUIREDsubject🤖 Generated with Claude Code