anomalyco / anomalyco/opencode

Cloudflare Workers AI models fail on the first message

Open
#46,481 1 comment 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Aug 31, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Cloudflare Workers AI models can fail on the first message in two ways. Models that report output == context trigger ContextOverflowError before a request is sent because almost the whole context is reserved for output. Models that reach Workers AI can receive HTTP 400 System message must be at the beginning when a system transform produces multiple system messages.

Plugins

Reproduces when a system transform splits the system prompt.

OpenCode version

1.18.25

Steps to reproduce
  1. Authenticate cloudflare-workers-ai and set CLOUDFLARE_ACCOUNT_ID.
  2. Select a Workers AI model such as @cf/qwen/qwen2.5-coder-32b-instruct or @cf/qwen/qwen3.8-27b.
  3. Send the first message.
Screenshot and/or share link

N/A

Operating System

Windows 11

Terminal

Windows Terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.