Closes
https://linear.app/codercom/issue/CODAGT-1525/allow-computer-use-with-claude-models-from-aws-bedrock-ai-providers
Computer use was only available on models from Anthropic and OpenAI AI
providers, as we decided support from the AI provider type alone, in
five separate places (spawn, turn setup, override validation, telemetry
and the settings UI). A Bedrock AI provider serves Claude models over
the Anthropic Messages API though, and chatd already routes those
through the Anthropic fantasy client, so there's no reason computer use
shouldn't work on them.
To fix, there's now a single rule,
`chatprovider.ComputerUseProvider(providerType, model)`, derived from
the client chatd builds for the model (`chatprovider.ClientProvider`,
previously `aibridgeClientProvider`). If the model uses the Anthropic
client, it gets the Anthropic computer use tool. The OpenAI tool is
still only offered on OpenAI AI providers, as I haven't tested it
against Bedrock Mantle, and I couldn't find anyone else doing it either.
All five places now call this function.
The UI can't re-derive Bedrock routing without duplicating the model ID
heuristic, so `ChatModel` gets a read-only `computer_use_provider` field
(`anthropic`, `openai`, or omitted when computer use isn't supported).
The computer use model override endpoint now accepts Bedrock Claude
models, and its 400 message has changed.
Whilst in here I also fixed a latent bug where the default model
credential check looked up the user's keys under the tool flavour
(`anthropic`) instead of the provider type (`bedrock`).
One caveat: on a Bedrock AI provider using InvokeModel, AI Gateway runs
the provider's configured model rather than the chat model, whilst we
pick the computer use tool version from the chat model ID. It's not
specific to computer use, and should go away with
[AIGOV-747](https://linear.app/codercom/issue/AIGOV-747/deprecate-the-bedrock-invokemodel-protocol-with-model-translation).
In the meantime, #30752 warns when an InvokeModel provider ignores the
chat model identifier.