perf(computer_use): cap capture size and cache vision routing - #69909
Merged
Conversation
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
force-pushed
the
bb/computer-use-perf
branch
from
July 23, 2026 05:52
87b9b37 to
12ad13d
Compare
Contributor
૮ >ﻌ< ა ci reviewran on cc1765d all good! |
# Conflicts: # hermes_cli/config.py # tools/computer_use/cua_backend.py
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
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
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
set_config(max_image_dimension)— configcomputer_use.max_image_dimension, default 1456 (the aux-vision downscale).0leaves the driver default.(provider, model)so captures stop re-loading config every call.computer_use.capture_after_mode(defaultsom, i.e. no behavior change) so users who want raw speed can dropcapture_afterfollow-ups toax(elements only, no PNG) orvision.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 passedget_window_state/SOM captures return the capped image dimensioncomputer_use.capture_after_mode: axreturns element text with no follow-up screenshot