fix: prevent stale gate state from blocking Gandalf (#56)#57
fix: prevent stale gate state from blocking Gandalf (#56)#57justinjdev merged 2 commits intomainfrom
Conversation
Three fixes for the failure chain where stale quest-state.json blocks a fresh fellowship session: - fellowship skill: pre-flight CWD check aborts if Gandalf starts inside a .claude/worktrees/ path before spawning anything - gate-guard hook: escape hatch allows `fellowship gate reject/approve` and `fellowship init` through even when gate_pending is true, giving a self-rescue path without requiring manual user intervention; shell chaining operators are rejected to prevent bypass abuse; held state still blocks everything (intentional lead-imposed pause) - CLI: new `fellowship state clean-worktrees [--dir PATH]` command scans all worktrees and resets stale gate_pending/held flags in one shot Closes #56 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3c2abe72-fde3-43a2-b44f-899df76ef4db
📒 Files selected for processing (4)
cli/cmd/fellowship/main.gocli/internal/hooks/guard.gocli/internal/hooks/guard_test.goplugin/skills/fellowship/SKILL.md
|
Note — root cause 2 not fully addressed The hook has no session identity in its input payload (only The clean fix would be: if Claude Code ever exposes session/task context in PreToolUse hook payloads, compare the current task ID against For now, the pre-flight CWD check (prevents the scenario) + escape hatch (recovery path) are the best we can do with the current hook API. |
- clean-worktrees: distinguish ENOENT vs other Stat errors; warn on EACCES/EPERM instead of silently skipping - clean-worktrees: use state.WithLock for atomic load→mutate→save and clear GateID alongside GatePending (consistent with other reset paths) - isFellowshipEscapeCommand: tokenize command and match binary+subcommand exactly instead of substring; also reject <>, newlines, backtick, $() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
pwdcontains.claude/worktrees, before spawning anythingfellowship gate reject/approveandfellowship initare allowed through even whengate_pendingis true — self-rescue without user manual intervention; shell chaining operators (&&,||,;,|) are rejected to prevent abuse;heldstate still blocks everythingfellowship state clean-worktreesCLI command: scans all worktrees under.claude/worktrees/and resets stalegate_pending/heldflags in one shotWhat's not fixed
EnterWorktreetool behavior outside our controlTest plan
TestGateGuard_AllowsFellowshipGateRejectWhenPending— escape hatch works for gate rejectTestGateGuard_AllowsFellowshipInitWhenPending— escape hatch works for initTestGateGuard_BlocksChainedCommandsWithFellowshipEscape— chaining operators not bypassedTestGateGuard_HeldBlocksFellowshipEscapeCommands— held state still blocks everythinggo test ./...passesCloses #56
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
fellowship state clean-worktreescommand to reset GatePending and Held flags across all worktrees with per-worktree progress reportingImprovements