Skip to content

perf(computer_use): cap capture size and cache vision routing - #69909

Merged
OutThisLife merged 2 commits into
mainfrom
bb/computer-use-perf
Jul 23, 2026
Merged

perf(computer_use): cap capture size and cache vision routing#69909
OutThisLife merged 2 commits into
mainfrom
bb/computer-use-perf

Conversation

@OutThisLife

@OutThisLife OutThisLife commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Computer Use stays sluggish even once the tool is available: every capture ships a full-resolution SOM screenshot over the daemon socket and into the model turn, and each capture may re-read config to decide aux-vision routing.

What this PR does

  • Cap driver screenshots on session start via set_config(max_image_dimension) — config computer_use.max_image_dimension, default 1456 (the aux-vision downscale). 0 leaves the driver default.
  • Cache the aux-vision routing decision per (provider, model) so captures stop re-loading config every call.
  • Add computer_use.capture_after_mode (default som, i.e. no behavior change) so users who want raw speed can drop capture_after follow-ups to ax (elements only, no PNG) or vision.

Default behavior is unchanged — the screenshot-after-action contract stays som; the win is a smaller image plus a cached routing lookup. Does not replace the Desktop PATH fix (#69902) or the overlay CPU fix (#69903).

Test plan

  • pytest tests/computer_use/test_cua_perf_knobs.py tests/tools/test_computer_use.py::TestCaptureAfterExactTarget tests/tools/test_computer_use.py::TestLazyMcpInstall -q → 11 passed
  • Manual: on a session, get_window_state/SOM captures return the capped image dimension
  • Manual: computer_use.capture_after_mode: ax returns element text with no follow-up screenshot

@alt-glitch alt-glitch added type/perf Performance improvement or optimization P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tools Tool registry, model_tools, toolsets sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 23, 2026
Cut steady-state Computer Use latency without changing default behavior
or waiting on cua-driver:

- Cap screenshots via set_config(max_image_dimension) on session start
  (config: computer_use.max_image_dimension, default 1456)
- Cache aux-vision routing per (provider, model) so captures skip
  repeated load_config()
- Add computer_use.capture_after_mode (default som) so users can opt
  follow-ups down to ax (elements only) for speed
@OutThisLife
OutThisLife force-pushed the bb/computer-use-perf branch from 87b9b37 to 12ad13d Compare July 23, 2026 05:52
@OutThisLife OutThisLife changed the title perf(computer_use): shrink captures and slim capture_after perf(computer_use): cap capture size and cache vision routing Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on cc1765d

all good!

# Conflicts:
#	hermes_cli/config.py
#	tools/computer_use/cua_backend.py
@OutThisLife
OutThisLife merged commit 7168845 into main Jul 23, 2026
37 checks passed
@OutThisLife
OutThisLife deleted the bb/computer-use-perf branch July 23, 2026 06:49
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…se-perf

perf(computer_use): cap capture size and cache vision routing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/perf Performance improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants