Skip to content

fix(vision): make vision tools honor model.supports_vision - #29987

Closed
tillfalko wants to merge 4 commits into
NousResearch:mainfrom
tillfalko:main
Closed

fix(vision): make vision tools honor model.supports_vision#29987
tillfalko wants to merge 4 commits into
NousResearch:mainfrom
tillfalko:main

Conversation

@tillfalko

Copy link
Copy Markdown
Contributor

Motivation

model.supports_vision was added in #29679 to let vision-capable models see images directly, but it only affects user-attached images. vision_analyze with provider: "custom", and browser_vision regardless of provider always use auxiliary models.

What does this PR do?

vision_analyze has a fast path that returns the image directly to vision-capable models. This PR makes vision_analyze respect model.supports_vision when branching on this. browser_vision was lacking a fast path entirely and always sent images through an auxiliary model. This PR adds a fast path to browser_vision. When image routing resolves to native, and either the provider path supports multimodal tool results or model.supports_vision is true, browser_vision returns the screenshot natively instead of forcing an auxiliary vision call. This is consistent with the existing behavior of vision_analyze.

Related Issue

#17940 #8731

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • hermes-agent/tools/vision_tools.py: honor supports_vision in vision_analyze.
  • hermes-agent/tools/browser_tool.py: add fast path to browser_vision and honor supports_vision.
  • hermes-agent/tests/tools/test_vision_native_fast_path.py: extend test coverage for changes above.
  • hermes-agent/tests/tools/test_browser_console.py: extend test coverage for changes above.

How to Test

vision_analyze

  1. Use a vision-capable model with provider: "custom" and set model.supports_vision: true
  2. Tell the agent to use vision_analyze on an image.
  3. Check the logs to see that no auxiliary model was called.

browser_vision

  1. Use a vision-capable model with provider: "custom" and set model.supports_vision: true
  2. Tell the agent to use browser_vision on a website.
  3. Check the logs to see that no auxiliary model was called.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: NixOS 25.11

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • [N/A] I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • [N/A] I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/vision Vision analysis and image generation tool/browser Browser automation (CDP, Playwright) labels May 21, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #34562. Your four commits were rebased onto current main with your authorship preserved in git log (f053533, f8b8dff, 2402ec5, c3f28c6).

On top of your work I added a small consolidation refactor: the fast-path gate (native routing + provider allowlist OR supports_vision override) now lives in one shared helper _should_use_native_vision_fast_path() that both vision_analyze and browser_vision call, instead of the logic being duplicated across the two tools. browser_vision was also typed Union[str, Dict] to match its real return shape. Same behavior you implemented, just one source of truth.

Thanks for the fix — honoring model.supports_vision for custom/local providers and giving browser_vision a native fast path were both real gaps.

KKT-OPT pushed a commit to KKT-OPT/hermes-agent that referenced this pull request May 31, 2026
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
xyshanren pushed a commit to xyshanren/hermes-agent-cn that referenced this pull request Jun 25, 2026
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
donbowman pushed a commit to donbowman/hermes-agent that referenced this pull request Jul 13, 2026
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists tool/browser Browser automation (CDP, Playwright) tool/vision Vision analysis and image generation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants