fix(harness): deny WebSearch/WebFetch on read-only claude workers - #461
Merged
Conversation
Under --permission-mode plan, Claude Code's built-in web tools route to an interactive approval prompt that a non-interactive Brigade worker cannot answer, so read-only claude workers blocked with no final output. Add WebSearch and WebFetch to _CLAUDE_DISALLOWED_READ_ONLY so they are hidden from the read-only tool surface, exactly like Bash/Edit/Write. The danger-full-access branch skips permissions entirely, so no prompt can block there and its deny list is unchanged. Fixes #456 Co-authored-by: Claude <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: escoffier-labs/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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
Fixes #456. A read-only Claude worker could stall with
ok=false, exit_code=5, "Claude is waiting for a permission prompt"when Claude Code requested approval for a Web Search tool call.--permission-mode planfails closed on writes, but the built-in web tools (WebSearch,WebFetch) still route to an interactive approval prompt that a non-interactive Brigade worker cannot answer.Root-cause fix at the adapter boundary (sibling of #446): add
WebSearch,WebFetchto_CLAUDE_DISALLOWED_READ_ONLYinsrc/brigade/agents.py, hiding the web tools from the read-only tool surface exactly like Bash/Edit/Write. A read-only REVIEW worker has no need for web tools.--end-of-options marker between it and the prompt is untouched (no bug(harness): Claude read-only prompt is consumed as --disallowedTools values #446/fix(harness): keep claude prompt out of variadic --disallowedTools #451 variadic regression).--dangerously-skip-permissions, so no prompt can block there; its deny list (Task,Agent) is unchanged.Tests
test_claude_read_only_denies_web_tools_that_prompt_for_approval: asserts on the built argv that WebSearch/WebFetch are in the read-only deny list, the prompt is still separated by--and intact as the final positional, and the danger-full-access branch is unchanged.Verification
brigade work verify run --target . --command "pytest -q tests/test_agents.py" --capture brigade-work→ exit=0brigade work verify run --target . --command "./scripts/verify" --capture brigade-work→ exit=0 (ruff, format, version-sync, mypy, full pytest + coverage floor)