Repository navigation
feat(providers/anthropic): support the computer_toolset_20260801 computer use toolset - #80
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ibetitsmike
added a commit
to coder/coder
that referenced
this pull request
Oct 29, 2026
Claude 5.5 models accept computer use only through the GA toolset computer_toolset_20260801, so computer use subagents on those models failed on their first request. Bump the coder/fantasy pin to coder/fantasy#80 and pick the Anthropic tool version from the chat's model. For the toolset, follow its batch contract: actions answer with text, the last computer call of a step attaches a screenshot, cursor_position returns the position, key honors repeat, and zoom stays disabled. For every Anthropic version, run a step's computer calls serially, skip the rest of a step after a failed call, and read wait and hold_key durations as seconds.
ethanndickson
added a commit
to coder/coder
that referenced
this pull request
Nov 2, 2026
…#31521) > Xum acted for Mike: this PR was written and opened by an AI agent on Mike's behalf. Computer use subagents on Claude 5.5 models (`claude-opus-5-5`, `claude-sonnet-5-5`) failed on their first request: these models reject `computer_20251124` and accept only the GA toolset `computer_toolset_20260801`. chatd now picks the Anthropic computer use tool version from the chat's model with `ComputerUseToolVersionForModel` from coder/fantasy: the toolset for Claude 4.8 and later, `computer_20251124` for Opus 4.5 to 4.7, Sonnet 4.6 and model IDs it cannot parse, and `computer_20250124` for Haiku and Sonnet 4.5. Claude Platform on AWS and Amazon Bedrock offer computer use only through the earlier versions, so an Anthropic provider configured for either declares `computer_20251124` where the model would take the toolset. For the toolset, chatd answers like Anthropic's SDK tool runner: actions answer with text and only `screenshot` returns an image, `cursor_position` returns the position as text, `key` honors `repeat` (1 to 100), and zoom is declared disabled because the agent desktop has no zoom action. The earlier versions still answer every action with a screenshot. A step's computer calls run one at a time in call order. For every Anthropic version, the calls after one that failed, or that was rejected before it ran (malformed input or a pre_tool_use hook denial), return `Not executed: an earlier computer action in this turn failed.` without running, which is the SDK runner's text. The chat loop enforces this halt, so the computer tool keeps no state between calls. `wait` and `hold_key` durations are read as seconds (capped at 300). The frontend marks Claude Opus 5.5 and Sonnet 5.5 as verified for computer use, and the computer tool row now labels each action ("Left click", "Type", "Press key") instead of "Screenshot", shows text output, and shows the error of failed or halted calls inline. The error block is shared with the write_file and edit_files rows as `ToolCall.ErrorDetail`. Uses coder/fantasy#80 and coder/fantasy#82, both merged. `go.mod` pins the fork to `7882f906a89a`. <details> <summary>UAT</summary> TL;DR: it works. A remote Coder Agents UAT on dogfood passed on `00143d5b12`, with all model traffic logged through a proxy: - `claude-opus-5-5`, `claude-sonnet-5-5` and `claude-opus-4-8` declared `computer_toolset_20260801` with zoom disabled and no beta header. `claude-opus-4-6` and an unknown model ID declared `computer_20251124` with the `computer-use-2025-11-24` beta, `claude-haiku-4-5` declared `computer_20250124`, and a Claude Platform on AWS provider declared `computer_20251124`. Opus 5.5, Sonnet 5.5, Opus 4.6 and Haiku 4.5 each completed a desktop task. - Toolset actions answered with text and only `screenshot` returned an image. `repeat` 100 ran, 150 failed, and `wait` 400 stopped at 300 seconds. - A failed call (`repeat` 150 on the toolset, a desktop error on 4.6) and a pre_tool_use hook denial each halted the rest of the step without touching the desktop. The next step ran normally. - The computer tool rows showed action labels, text output and the halt error. Opus 5.5 and Sonnet 5.5 showed no warning in the computer use model selector. Switching a chat between 4.6 and 5.5 worked in both directions. Not tested: the tool type on Bedrock, and a halt after malformed model input. Known, unchanged behavior: the desktop reports success for unknown key names and off-screen coordinates, the model can still emit `zoom`, which fails, and `scroll` up fails in `agent/x/agentdesktop` because the negative amount is read as a flag. Both failures halt the rest of their batch. </details> --------- Co-authored-by: Ethan Dickson <ethanndickson@gmail.com>
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
Claude 5.5 and later models on the Claude API accept computer use only through the generally available
computer_toolset_20260801toolset. Sendingcomputer_20251124fails with'claude-opus-5-5' does not support tool types: computer_20251124.Change
ComputerUseToolset20260801is a newComputerUseToolVersion. Callers keep the existing contract: a tool call namedcomputerwith a{"action": ..., ...}input. The provider maps that to and from the toolset wire format.{"type":"computer_toolset_20260801"}, plusconfigs.zoom.enabledwhenEnableZoomis set andcache_controlwhen set. Nonameor display fields, which the API rejects. No beta header and nobeta=truequery.tool_useblock with"toolset_name": "computer"is reported as toolcomputerwith input = member input plus"action": <member name>. Batches (several members in one response) come out as separate calls in order. In Stream, member deltas are not forwarded raw; the merged input is emitted once as a single delta at block close, so deltas, end, and the tool call agree.openToolBlockindex-drift handling is unchanged.computertool_use is replayed as{name: <action>, input: <input minus action>, toolset_name: "computer"}, and every matching tool_result getstoolset_name: "computer". A call with no stringactionis replayed as thescreenshotmember (it takes no input), so tool_use and tool_result stay paired, and a CallWarning is emitted. Withcomputer_20251124,computer_20250124, or no computer tool, replay is byte-for-byte unchanged.ComputerUseToolVersionForModel(modelID)returns the version the Claude API accepts: Claude 4.8 and later (all 5.x) get the toolset; Opus 4.5 to 4.7 and Sonnet 4.6 getcomputer_20251124; Sonnet 4.5, Haiku 4.5, and older getcomputer_20250124. IDs without a parseable version (for exampleclaude-mythos-preview) get the toolset. Bedrock does not offer the toolset, so this mapping is for the Claude API only.ComputerUseInputgainsRepeatfor the toolsetkeymember.Tests
New
computer_toolset_test.gocovers the version table (real IDs, including Vertex@date,anthropic/andus.anthropic.prefixes), the tool JSON and no beta flag, Generate mapping with no beta header or query, a Stream batch of two members next to a regular tool, and the exact replayed request JSON for the toolset, the missing-action fallback, and unchangedcomputer_20251124replay. I mutated each behavior and confirmed the matching test fails.go build ./...,go vet ./providers/anthropic/...,go test ./... -count=1,go test -race ./providers/anthropic/,gofumpt -l, andgolangci-lint run ./providers/anthropic/...pass.