anomalyco / anomalyco/opencode
Opencode V2. Provider request failed with HTTP 400 when using vertex AI Anthropic models
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
With V2, I cannot use Vertex AI Anthropic models, the request fails with 400 http code. The same configuration and environment works fine with V1.
The following error trace is recorded at ~/.local/share/opencode/log/opencode.log:
timestamp=2026-09-20T00:52:24.520Z level=ERROR run=24cf9740 message="Failed to drain Session" cause="AI.Error: Provider request failed with HTTP 400\n at zF (/$bunfs/root/chunk-e3c5fy3f.js:17:3539)\n at <anonymous> (/$bunfs/root/chunk-e3c5fy3f.js:17:32
32)\n at SessionStep.attempt (/$bunfs/root/chunk-w6191acq.js:366:3584)\n at SessionStep.attempt (definition) (/$bunfs/root/chunk-w6191acq.js:351:10764)\n at SessionRunner.runStep (/$bunfs/root/chunk-w6191acq.js:366:2624)\n at SessionRunner.runSte
p (definition) (/$bunfs/root/chunk-w6191acq.js:366:2774)\n at SessionRunner.drain (/$bunfs/root/chunk-71mat7h1.js:24:2279)\n at SessionRunner.drain (definition) (/$bunfs/root/chunk-w6191acq.js:366:352)\n at ServerProcess.start (/$bunfs/root/chunk-fn
k4cbc1.js:2:6383)\n at ServerProcess.start (definition) (/$bunfs/root/chunk-w6191acq.js:437:22432) {\n [cause]: AI.Error.InvalidRequest: Provider request failed with HTTP 400\n at ba (/$bunfs/root/chunk-e3c5fy3f.js:17:1117)\n at zF (/$bunfs/roo
t/chunk-e3c5fy3f.js:17:3550)\n at <anonymous> (/$bunfs/root/chunk-e3c5fy3f.js:17:3232)\n}" role=server sessionID=ses_f43b336fdffeavWqXLMZZfhGBR
Plugins
No response
OpenCode version
v2.0.10
Steps to reproduce
Use an Vertex AI Anthropic model and ask something
Screenshot and/or share link
No response
Operating System
Linux Fedora 44
Terminal
Wezterm
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with a Vertex AI Anthropic model on OpenCode v2.0.10 using the configuration that works with V1, then inspect the provider request path and compare the resulting requests. Done means the same Vertex AI Anthropic request succeeds under V2 without the HTTP 400 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, typescript
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100