fix(agent): make tool selection additive - #6104
Draft
RaresKeY wants to merge 1 commit into
Draft
Conversation
This was referenced Aug 17, 2026
|
Changed-file classification: UI-sensitive. Author-reported runtime / visual state
Checkboxes are author attestations. GitHub Actions results remain the execution evidence for CI; this check does not prove that a local command ran. This comment updates automatically when the description or changed files change. |
RaresKeY
force-pushed
the
fix/agent-additive-tool-selection
branch
from
August 17, 2026 16:30
724a2f4 to
a3f2015
Compare
17 tasks
RaresKeY
force-pushed
the
fix/agent-additive-tool-selection
branch
from
August 17, 2026 16:43
a3f2015 to
acf2714
Compare
27 tasks
RaresKeY
force-pushed
the
fix/agent-additive-tool-selection
branch
from
August 19, 2026 10:40
acf2714 to
9fe1a92
Compare
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
Makes Chat/Agent mode an explicit request decision and makes prompt-based tool-schema selection additive. The route no longer promotes Chat to Agent, infers a workspace, or grants Bash from prompt text; explicit Bash/web controls seed candidates, ToolIndex retrieval and deterministic hints may only add candidates, hard denials still filter the result, and the execution dispatcher remains the final authorization boundary. This fixes the URL-plus-Bash failure where web classification could omit the explicitly enabled Bash schema.
Stack position
This PR is intentionally independent of the #5818 split and is based directly on current
dev; its unique delta is commit9fe1a9281. It does not consume #6119, #6118, #6120, #6084, #5819, or #5821. Its additive tool-selection contract can be reconciled later if the dispatcher evolves, but that decision is separate from this focused fix.Target branch
dev, notmain. All PRs land indev;mainis curated by the maintainer at each release. If your PR is onmainby accident, click "Edit" on this PR and change the base.Linked Issue
Fixes #6103
Part of #5815
Related to #6056, #5332, #6003, #6004, #6005, #6006, and #6007. The behavior-neutral shadow work in #6006 can coexist; #6007's active prompt-driven Chat escalation is an alternative authority boundary and should not be layered simultaneously without a maintainer decision.
Type of Change
Checklist
devdocker compose uporuvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.How to Test
pytest -q tests/test_tool_policy.py tests/test_chat_route_tool_policy.py tests/test_foreground_model_routing.py tests/test_agent_loop.py tests/test_api_call_integration_routing.py tests/test_bg_job_tools.py tests/test_tool_rag_contacts_domain.py tests/test_history_display_model_hydration.py tests/test_pr6020_rebase_regressions.py.pytest -q, then runnode --check static/js/chat.jsandpython -m compileall -q routes src tests.bash,web_search, andweb_fetchcandidates, and that disabling either control still wins over prompt text.Current secretless validation on the rebased public head passes 263 focused tests. JavaScript syntax and Python compilation also passed. A live browser/model endpoint smoke was not run, so this PR remains draft with runtime and visual evidence outstanding.
Visual / UI changes — REQUIRED if you touched anything that renders
Anything that changes what the UI looks like — buttons, icons, padding, colors, fonts, spacing, layout, CSS, HTML, SVG, or any
static/js/module that draws to the DOM — needs all of the following. PRs that change rendering without these WILL be closed.--red,--fg,--bg,--card,--border, etc.) — do not introduce new color values, font sizes, or spacing units.static/index.html) or plain text.Fira Code) for primary UI text. Don't override.Screenshots / clips
Not captured.
static/js/chat.jschanges only how the existing visible mode and tool controls are serialized; no DOM, style, layout, or rendered component changed. A live runtime smoke and visual evidence are still outstanding.