anomalyco / anomalyco/opencode
bug: Hermes Agent — gpt-5.6-luna via opencode-go provider returns finish_reason:null (no [DONE])
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When using opencode-go as a provider in Hermes Agent, every gpt-5.6-luna response fails. The OpenCode Go gateway (https://opencode.ai/zen/go/v1/chat/completions) never sends a terminal finish_reason for this model — streamed or non-streamed: non-streaming returns "finish_reason":null on a complete response, and streaming ends with data: {"choices":[],"cost":"0"} and no [DONE] marker. Hermes requires a terminal event and retries, then errors with "Response remained truncated after 4 continuation attempts" — gpt-5.6-luna is unusable via this provider. All other Go models tested (deepseek-v4-flash, deepseek-v4-pro, kimi-k2.7-code, glm-5.2) return finish_reason: "stop" correctly. Related to but distinct from #36766 (truncated tool args on native OpenAI Responses) — this is the Go gateway omitting the terminal event.
Plugins
N/A — no OpenCode plugins. Consumer is Hermes Agent v0.19.1 (docker, Linux), which fails on every gpt-5.6-luna response.
OpenCode version
N/A — issue is against the hosted Go gateway endpoint, not a local OpenCode install.
Steps to reproduce
POST /chat/completions,model: gpt-5.6-luna,stream: false→ HTTP 200, content correct,choices[0].finish_reason: null- Same with
stream: true→ content chunk arrives withfinish_reason: null, then final chunk{"choices":[],"cost":"0"}— no[DONE] - Control (same calls,
deepseek-v4-flash/kimi-k2.7-code/glm-5.2/deepseek-v4-pro) →finish_reason: "stop"and a proper[DONE]chunk
Screenshot and/or share link
No UI screenshot applicable (API-level bug). Verbatim captures from a fresh repro run:
Non-streaming:
{"id":"gen-1785843293-273noTConb4mUERLVDI2","object":"chat.completion","created":1785843294,"model":"gpt-5.6-luna","choices":[{"index":0,"message":{"role":"assistant","content":"OK"},"finish_reason":null}],"usage":{"prompt_tokens":11,"completion_tokens":5,"total_tokens":16}}
Streaming (all data: lines):
data: {"id":"gen-...","object":"chat.completion.chunk","choices":[]}
data: {"id":"","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"OK"},"finish_reason":null}]}
data: {"id":"gen-...","choices":[],"usage":{"prompt_tokens":11,"completion_tokens":5,"total_tokens":16}}
data: {"choices":[],"cost":"0"}
Operating System
Linux (Docker container)
Terminal
N/A — no terminal UI involved. Reproduced with plain curl from a non-interactive container shell (TERM=dumb, no TTY).
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 with the OpenCode Go gateway's /chat/completions behavior for gpt-5.6-luna, using the curl reproduction and comparing it with the listed control models. Check both streaming and non-streaming responses; done means a terminal finish_reason is returned and streaming ends with [DONE], so Hermes no longer retries and reports truncation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100