fix(computer-use): add set_value to ComputerUseBackend ABC and _NoopBackend stub - #22748
Closed
rodrigoeqnit wants to merge 1 commit into
Closed
rodrigoeqnit wants to merge 1 commit into
rodrigoeqnit wants to merge 1 commit into
Conversation
…ackend stub _dispatch() routes action="set_value" to backend.set_value(), but: - ComputerUseBackend did not declare set_value as @AbstractMethod, so subclasses could silently omit it without a TypeError at class load time. - _NoopBackend (the test/CI stub) had no set_value method at all, causing AttributeError in any test that exercises the set_value action path. Fix: - Add set_value as @AbstractMethod to ComputerUseBackend in backend.py. - Add a recording stub in _NoopBackend in tool.py. - Add two TestDispatch cases: one verifying the call reaches the backend, one verifying the missing-value guard returns a clean error.
rodrigoeqnit
force-pushed
the
fix/computer-use-noop-set-value
branch
from
May 10, 2026 14:33
e63dacb to
4a4b204
Compare
Contributor
Author
|
Rebased on current upstream/main (no conflicts). PR is ready for review. |
Contributor
Author
|
Hi maintainers — this PR has been open for 9 days without feedback. It makes |
Collaborator
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.
Problem
_dispatch()intool.pyalready routes theset_valueaction tobackend.set_value(...), butset_valuewas never declared as an@abstractmethodon theComputerUseBackendABC and was missing from_NoopBackend.This means:
set_valuepasses subclass validation silently.set_valueraisesAttributeErroron_NoopBackendwith no meaningful error message.Fix
tools/computer_use/backend.py— Addedset_valueas@abstractmethodtoComputerUseBackend.tools/computer_use/tool.py— Added a no-opset_valueto_NoopBackendthat records the call for test inspection.Tests
Two new test cases in
tests/tools/test_computer_use.py:test_set_value_routes_to_backend— verifies dispatch sends correct args.test_set_value_missing_value_returns_error— verifies missingvaluereturns error without raising.All 46 tests pass.
🤖 Generated with Claude Code