anomalyco / anomalyco/opencode

V2 /api/generate returns 503 while standalone succeeds

Open
#47,809 0 comments 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Sep 7, 2026.

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

Description

Summary

The experimental V2 sessionless POST /api/generate operation returns HTTP 503 for models that complete through opencode2 run --standalone in the same isolated environment.

Versions tested

  • opencode2 v0.0.0-beta-18387
  • opencode2 v0.0.0-beta-19242
  • Linux x86_64

Minimal reproduction

Start the app-owned server with an isolated XDG home/config/data/state/database and autoupdate disabled:

export OPENCODE_PASSWORD="$(openssl rand -hex 32)"
opencode2 serve --stdio --hostname 127.0.0.1 --port 0 --log-level none

Using the announced loopback URL, submit a harmless canary with Basic authentication:

curl --user "opencode:$OPENCODE_PASSWORD" \
  --header 'content-type: application/json' \
  --data '{"prompt":"Return one short greeting.","model":{"providerID":"opencode","id":"nemotron-3-ultra-free"}}' \
  "$OPENCODE_URL/api/generate"

Observed: HTTP 503. On beta-18387 the same occurred with opencode/big-pickle. Beta-19242 required its current base model/plugin initialization before reaching the same 503 result.

Control using the same harmless canary and isolated environment:

printf '%s' 'Return one short greeting.' |
  opencode2 run --standalone \
    --model opencode/nemotron-3-ultra-free \
    --format json \
    --log-level none

Observed: generation completes successfully on both tested builds.

Expected

POST /api/generate should generate successfully when the same explicit model and environment succeed through run --standalone, or return a stable diagnostic that identifies the missing initialization/contract requirement.

No credentials, prompts beyond the harmless canary, response bodies, or user content are included in this report.

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.