Skip to content

fix(agent): make tool selection additive - #6104

Draft
RaresKeY wants to merge 1 commit into
odysseus-dev:devfrom
RaresKeY:fix/agent-additive-tool-selection
Draft

fix(agent): make tool selection additive#6104
RaresKeY wants to merge 1 commit into
odysseus-dev:devfrom
RaresKeY:fix/agent-additive-tool-selection

Conversation

@RaresKeY

@RaresKeY RaresKeY commented Aug 17, 2026

Copy link
Copy Markdown
Member

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 commit 9fe1a9281. 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

  • This PR targets dev, not main. All PRs land in dev; main is curated by the maintainer at each release. If your PR is on main by 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

  • Bug fix (non-breaking — fixes a confirmed issue)
  • New feature (non-breaking — adds new behaviour)
  • Breaking change (changes or removes existing behaviour)
  • Refactor / cleanup (behaviour unchanged)
  • Documentation only
  • CI / tooling / configuration

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above — no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app (docker compose up or uvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.
  • I did not run the app/runtime validation and stated that gap in How to Test. Leave this unchecked when the app-run box above is checked.

How to Test

  1. Run 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.
  2. Run the full test suite with pytest -q, then run node --check static/js/chat.js and python -m compileall -q routes src tests.
  3. In a running app, select Agent mode, enable Bash and web search, and send a request containing a URL plus a Bash task. Confirm the agent receives bash, web_search, and web_fetch candidates, and that disabling either control still wins over prompt text.
  4. In Chat mode, send prompts containing a URL, an absolute workspace path, or operational verbs. Confirm the request remains Chat unless the caller explicitly selects Agent.

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.

  • Screenshot or short clip of the change in the running app, attached below. Mobile screenshot too if the change affects mobile.
  • Style match: the change uses Odysseus's existing visual language. Specifically:
    • Reuse existing CSS variables (--red, --fg, --bg, --card, --border, etc.) — do not introduce new color values, font sizes, or spacing units.
    • Reuse existing button/input/card/border classes. Don't invent parallel styling.
    • No Unicode emoji in UI or code. Use inline SVG (matching the monochrome icon style already in static/index.html) or plain text.
    • Monospaced font (Fira Code) for primary UI text. Don't override.
    • Dark theme is the default; any light-mode work must be wired through the existing theme system, not hard-coded.
  • No new component patterns. If a similar widget already exists in the app, extend it instead of writing a parallel one.
  • I am not an LLM agent submitting a bulk PR. If you are, please open an issue describing the problem first — bulk auto-generated PRs that don't match the project's visual style are closed on sight, even when the underlying fix is correct.

Screenshots / clips

Not captured. static/js/chat.js changes 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.

@github-actions

Copy link
Copy Markdown

⚠️ PR description is complete; validation evidence is still outstanding

Changed-file classification: UI-sensitive.

Author-reported runtime / visual state

  • The author explicitly reports that app/runtime validation was not performed.
  • The screenshot/clip checkbox is not checked for this UI-sensitive change.
  • The Screenshots / clips section does not contain an actual attachment or link.

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
RaresKeY force-pushed the fix/agent-additive-tool-selection branch from 724a2f4 to a3f2015 Compare August 17, 2026 16:30
@github-actions github-actions Bot added needs runtime validation Runtime validation not attested — tick the app-run box after running it, or state the gap needs visual evidence UI-sensitive change without an attested screenshot or clip from the running app labels Aug 17, 2026
@RaresKeY
RaresKeY force-pushed the fix/agent-additive-tool-selection branch from a3f2015 to acf2714 Compare August 17, 2026 16:43
@RaresKeY
RaresKeY force-pushed the fix/agent-additive-tool-selection branch from acf2714 to 9fe1a92 Compare August 19, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs runtime validation Runtime validation not attested — tick the app-run box after running it, or state the gap needs visual evidence UI-sensitive change without an attested screenshot or clip from the running app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent: keep Chat/Agent mode explicit and make tool selection additive

1 participant