fix: add Write to headed-mode server allowedTools - #2
Draft
RachaelQuisel wants to merge 3 commits into
Draft
Conversation
The server.ts was sending '--allowedTools Bash,Read,Glob,Grep' (without Write) in the sidebar queue args. Since sidebar-agent uses queue args over its fallback defaults, Write was never available in headed mode despite the CHANGELOG claiming it was. Adds a regression test. https://claude.ai/code/session_01BfhJ1ohd7R9X1ecR1p3x7W
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR ensures the headed-mode sidebar agent is allowed to use the Write tool by updating the server’s allowedTools argument and adds a regression test tying server and agent behavior together so the omission cannot silently recur. Sequence diagram for headed-mode sidebar Write tool enablementsequenceDiagram
actor User
participant headed_server as headed_server
participant Claude as Claude_sidebar_agent
User->>headed_server: requestSidebarWrite
headed_server->>Claude: spawnClaude(userMessage, extensionUrl, forTabId)
Claude->>Claude: [allowedTools "Bash,Read,Glob,Grep,Write"]
Claude-->>User: fileWriteCompleted
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The server's spawnClaude args passed 'Bash,Read,Glob,Grep' without Write. The sidebar-agent fallback included Write, but the server-provided args take precedence, so the sidebar agent could never actually write files. Adds a regression test tying server and agent allowedTools together. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BfhJ1ohd7R9X1ecR1p3x7W
The remote commit already had a test for this. My rebase created a duplicate — consolidate into the better-placed "Allowed Tools" section. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BfhJ1ohd7R9X1ecR1p3x7W
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
Writeto the server'sallowedToolsinspawnClaude()— the sidebar agent's fallback already included it, but the server-provided args take precedence, so Write was silently blockedsidebar-security.test.tsensuring the server's allowedTools stays in sync with the agent's, placed in its own "Allowed Tools" section for clarityTest plan
bun test browse/test/sidebar-security.test.ts— 13 tests pass (was 12 before)