OpenCode
OpenCode errors and fixes
17 OpenCode error messages, quoted verbatim, each with what it means, why it happens and the fix documented in official docs, maintainer replies or release notes. Verified .
All OpenCode errors
- Status: Fixed in release7 fixed in release
- Status: Workaround7 workaround
- Status: By design3 by design
ProviderModelNotFoundErrorOpenCode could not resolve the model you referenced to a provider and model it knows about. The official troubleshooting docs say that if you see this error, you have most likely referenced a model incorrectly somewhere.Status: By designProviderInitErrorA provider failed to initialize. The official docs say this usually means your configuration is invalid or corrupted.Status: WorkaroundAI_APICallErrorA request to the model provider's API failed. The official docs say this can happen when cached provider packages are out of date. OpenCode installs provider packages (OpenAI, Anthropic, Google, etc.) as it needs them and caches them locally.Status: WorkaroundThis credential is only authorized for use with Claude Code and cannot be used for other API requests.Anthropic rejected a Claude Pro/Max subscription credential because it was used outside Claude Code. OpenCode's providers docs say plugins exist that let you use Claude Pro/Max models with OpenCode, and that "Anthropic explicitly prohibits this."Status: By designAI_APICallError: messages.13: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01CfJCsh21fK1pAXsXWYJYBA, toolu_01NoqnwsaxoK3AYM2FyrxmjN. Each `tool_use` block must have a corresponding `tool_result` block in the next message.The session history sent to an Anthropic model contains a tool call with no matching tool result, so the API rejects every later request in that session.Status: Fixed in releasemessages.3.content.0.type: Expected `thinking` or `redacted_thinking`, but found `tool_use`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`.With extended thinking enabled, Anthropic requires the previous assistant turn to start with its thinking block. The request OpenCode sent did not include that block.Status: WorkaroundError: Unexpected error, check log file at [user-home]/.local/share/opencode/log/2025-08-26T215857.log for more detailsA generic fatal error wrapper. The real cause is written to the log file named in the message. Examples from issues include an EACCES permission error (#2267) and ProviderModelNotFoundError (#916).Status: WorkaroundAI_RetryError: Failed after 4 attempts. Last error: Too Many RequestsOpenCode retried a request that the provider kept rejecting and gave up after the last attempt. A maintainer: "The retry message you see is taken directly from the response from the server". A Bedrock variant reads "AI_RetryError: Failed after 3 attempts, Last error: undefined: Too many tokens, please wait before trying again." (#545).Status: Workaroundundefined: The provided model identifier is invalid.Amazon Bedrock rejected the model ID OpenCode sent. In #11037 the request URL showed `us.us.anthropic.claude-sonnet-4-5-20250929-v1:0`, with the region prefix added twice.Status: Fixed in releaseFailed to send messageThe TUI showed this on every prompt and slash commands did nothing. It was reported on Windows (0.15.0 via scoop).Status: Fixed in releaseUnable to connect. Is the computer able to access the url?A network request made by OpenCode failed to connect. Reports include the Ollama provider (#5344) and offline or intranet installs (#9788, #12083).Status: WorkaroundCPU lacks AVX support. Please consider upgrading to a newer CPU. panic(main thread): Illegal instruction at address 0x4001FB4 oh no: Bun has crashed. This indicates a bug in Bun, not your code.The Bun runtime bundled in the OpenCode binary used CPU instructions (AVX) that older CPUs lack, so OpenCode crashed on start. This happened even with the baseline build.Status: Fixed in releaseFailed to initialize OpenTUI render library: Failed to open library "/home/user/.tmp/.fbff6fbdefbf7f55-00000001.so": /lib64/libm.so.6: version `GLIBC_2.29' not foundThe TUI render library (OpenTUI) shipped in v1.14.49 required glibc 2.29 or newer, so the TUI would not start on older Linux distributions.Status: Fixed in releaseError: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()The connection to the model provider dropped during a request. A maintainer: "This issue is from the provider dropping connection".Status: Fixed in releaseAI_APICallError: model gpt-5-codex is not accessible via the /chat/completions endpointGitHub Copilot refused the gpt-5-codex model on the /chat/completions endpoint, which OpenCode used for Copilot at the time.Status: Fixed in releaseConfigInvalidError Config file at C:\Users\Usuario\opencode.json is invalid ↳ Unrecognized keys: "name", "description", "rules", "context", "notes"opencode.json failed schema validation. The error lists the keys OpenCode does not recognize.Status: By designConnection FailedOpenCode Desktop could not reach its OpenCode server. Desktop runs a local server (the `opencode-cli` sidecar) by default, or connects to a server URL you configured. The docs cover this dialog and an app stuck on the splash screen.Status: Workaround
New to OpenCode? Start with OpenCode in the tools directory.
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.