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
Long-running shell commands (e.g. Gradle build) hang even after “BUILD SUCCESSFUL” #25038
Describe the bug
When executing a long-running shell command (e.g., an Android Gradle build), the process frequently hangs even after the command has completed successfully. The output clearly shows BUILD SUCCESSFUL, yet the task remains stuck and never returns control. It stays in this state for a long time until I manually pause the execution and ask the model to continue.
To Reproduce
Issue a time-consuming shell command, such as ./gradlew assembleDebug.
Wait for the build to finish normally.
Observe that the final output confirms success, but the process does not exit – it just hangs.
Expected behavior
Once the shell command finishes, the process should exit immediately and control should be returned to the conversation so that the workflow can proceed without manual intervention.
Environment:
opencode version: v1.14.30
OS: Windows 11
Shell: powershell
Command type: long-running build tasks (Android Gradle, but likely reproducible with other long commands)
Additional context
This happens very consistently with time-consuming shell commands and severely interrupts the flow, requiring a manual pause every time. It is not specific to a single project or build command.
Plugins
No response
OpenCode version
v1.14.30
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Reacted by Filipoliko, lukasPan, tadeas17, crysadrak, Markus Hütter, jamhour1g, Gabriel Patzleiner, Relentless, Jarosław Dakowicz and Tomáš Hůla
The OS and Shell fields in the description still contain unfilled placeholder text ([please fill in, e.g. macOS 14 / Ubuntu 22.04] and [e.g. zsh, bash]). Please replace these with your actual OS and shell information.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
Thanks for updating the issue! It now includes all the required information — a clear description, reproduction steps, expected behavior, and environment details. Everything looks good.
Possibly fixed by #29831. The Gradle daemon inherits the build's stdout/stderr pipe, so when gradlew exits after "BUILD SUCCESSFUL" the shell tool was waiting on close (all stdio closed), which never fires while the daemon holds the pipe. #29831 resolves completion on exit instead. If you can run against that branch, please confirm whether ./gradlew assembleDebug now returns promptly on Windows.
I am experiencing the same issue on Windows, but it is not limited to Gradle or long-running commands.
I have intermittently seen the shell tool remain in the running state after apparently completed commands including:
.\gradlew.bat assembleDebug, after either BUILD SUCCESSFUL or BUILD FAILED
git status
git diff
rg
PowerShell Get-Content
In each case, the expected output appears to be complete, but OpenCode does not continue to the next agent step until I manually interrupt it. Re-running the same command often completes normally, so the issue appears intermittent.
The short commands are especially notable because git status, rg, and ordinary Get-Content calls normally terminate immediately and do not leave persistent daemon processes.
Environment:
OpenCode: [VERSION]
OS: Windows 11 [BUILD IF AVAILABLE]
Shell: PowerShell [VERSION]
Terminal: [WINDOWS TERMINAL / OTHER]
Installation method: [NPM / BUN / SCOOP / OTHER]
I saw that #29831 changes process completion from close to exit. I am reporting these additional command types because this may be broader than Gradle descendants retaining stdout/stderr handles. I can test the PR branch or provide debug logs and process-tree information if that would help.
Activity
github-actions commentedon Apr 30, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[please fill in, e.g. macOS 14 / Ubuntu 22.04]and[e.g. zsh, bash]). Please replace these with your actual OS and shell information.Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Apr 30, 2026
Thanks for updating the issue! It now includes all the required information — a clear description, reproduction steps, expected behavior, and environment details. Everything looks good.
SkipXS commentedon May 4, 2026
I have the same issue in 1.14.33.
Windows 11 Pro
PowerShell 7.6.1
Git for Windows MSYS tools
If you need a log or something I'd be happy to provide whats needed.
gnahz77 commentedon May 14, 2026
I encountered the same issue, and it doesn't only occur in opencode.
Some related information I found: Troubleshooting "Too long with no output" on Windows with gradlew.bat
Besides terminating opencode, there is a temporary workaround for this problem: kill the Java process in Task Manager
GotKiCry commentedon May 21, 2026
Same issue. Pressing Esc to stop and ask something else still continue run .\gradlew.bat assembleDebug task
gnahz77 commentedon May 21, 2026
I fixed this in WSL by changing opencode to use the command
cmd.exe /d /s /c ".\\gradlew :app:assembleDebug".Maybe this would work on Windows too?
Hona commentedon May 29, 2026
Possibly fixed by #29831. The Gradle daemon inherits the build's stdout/stderr pipe, so when
gradlewexits after "BUILD SUCCESSFUL" the shell tool was waiting onclose(all stdio closed), which never fires while the daemon holds the pipe. #29831 resolves completion onexitinstead. If you can run against that branch, please confirm whether./gradlew assembleDebugnow returns promptly on Windows.SkipXS commentedon May 31, 2026
I can confirm this works on Windows too until the fix is merged. Thank you 👍
jamhour1g commentedon May 31, 2026
This needs to be fixed ASAP because it's unbearable to keep manually ending the task in Task Manager or interrupting the Agent.
jamhour1g commentedon Jun 10, 2026
@kitlangton Could you provide any updates on this issue? It completely ruined OpenCode for me, and I had to switch to a different harness.
futureisAJASU commentedon Jul 24, 2026
I am experiencing the same issue on Windows, but it is not limited to Gradle or long-running commands.
I have intermittently seen the shell tool remain in the running state after apparently completed commands including:
.\gradlew.bat assembleDebug, after eitherBUILD SUCCESSFULorBUILD FAILEDgit statusgit diffrgGet-ContentIn each case, the expected output appears to be complete, but OpenCode does not continue to the next agent step until I manually interrupt it. Re-running the same command often completes normally, so the issue appears intermittent.
The short commands are especially notable because
git status,rg, and ordinaryGet-Contentcalls normally terminate immediately and do not leave persistent daemon processes.Environment:
[VERSION][BUILD IF AVAILABLE][VERSION][WINDOWS TERMINAL / OTHER][NPM / BUN / SCOOP / OTHER]I saw that #29831 changes process completion from
closetoexit. I am reporting these additional command types because this may be broader than Gradle descendants retaining stdout/stderr handles. I can test the PR branch or provide debug logs and process-tree information if that would help.zhuzhutai commentedon Aug 11, 2026
opencode 1.18.16 ,This bug still isn't fixed
SMFDrummer commentedon Aug 26, 2026
opencode 1.18.23 ,This bug still isn't fixed