Repository navigation
Description
Description
Problem Description:
When using the write tool to create a new file, the client (IntelliJ IDEA) hangs indefinitely in the chat interface with a "waiting" indicator. The file is actually created successfully on disk, but the client never receives a completion signal. Manually clicking the "stop" button immediately reveals the created file.
In contrast, using the edit tool to modify an existing file or the bash tool to delete a file works perfectly – the client receives proper responses and the operation completes normally.
Environment:
- OpenCode version: v1.2.15 (binary
opencode-windows-x64.zip) - Client: IntelliJ IDEA using ACP protocol
- OS: Windows11 (as per log paths)
Root Cause Analysis:
The write tool implementation lacks the necessary RPC response logic. After successfully writing the file, it should send a tool_call_update with status set to completed (or failed if an error occurs). However, no such update is transmitted, causing the client to wait indefinitely for a completion signal.
The edit and bash tools correctly send completion updates, which explains why those operations work without hanging.
This issue is independent of network timeouts or client-side problems; it is purely a server-side (agent) implementation flaw in the write tool.
Plugins
OpenCode version
v1.2.15 (binary opencode-windows-x64.zip)
Steps to reproduce
Key Log Evidence (from acp-transport-memory.log)
-
writetool call that hangs (no completion)
2026-03-02 15:39:23,641 [2836043] FINE - AcpTransport - IN: {"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"ses_35283b57dffeWINHDUV6qYRQOw","update":{"sessionUpdate":"tool_call_update","toolCallId":"call_52f8706cb3434384a3905511","status":"in_progress","kind":"edit","title":"write","locations":[{"path":"D:\javaabel\Code\JavaCode\AI-DogV2\robot-platform\123.txt"}],"rawInput":{"content":"abc","filePath":"D:\javaabel\Code\JavaCode\AI-DogV2\robot-platform\123.txt"}}}}
... (no "completed" or "failed" update) ...
2026-03-02 15:39:51,262 [2863664] FINE - AcpTransport - IN: {"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"ses_35283b57dffeWINHDUV6qYRQOw","update":{"sessionUpdate":"tool_call_update","toolCallId":"call_52f8706cb3434384a3905511","status":"failed","kind":"edit","title":"write","rawInput":{"content":"abc","filePath":"D:\javaabel\Code\JavaCode\AI-DogV2\robot-platform\123.txt"},"content":[{"type":"content","content":{"type":"text","text":"Tool execution aborted"}}],"rawOutput":{"error":"Tool execution aborted"}}}}
Note: Thefailedstatus only appears after the client sent asession/cancelrequest. -
edittool call that completes normally
2026-03-02 15:40:26,715 [2899117] FINE - AcpTransport - IN: {"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"ses_35283b57dffeWINHDUV6qYRQOw","update":{"sessionUpdate":"tool_call_update","toolCallId":"call_47a04cc2904b43a8b63b5ccb","status":"in_progress","kind":"edit","title":"edit","locations":[{"path":"D:\javaabel\Code\JavaCode\AI-DogV2\robot-platform\123.txt"}],"rawInput":{"filePath":"D:\javaabel\Code\JavaCode\AI-DogV2\robot-platform\123.txt","edits":[{"op":"append","lines":"测试"}]}}}}
2026-03-02 15:40:26,747 [2899149] FINE - AcpTransport - IN: {"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"ses_35283b57dffeWINHDUV6qYRQOw","update":{"sessionUpdate":"tool_call_update","toolCallId":"call_47a04cc2904b43a8b63b5ccb","status":"completed","kind":"edit","content":[...]}}}
3. bash tool call that completes normally
2026-03-02 15:56:59,301 [3891703] FINE - AcpTransport - IN: {"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"ses_35279d2c4ffeMLMaiiDATnI363","update":{"sessionUpdate":"tool_call_update","toolCallId":"call_64ea5e96379b46b1854a2251","status":"in_progress","kind":"execute","title":"bash","locations":[],"rawInput":{"command":"rm "D:\javaabel\Code\JavaCode\AI-DogV2\robot-platform\abc.txt"","description":"删除abc.txt文件"}}}}
2026-03-02 15:56:59,611 [3892013] FINE - AcpTransport - IN: {"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"ses_35279d2c4ffeMLMaiiDATnI363","update":{"sessionUpdate":"tool_call_update","toolCallId":"call_64ea5e96379b46b1854a2251","status":"completed","kind":"execute","content":[...]}}}
Screenshot and/or share link
acp.json:
{
"agent_servers": {
"OpenCode": {
"command": "D:\javaabel\Develop\opencode\opencode.exe",
"args": ["acp"]
}
}
}
Operating System
windows 11
Terminal
No response
Activity
github-actions commentedon Mar 2, 2026
This issue might be a duplicate of existing issues. Please check:
minshiwu commentedon Mar 2, 2026
I also encountered this bug. As a result, the client UI hangs when the edit operation is performed and cannot be entered.
sashimi409 commentedon Mar 12, 2026
Also running into this. I am trying to use JetBrains IDEs and as soon as I hit a new file write, I am stopped and have to break my workflow.
fix: remove dead LSP clients to prevent unbounded memory growth
gzlo commentedon May 6, 2026
I'm hitting this same bug consistently on v1.14.39 (Linux, TUI mode, provider
opencode-go). Here's full forensic evidence from a live hung process — confirmed root cause is the missing RPC completion signal after tool calls complete.🔄 Reproduction
State: R (running)consuming ~66% CPU indefinitely🔬 Live Process Forensics (captured while hung)
Process state:
State: R (running)— pure CPU busy-loop, NOT I/O blockedCPU: 66% sustained on one core
read_bytes:0 — zero disk I/O, confirming it's a spin, not waitingThreads: 18 total, all sleeping in
futex_waitexcept main thread spinning in Bun JS runtimeGDB backtrace of main thread:
All 17 other threads blocked in
pthread_cond_timedwait(futex).Orphaned child process:
The prettier formatter finished in 49ms of user time but was never reaped because the parent's event loop never processed the exit signal.
📋 Exact Log Cutoff
The log file freezes at this exact line — nothing after:
No
message.completed, notool.completed, nosession.updated, no error. The bus published the edit result but the turn-completion event never arrives.⚙️ Configuration (sanitized)
🔗 Cross-referenced Issues
This appears to be a chain of interacting bugs:
status: completedRPC → root causetime.completed: undefinedleaves sessions in permanent "Thinking"timeoutfield is.optional()without.default()→ no failsafeopencode runalso hangs post-tool-call (same mechanism, different entry)🩹 Temporary Workaround
Disabling auto-formatting and switching to
"write": "ask"reduces the hit rate but doesn't eliminate it. The only reliable mitigation is an external watchdog that kills processes with stale logs + sustained high CPU.Happy to provide more detail or test patches.