fix(agent): prompt guidance no longer mandates web tools the session doesn't have (#39797, salvage #39905) - #89924
Open
teknium1 wants to merge 1 commit into
Open
fix(agent): prompt guidance no longer mandates web tools the session doesn't have (#39797, salvage #39905)#89924teknium1 wants to merge 1 commit into
teknium1 wants to merge 1 commit into
Conversation
Contributor
૮ >ﻌ< ა ci reviewran on 141fbd9 — fix(agent): respect permitted web retrieval guidance ❌ Job failuresPython tests / Run tests slice 12/12 · View jobJob Python tests / Run tests slice 12/12 failed.
|
Contributor
Author
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
The system prompt and browser tool schemas no longer hard-mandate
web_search/web_extract— guidance now names retrieval tools only when they are actually in the active toolset, so user-configured alternatives (e.g. a Kagi search skill with SOUL.md overrides) are honored. Fixes #39797, salvages #39905 by @yinkev.Root cause:
OPENAI_MODEL_EXECUTION_GUIDANCEsaid "Current facts → use web_search" and the staticbrowser_navigate/browser_cdpschemas said "prefer web_search or web_extract" unconditionally — the model followed the prompt over the user's SOUL.md instruction, and hallucinated the tools when the web toolset was disabled.Changes
agent/prompt_builder.py: execution guidance says "appropriate permitted retrieval/search tool" instead of mandatingweb_searchmodel_tools.py: new_apply_browser_retrieval_hints()— replaces the old one-way strip hack; static schemas stay toolset-neutral and concrete tool names are appended only after check_fn filtering establishes availability (idempotent, so repeated schema builds stay byte-stable)tools/browser_tool.py,tools/browser_cdp_tool.py: static schema descriptions made toolset-neutralValidation
tests/agent/test_prompt_builder.py+tests/test_model_tools.py+tests/tools/test_browser_hardening.py+tests/tools/test_browser_cdp_tool.pyBROWSER_TOOL_SCHEMAS/BROWSER_CDP_SCHEMA(no-web / web_search-only / both)use web_search/prefer web_extractacross agent/, tools/)Salvaged from #39905 (cherry-picked with original authorship); conflicts against current main resolved in the two test files only.
Ported insight cross-checked against langchain-ai/deepagents#5602, which shipped the same fix class this week (web-search prompt guidance gated on Tavily availability) — external validation that model-facing guidance must be filtered to the live toolset.
Infographic
Infographic generation unavailable this run (FAL balance exhausted — hard fail per policy). Will attach on regeneration.