Commit 6aa9d45
Fix key mapping in Anthropic CUA Client (#1374)
# why
Anthropic agents in CUA mode are unable to issue key presses (not to be
confused with `type` actions)
# what changed
The format for the anthropic tool `computer_20250124` replies with:
```ts
{
"action":"key",
"text":"BackSpace"
}
```
wasn't properly mapped to our internal action abstraction: `keypress`,
which accepts parameter `keys`. It was issued directly from the
anthropic format. Updated `AnthropicCUAClient.ts` to account for this
and map appropriately
# test plan
- [x] Tested on sample eval
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes key action mapping in Anthropic CUA so agents can send key presses
(e.g., Backspace) correctly instead of failing on the "key" action.
- **Bug Fixes**
- Map Anthropic "key" to internal "keypress" and pass keys from
input.text.
- Remove the old "key" path and Playwright key mapping to avoid
mismatches.
<sup>Written for commit b9716b9.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by: Sean McGuire <75873287+seanmcguire12@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>1 parent 13c66dc commit 6aa9d45
File tree
2 files changed
+7
-12
lines changed- .changeset
- packages/core/lib/v3/agent
2 files changed
+7
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
772 | 771 | | |
773 | 772 | | |
774 | 773 | | |
775 | | - | |
| 774 | + | |
776 | 775 | | |
777 | 776 | | |
778 | | - | |
| 777 | + | |
779 | 778 | | |
780 | 779 | | |
781 | 780 | | |
| |||
865 | 864 | | |
866 | 865 | | |
867 | 866 | | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | 867 | | |
878 | 868 | | |
879 | 869 | | |
| |||
0 commit comments