Skip to content

feat: use the Anthropic computer use toolset for Claude 4.8 and later - #31521

Merged
ethanndickson merged 10 commits into
mainfrom
mike/anthropic-computer-toolset
Nov 2, 2026
Merged

ethanndickson merged 10 commits into
mainfrom
mike/anthropic-computer-toolset

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Xum acted for Mike: this PR was written and opened by an AI agent on Mike's behalf.

Relates to CODAGT-1524

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.

UAT

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.

@ibetitsmike

ibetitsmike commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

@codex review

Xum posted this comment on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T07:10:56.412297Z c98826e Manual request
🔒 Security Review ✅ Completed 2026-11-02T07:08:54.147154Z c98826e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 5c4124e7cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.
…erified for computer use

Claude Opus 5.5 and Sonnet 5.5 now work with computer use through the
Anthropic computer use toolset, so the settings page no longer warns
that they are unverified.
…omputer actions and show their results

Computer toolset members that are not the last in a batch return text,
which persists as {"output": ...}, and failed or halted members persist
as {"error": ...}. The computer tool row labeled every call
"Screenshot" and read only .text, so these rows showed no content and a
generic "Failed to take screenshot" error.
…mputer action errors inline

Render a failed or halted computer call's error in the row body instead
of only in the status tooltip, reuse humanizeMCPToolName for the label,
and read args with parseArgs like the other renderers.
…are the tool error detail block

The computer, write_file and edit_files rows each copied the same error
<pre>. Move it to ToolCall.ErrorDetail and wrap at word boundaries, since
these messages are prose. Label the computer key action "Press key" and
name ComputerTool's props type.
@ibetitsmike
ibetitsmike force-pushed the mike/anthropic-computer-toolset branch from 2b8bffd to 504999c Compare October 29, 2026 22:11
@ibetitsmike
ibetitsmike marked this pull request as ready for review October 30, 2026 09:13
@ibetitsmike
ibetitsmike requested a review from a team as a code owner October 30, 2026 09:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 504999ce8d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/chattool/computeruse.go Resolved
Comment thread coderd/x/chatd/chattool/computeruse.go Resolved
Comment thread coderd/x/chatd/chattool/computeruse.go Resolved
Comment thread coderd/x/chatd/chattool/computeruse.go Resolved
… batches after rejected calls

Claude Platform on AWS and Amazon Bedrock offer computer use only through
the earlier tool versions, so an Anthropic provider configured with either
now declares computer_20251124 to models that take the toolset on the Claude
API.

A computer call rejected before it runs, for malformed input or by a
pre_tool_use hook, now halts the later computer calls of its batch, and the
last call that runs takes the batch screenshot. The chat loop reports
rejected calls to the computer tool as errored step results, and the
execute decision observes calls answered at hook admission so the hook path
reports them too.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Xum posted this comment on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 0cdb545913

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…-end screenshot

Match the Anthropic SDK tool runners: the chat loop, not the computer
tool, stops the later computer calls of a step after one fails or is
rejected before it runs. Halted calls get an error result and are not
billed. The computer tool keeps no per-step state.

With computer_toolset_20260801, every action except screenshot answers
with text, and no screenshot follows the last call of a batch. The model
asks for a screenshot when it needs one. Older versions still screenshot
after every action.

Bump the fantasy replace to 7882f906a89a (coder/fantasy#82).
@ethanndickson

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: e576e2dbbf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ethanndickson

Copy link
Copy Markdown
Member

@codex security review

main deleted toolBatch.resolve with the close_agent alias (#31005), so the merge with main did not compile.
@ethanndickson ethanndickson changed the title feat: use the Anthropic computer use toolset for Claude 5.5+ feat: use the Anthropic computer use toolset for Claude 4.8 and later Nov 2, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: e576e2dbbf

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ethanndickson

Copy link
Copy Markdown
Member

@codex review

@ethanndickson

Copy link
Copy Markdown
Member

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: c98826e271

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: c98826e271

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ethanndickson
ethanndickson merged commit b6dc715 into main Nov 2, 2026
32 of 33 checks passed
@ethanndickson
ethanndickson deleted the mike/anthropic-computer-toolset branch November 2, 2026 10:28
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants