Skip to content

fix(providers/anthropic): default unknown models to computer_20251124 - #82

Merged
ethanndickson merged 1 commit into
coder_2_33from
computer-use-unknown-model-default
Nov 2, 2026
Merged

ethanndickson merged 1 commit into
coder_2_33from
computer-use-unknown-model-default

Conversation

@ethanndickson

Copy link
Copy Markdown
Member

Relates to coder/coder#31521

#80 sends computer_toolset_20260801 to any model ID that ComputerUseToolVersionForModel can't parse, e.g. a custom alias for Opus 4.6. Models before 4.8 don't accept the toolset, so computer use breaks for those aliases, which work today since coder/coder currently sends computer_20251124 to every Claude model.

The harnesses I found that pick a version from the model ID (Anthropic's computer-use-demo, Cua, LiteLLM) all fall back to an older version for IDs they don't recognise, and fantasy already does the same for adaptive thinking. So, we'll just fall back to computer_20251124, and keep the toolset for claude-mythos-preview, which has no version in its ID and only accepts the toolset.

The catch is that an alias of a 5.5 model on the Claude API now gets computer_20251124 and fails, so it needs the real model ID.

Model IDs without a parseable Claude version now get computer_20251124 instead of the toolset, so aliases of models before 4.8 keep working. claude-mythos-preview keeps the toolset.
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-02T05:43:22.045190Z 493e37d Draft marked ready
ℹ️ 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. Keep them coming!

Reviewed commit: 493e37da61

ℹ️ 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 marked this pull request as ready for review November 2, 2026 05:41
@ethanndickson
ethanndickson merged commit 7882f90 into coder_2_33 Nov 2, 2026
7 checks passed
ethanndickson added a commit to coder/coder that referenced this pull request Nov 2, 2026
…-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 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant