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
Session hangs after file write tool execution with massive latency spike #4061
When models execute file write tool calls, the write operation completes successfully but control never returns to the session. The session hangs indefinitely.
Model Provider
This happened with big pickle and my llama.cpp server hosing gpt-oss-20b.
Log Highlight
INFO 2025-11-08T00:27:35 +89884ms service=default directory=/home/actellim/Projects/dll-experiment disposing instance
I manually killed it after ~1.5m with ctrl+c.
Expected Behavior
After file write completion, control should return to the session immediately for continued interaction.
Actual Behavior
Session hangs indefinitely after file write, requiring manual termination.
Additional Context
The file write operation itself succeeds (files are created/modified).
The issue appears to be in the post-write cleanup or response handling.
The massive ms timestamp suggests a timeout or deadlock in the cleanup process.
OpenCode version
1.0.39-1.0.44
Steps to reproduce
(I suspect this isn't a problem for everyone so I'm not sure what exactly is going sideways here).
Start an opencode session.
Request a model perform a file write operation.
Session hangs and never returns control to the user
All these issues describe similar symptoms: session hangs/freezes after tool execution with complete loss of control, requiring manual termination. The pattern suggests a systemic issue with tool execution cleanup/response handling.
Feel free to ignore if none of these address your specific case.
@actellim what kinda file is it? It may be a formatter or lsp?
I don't have any of those specifically enabled/disabled in my opencode.json. I've read the docs and will try disabling the .cpp lsp server and formatter and get back to you with results. It was working prior to ~1.0.39.
No worries. I disabled both the lsp and the formatter in the config and I'm back in business. Would like to fix, could this be an issue with the way I've got my system setup?
I've had a similar experience. The memory and CPU usage keep going up, and the UI becomes unresponsive. I'll try disabling the lsp, formatters, and some of my permission settings to see if I can find the culprit.
I've had a similar experience. The memory and CPU usage keep going up, and the UI becomes unresponsive. I'll try disabling the lsp, formatters, and some of my permission settings to see if I can find the culprit.
I have not experienced this issue in long sessions.
@rekram1-node , the context was under 200K, and the number of files I changed might have been a factor too. The agent was validating a lot of small data files.
I conducted additional testing and found that my issue seemed to be related to setting these permissions at the top level of my configuration.
"permission": {
"edit": "allow",
"bash": "ask"
},
When I used this configuration in the build mode, it prompted for permission frequently. Over time, this process became slow and almost unresponsive. I wonder if this is not a suitable use case for the permission system.
When I used this configuration in the build mode, it prompted for permission frequently. Over time, this process became slow and almost unresponsive. I wonder if this is not a suitable use case for the permission system.
I think im facing a similar issue, at the beginning it works fine but the more opencode asks for permissions (not even meant in a quantitive way e.g. 3 requests at once, it also happens with just one reqeust) the slower it gets.
Sometimes i hit deny or allow and ill just sit there for a minute wondering if i just hit the numpad enter again (that wont work) or its just hanging… which is pretty annoying, ive switched back to claude code for now as i dont trust these models at all with commands so i want to get asked reliably and it should work fast to approve or deny if possible.
Nonetheless i love this project and im greatful for every contributor and i cant wait to come back :)
Activity
github-actions commentedon Nov 8, 2025
This issue might be a duplicate of existing issues. Please check:
All these issues describe similar symptoms: session hangs/freezes after tool execution with complete loss of control, requiring manual termination. The pattern suggests a systemic issue with tool execution cleanup/response handling.
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Nov 8, 2025
@actellim what kinda file is it? It may be a formatter or lsp?
rekram1-node commentedon Nov 8, 2025
is it a .c/.cpp/.h or .py file
actellim commentedon Nov 8, 2025
It's a
.cppfile. The model successfully makes the edits, but control isn't returned. For the heck of it I sent a prompt after ~1.5m and it started going again, without any sort of feedback. I'm encoding the video of the session: https://github.com/user-attachments/assets/563f4e3a-a66e-405e-a98c-ea2f03b59e68actellim commentedon Nov 8, 2025
I don't have any of those specifically enabled/disabled in my
opencode.json. I've read the docs and will try disabling the.cpplsp server and formatter and get back to you with results. It was working prior to ~1.0.39.opencode.json
rekram1-node commentedon Nov 8, 2025
@actellim i feel like its the lsp try disabling clangd ( in ur config )and it may fix it
looks something like:
lsp:
“clangd”:
disabled: true
im typing on phone thats why it isnt json haha
actellim commentedon Nov 8, 2025
No worries. I disabled both the lsp and the formatter in the config and I'm back in business. Would like to fix, could this be an issue with the way I've got my system setup?
rekram1-node commentedon Nov 8, 2025
no i think its our fault ive heard someone have this before
we will address this over weekend
mschenk42 commentedon Nov 9, 2025
I've had a similar experience. The memory and CPU usage keep going up, and the UI becomes unresponsive. I'll try disabling the lsp, formatters, and some of my permission settings to see if I can find the culprit.
rekram1-node commentedon Nov 10, 2025
@mschenk42 that may be due to really long sessions?
The formatters shouldnt cause memory spikes
If u are on latest and this still happens we have some performance improvements shipping soon
actellim commentedon Nov 10, 2025
I have not experienced this issue in long sessions.
mschenk42 commentedon Nov 10, 2025
@rekram1-node , the context was under 200K, and the number of files I changed might have been a factor too. The agent was validating a lot of small data files.
mschenk42 commentedon Nov 19, 2025
I conducted additional testing and found that my issue seemed to be related to setting these permissions at the top level of my configuration.
When I used this configuration in the build mode, it prompted for permission frequently. Over time, this process became slow and almost unresponsive. I wonder if this is not a suitable use case for the permission system.
ojsef39 commentedon Dec 4, 2025
I think im facing a similar issue, at the beginning it works fine but the more opencode asks for permissions (not even meant in a quantitive way e.g. 3 requests at once, it also happens with just one reqeust) the slower it gets.
Sometimes i hit deny or allow and ill just sit there for a minute wondering if i just hit the numpad enter again (that wont work) or its just hanging… which is pretty annoying, ive switched back to claude code for now as i dont trust these models at all with commands so i want to get asked reliably and it should work fast to approve or deny if possible.
Nonetheless i love this project and im greatful for every contributor and i cant wait to come back :)
Loxia106 commentedon Jan 15, 2026
I have exactly same issue.
+add
The error fixed by re-installing all packages via bun. (previously npm)
github-actions commentedon Mar 26, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.