Repository navigation
Description
Summary
In Plan Mode, the agent cannot use WebFetch (or WebSearch) to research online while it plans. Any call fails with tool not allowed: WebFetch is disabled in plan mode - use one of ... instead; do not retry this tool until the plan is approved. The agent should be able to research online during planning.
Root cause, verified in the code (not reproduced at runtime):
internal/tools/WebFetch.yamlandinternal/tools/WebSearch.yamllistmodes: [standard, auto, auto-with-judge, readonly]and leave outplan.ToolManifest.AvailableIn(internal/agent/domain/tool_manifest.go) checks that list, andService.ExecuteTool(internal/tools/service.go) rejects the call withtoolUnavailableError.- The plan-mode reminder in
config/reminders.go(defaultModeChangeGuidance["plan"]) tells the model that "the web, media and system tools ... are DISABLED in plan mode", so the model is also told not to try. - This is inconsistent: read-only subagents, which Plan Mode can spawn through
Agent, already getWebFetchandWebSearchbecause their manifests includereadonly. So the parent agent can reach the web only through a subagent. internal/tools/service_test.go(TestExecuteTool_ModeGuard) pins the current behavior with the case"plan rejects the web tools".
Things the fix needs to handle:
WebFetchwithdownload=true, or a binary response, writes the content toSessionArtifactsDir(saveToFileininternal/tools/web_fetch.go). That directory is outside the plan-mode scratchpad. The fix has to decide whether plan mode allows that write, sends it to the scratchpad, or rejects downloads.
Steps to Reproduce
- Start
infer chatand press Shift+Tab until the status line shows Plan Mode. - Ask the agent to plan something that needs online research, for example "look up the latest release notes for X and plan the upgrade".
- The agent calls
WebFetch(orWebSearch).
Expected Behavior
WebFetch and WebSearch run in Plan Mode, so the agent can research online while it plans. They keep their usual domain allow-list and approval settings.
Acceptance criteria:
- Add
plantomodesininternal/tools/WebFetch.yamlandinternal/tools/WebSearch.yaml. - Plan mode does not write fetched content outside the scratchpad. Pick one: save
download=true/binary results to the scratchpad, reject downloads with a clear error, or explicitly allow the session artifacts dir. - Update the plan guidance in
config/reminders.goto listWebFetch/WebSearchas executable. - Update
TestExecuteTool_ModeGuardininternal/tools/service_test.go, and regenerateinternal/agent/loop/testdata/tool_definitions.golden.jsonif the plan-mode tool set changes (TestToolDefinitionsGoldenwith-update). - Update the tool list in
docs/plan-mode.md(intro and "What the model is told to do") and the plan-mode note indocs/tools-reference.md.
Actual Behavior
The call fails with tool not allowed: WebFetch is disabled in plan mode .... The plan-mode reminder also tells the model the web tools are disabled, so the agent cannot research online for planning.
Related: #1184 (made AskUserQuestion available in every mode, a similar manifest modes change), #1367 (moved tool definitions into the manifests where modes now lives).
Activity
edenreich commentedon Nov 16, 2026
@infer can you fix this? use /ponytail:ponytail
inference-gateway-maintainer commentedon Nov 16, 2026
Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.9· CLI:v0.262.0· Gateway:v0.67.1· View JobTodos
Pull Request
#1884
✅ Infer Result: Success
Golden file confirms it end to end:
"plan"mode now offersWebFetchandWebSearch(lines 1886-1887). All nine todos are done, the tree is clean, and everything is pushed.Fix shipped - #1884 (ready for review)
Root cause (as verified in the issue):
internal/tools/WebFetch.yamlandWebSearch.yamlomittedplanfrommodes, soService.ExecuteToolrejected web calls in plan mode and the plan-mode reminder told the model they were disabled.What changed:
plantomodesininternal/tools/WebFetch.yamlandinternal/tools/WebSearch.yaml, same order convention asAskUserQuestion.yaml(the [FEATURE] Make AskUserQuestion available on all modes #1184 precedent)saveToFileininternal/tools/web_fetch.gonow redirectsdownload=truewrites (and unavoidable binary-response saves) into the plan-mode scratchpad (config.ProjectScratchpadDir()) instead of the session artifacts dir - plan mode still writes nowhere outside it,MkdirAllcreates the scratchpad, and other modes are unchangedconfig/reminders.goplan guidance:WebFetch/WebSearchmoved into the fully-executable TOOL SET list, dropped from the disabled group, with the scratchpad redirect notedTestExecuteTool_ModeGuardreplaced "plan rejects the web tools" with plan-allowedWebFetch/WebSearchcases; addedTestFetchTool_Execute_PlanModeSavesIntoScratchpadcovering the download path; regeneratedtool_definitions.golden.jsonviaTestToolDefinitionsGolden -update(plan-mode tool list now carries both tools)docs/plan-mode.md, and the plan-mode note indocs/tools-reference.mdVerification: the repo's pre-commit gate passed in full (mod:tidy, fmt, lint:imports, golangci-lint 0 issues, markdownlint) plus the focused suites (
TestToolDefinitionsGolden,TestExecuteTool_ModeGuard, the new scratchpad test,config,cmd/runtime). Three pre-existing binary-save tests fail in this CI runner only - I reproduced them failing identically with my diff stashed: this runner's sandbox denies writes under~/.infer, which those tests' artifacts dir needs. The new test is hermetic viat.Setenv("HOME", t.TempDir())(same pattern as the loop tests).Bookkeeping: issue added to Roadmap 2026 board and set to QA;
[DOCS]follow-up filed per the org template - inference-gateway/docs#1247. No downstream schema/env/release impact (CLI-internal manifests), so no other follow-ups.Skipped reproducing the original failure at runtime (the issue verified it in code, and the manifest check is the mechanism) and running real online fetches in plan mode. One risk: plan-mode downloads now land in the scratchpad, so
/resetwipes them alongside other runtime dirs - the docs note this behavior.Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.9· CLI:v0.262.0· Gateway:v0.67.1· Exit Code:0· Duration: 6m 11sTokens: 5,810,302 in · 30,821 out · 5,841,123 total (51 requests)
Tool calls: 87 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
inference-gateway-releaser commentedon Nov 17, 2026
🎉 This issue has been resolved in version 0.263.0 🎉
The release is available on:
Your semantic-release bot 📦🚀