hermes-agent/tools/computer_use
Rodrigo fbdca64f73 fix(computer-use): skip capture_after when action failed (ok=False)
_maybe_follow_capture() issued a follow-up screenshot unconditionally
when capture_after=True, even when res.ok=False. The model then received
a normal-looking screenshot alongside an error message, and in practice
it often ignored ok=False and proceeded as if the action had succeeded.

Fix: return _text_response(res) early when res.ok is False so the model
receives only the error and can decide how to recover.

Tests added:
- test_capture_after_skipped_when_action_failed: patches click to return
  ok=False and asserts no capture call is issued.
- test_capture_after_fires_when_action_succeeds: ensures the happy path
  still triggers the follow-up capture.
2026-05-22 01:19:01 -07:00
..
__init__.py feat(computer-use): cua-driver backend, universal any-model schema 2026-05-08 11:07:38 -07:00
backend.py fix(computer-use): add set_value to ComputerUseBackend ABC and _NoopBackend stub 2026-05-22 01:14:15 -07:00
cua_backend.py fix(computer-use): surface app=… filter no-match instead of silently using frontmost (#24170 bug 1) 2026-05-21 17:15:35 -07:00
schema.py fix(computer-use): address Copilot review on max_elements cap 2026-05-21 19:07:32 -07:00
tool.py fix(computer-use): skip capture_after when action failed (ok=False) 2026-05-22 01:19:01 -07:00
vision_routing.py fix(computer_use): add helper to decide capture vision routing 2026-05-21 17:38:19 -07:00