Repository navigation
Fix #86: Grant and advertise WebFetch/WebSearch in Expand Project chat - #270
Open
zwanski-start wants to merge 1 commit into
Open
zwanski-start wants to merge 1 commit into
zwanski-start wants to merge 1 commit into
Conversation
…Project chat The expand session passed WebFetch/WebSearch in allowed_tools, but the generated settings file's permission allow-list omitted them and the system prompt (the expand-project skill) never told the model those tools exist, so Claude refused to open user-supplied reference URLs. - Add WebFetch, WebSearch and Grep to the expand settings allow-list - Append a session tool section to the system prompt stating that web tools are available and should be used for user-provided links - Add WebFetch/WebSearch to the spec-creation settings allow-list too - Add test_expand_chat_session.py covering allowed/denied tools Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
🔍 QA report: ✅ PassedTester: Ken (cubefarm agent, in a fresh session) · Round: 1 · Author: Barbara The Expand Project chat now grants WebFetch and WebSearch (plus Grep) in its generated settings file's permissions.allow, matching allowed_tools, and adds a tools section to its system prompt saying they may be used, which fixes issue #86. Write/Edit/MultiEdit/NotebookEdit/Bash stay blocked in both allowed_tools and the settings deny list. The 4 new tests pass here, and 2 of them fail on master for the right reasons. ruff, mypy (same errors as master), the security tests and the UI build all pass, and the app handles a missing Claude CLI gracefully.
🧪 Commands run
No browser screenshots were taken in this round. Posted by cubefarm · merges automatically once GitHub's checks pass |
cabana8471-arch
pushed a commit
to cabana8471-arch/autoforge
that referenced
this pull request
Nov 8, 2026
…Project chat Adaptations: EXPAND_TOOLS_PROMPT goes into the --system-prompt-file prompt together with my-features' NO_SHELL_PROMPT_NOTE; the PR's tests are merged into the existing test_expand_chat_session.py (from AutoForgeAI#273) and read the prompt from the file and stub find_claude_cli. Integrates AutoForgeAI#270 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
cabana8471-arch
added a commit
to cabana8471-arch/autoforge
that referenced
this pull request
Nov 8, 2026
The tool permission tests added with AutoForgeAI#270 started an Expand session without stubbing registry.get_effective_sdk_env, which created ~/.autoforge/registry.db in the real home directory. They now stub the registry like test_chat_sessions_no_shell. New conftest.py fails the run when a test creates ~/.autoforge that did not exist at session start (active in CI and on machines without a registry). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
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.
Problem
In the Expand Project ("add feature with AI") chat, Claude kept saying it wasn't allowed to use
WebFetch/WebSearch, even when the user pasted a reference URL. The user's own Claude settings and the project's.claude_settings.jsonhave no effect here, because this session builds its own permissions:server/services/expand_chat_session.pywrites a temporary settings file (.autoforge/.claude_settings.expand.<uuid>.json) and passes it throughClaudeAgentOptions(settings=...). Since nosetting_sourcesare given, user and project settings are not loaded.WebFetchandWebSearchwere already inallowed_tools, but they were missing from that settings file'spermissions.allowlist.expand-project.mdskill, which never mentions web tools. So the model assumed it was restricted to Read plus feature creation, and refused.Changes
expand_chat_session.pyWebFetch,WebSearchandGrepto the generated settingspermissions.allowlist, matching what is already inallowed_tools.EXPAND_BUILTIN_TOOLSconstant.EXPAND_TOOLS_PROMPTsection to the end of the system prompt. It lists the session's tools and says plainly that WebFetch/WebSearch are allowed and should be used when the user shares a link. It still says file changes and commands are not available.spec_chat_session.py: addedWebFetchandWebSearchto its settings allow-list too. They were already inallowed_toolsthere, so this is just for consistency.test_expand_chat_session.py(4 tests): replacesClaudeSDKClientwith a fake that records the options and the generated settings file. The tests check that web tools are allowed and not denied, that the prompt mentions them (and$ARGUMENTSis still filled in), and that Write/Edit/MultiEdit/NotebookEdit/Bash stay disabled.CLAUDE.md: added the new test to the testing list.Verification
python -m pytest test_expand_chat_session.py: 4 passedruff check .: cleanpython test_security.py: all passedmypyon the touched files: the only errors are 8 "unused type: ignore" errors that also appear onmaster. My change adds none.Assumptions / notes
.claude/commands/expand-project.md, because that file is also the interactive/expand-projectCLI command, where the available tools are different.disallowed_toolsand the settingsdenylist.Closes #86
🤖 Generated with Claude Code