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
Bash tool hangs indefinitely when executing commands that launch daemon processes with continuous output #42524
When the agent executes a command that launches a daemon process (e.g., uvicorn, npm run dev, docker compose up) with continuous stdout/stderr output, the Bash tool hangs indefinitely and never returns. The agent gets stuck in a loading/spinning state, appearing to be in an infinite loop, even though the foreground command has completed.
The root cause appears to be that the Node.js child process close event only fires after all stdio streams are closed. Since daemon processes inherit the parent pipe and continuously write to stdout/stderr, these streams never close, causing OpenCode to wait forever.
This issue is reproducible with commands like:
uvicorn demo_server:app &
npm run dev & (for frameworks like Vite, Next.js)
docker compose up -d (may also trigger similar behavior if logs are being streamed)
Plugins
OmO — The Best Agent Harness
OpenCode version
1.18.9
Steps to reproduce
Run a command in the agent that starts a daemon process with continuous output, e.g.:
text
uvicorn demo_server:app &
Observe that the foreground command completes (the shell prompt returns).
The Bash tool in OpenCode does not complete and continues spinning indefinitely.
Activity
github-actions commentedon Aug 14, 2026
This issue might be a duplicate of existing issues. Please check:
Start-Processwith-RedirectStandardOutput/-RedirectStandardErroron Windows #37838: Bash tool hangs indefinitely when PowerShell usesStart-Processwith-RedirectStandardOutput/-RedirectStandardErroron WindowsIf your issue is different, please clarify what distinguishes it from the above.