-
Notifications
You must be signed in to change notification settings - Fork 14.7k
write tool causes client to hang indefinitely when creating a new file #15675
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