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] Task never stops — agent runs indefinitely when using opencode serve #26365
When using OpenCode via the web interface (opencode serve), tasks never stop. The agent enters an infinite loop and continues running indefinitely, even after the task appears to be completed. The TUI stops correctly — this issue only occurs in the web UI.
Steps to Reproduce
Start OpenCode: opencode serve
Open browser, access web UI via SSH port forwarding
Give the agent a coding task
Agent completes the task but never stops — keeps running in an endless loop
Expected Behavior
Agent should stop after completing the task.
Actual Behavior
Agent runs indefinitely. Web UI shows task as still active with no way to stop it. No error message, agent just keeps "thinking".
Environment
OpenCode Version: 1.14.29
Server OS: Linux (Ubuntu)
Browser: Chrome 148 on Windows 10
Access method: SSH port forwarding to opencode serve
Additional Context
The same task works correctly in TUI mode
Only happens in web UI mode
Wastes API credits as the agent keeps making calls in the loop
This makes the web UI unusable for any meaningful work
If your issue is distinct from these (e.g. specific to the browser-based web UI rather than opencode attach), please add clarifying details to help distinguish it.
Activity
github-actions commentedon May 8, 2026
This issue might be a duplicate of existing issues. Please check:
opencode serve+opencode attachif any permission is set to "ask" #16367: Agent hangs indefinitely when usingopencode serve— same symptom of the agent looping forever in web/headless mode, with TUI working fineopencode runhangs after completing tool calls — process never exits #17516:opencode runhangs after completing tool calls — agent never exits after finishing its workIf your issue is distinct from these (e.g. specific to the browser-based web UI rather than
opencode attach), please add clarifying details to help distinguish it.fix: prevent infinite agent loop in web/serve mode when model finishe…
github-actions commentedon Jul 9, 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.