You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web UI infinite response loop with custom openai-compatible provider (NVIDIA NIM) #37855
Web UI (opencode web) enters an infinite response loop for a simple, non-tool-call chat message. The same short reply gets regenerated repeatedly (5+ times) instead of stopping after the first finish_reason: "stop". This does not happen in the CLI/TUI (opencode command) — only in opencode web.
Provider: Custom @ai-sdk/openai-compatible provider pointing to NVIDIA NIM (https://integrate.api.nvidia.com/v1)
Models tested: z-ai/glm-5.2, deepseek-ai/deepseek-v4-pro, minimaxai/minimax-m3, nvidia/nemotron-3-ultra-550b-a55b — all affected
Started with: opencode web --port 4096 --hostname 0.0.0.0
Steps to Reproduce
Configure a custom openai-compatible provider in opencode.json pointing to NVIDIA NIM
Run opencode web --port 4096 --hostname 0.0.0.0
Open the web UI via forwarded port in browser
Send a simple message (e.g. "chào" / "hi")
Observe: the same short reply is generated repeatedly, without stopping
Expected Behavior
Model should respond once and stop, respecting finish_reason: "stop" — exactly as it does in CLI/TUI mode with the same provider/model/config.
Actual Behavior
Same or near-identical short reply keeps regenerating in a loop until manually interrupted.
Verification / Isolation Steps Taken
Called the NVIDIA API directly via curl with the same model/payload — got a single clean response with "finish_reason":"stop", HTTP 200. Confirms the issue is not on the provider/API side.
Ran the identical prompt/model through CLI (opencode in terminal, not opencode web) — worked correctly, single response, no loop.
Reproducible across multiple different models on the same custom provider, suggesting the bug is in opencode web's session/stream handling, not model-specific.
Activity
fix(llm): prevent infinite loop when finish_reason missing in stream
github-actions commentedon Sep 19, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.