fix(computer-use): add set_value to ComputerUseBackend ABC and _NoopBackend stub (#22748) - #30270
Merged
Merged
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.
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-attribute |
1 |
First entries
tools/computer_use/tool.py:400: [unresolved-attribute] unresolved-attribute: Object of type `ComputerUseBackend` has no attribute `set_value`
Unchanged: 4763 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
This was referenced May 22, 2026
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.
Salvages #22748 onto current main. Closes a contract gap on the
ComputerUseBackendABC.The problem
_dispatch()intools/computer_use/tool.pyalready routesset_valuetobackend.set_value(...), butset_valuewas never declared on theComputerUseBackendABC and was missing from the_NoopBackendtest stub.Consequences:
set_valuepass subclass validation silently — Python's ABC enforcement only fires when a method is declared@abstractmethod.set_valueraisesAttributeErroron_NoopBackendwith no useful diagnostic.The fix
tools/computer_use/backend.py—set_valuedeclared as@abstractmethod. Concrete backends missing the impl nowTypeErrorat construction time, exactly like every other action verb.tools/computer_use/tool.py—_NoopBackend.set_valuerecords the call for test inspection (same shape as the other stub methods).tests/tools/test_computer_use.py—test_set_value_routes_to_backendverifies dispatch carries the args;test_set_value_missing_value_returns_errorverifies missingvaluereturns an error dict without raising.Validation
tests/tools/test_computer_use.py— 72/72 passing (70 baseline + 2 new from this PR).fabianoeq@gmail.com → rodrigoeqnittoscripts/release.pyAUTHOR_MAP (separate follow-up commit).Credit @rodrigoeqnit (PR #22748).
Closes #22748.
Infographic