Summary
ACP streaming sometimes drops the final tail of assistant output.
The run still finishes with stopReason: "end_turn", but the last chunk text is incomplete.
Steps to reproduce
- Start ACP bridge:
openclaw acp --verbose
- Send:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1}}
- Create session:
{"jsonrpc":"2.0","id":2,"method":"session/new","params":{"cwd":"/home/jaesbit/Work/openclaw-tests","mcpServers":[]}}
- Send long prompt with explicit end marker:
{"jsonrpc":"2.0","id":3,"method":"session/prompt","params":{"sessionId":"<SESSION_ID>","prompt":[{"type":"text","text":"Please write a long test message in English, around 25 lines, with a title, a numbered list, and a final closing marker: END-OF-LONG-TEST-OK."}]}}
- Inspect
session/update notifications and final id:3 response.
Expected behavior
Final streamed assistant text should be complete (including the full tail/end marker context) before end_turn.
Actual behavior
- Multiple
session/update events arrive with sessionUpdate: "agent_message_chunk".
- The final text chunk is truncated (tail missing).
- Then ACP returns:
{"jsonrpc":"2.0","id":3,"result":{"stopReason":"end_turn"}}
Environment
- Clawdbot version: OpenClaw CLI 2026.2.9 observed locally (
openclaw --version)
- OS: Linux (host environment)
- Install method (pnpm/npx/docker/etc): global npm install (
~/.npm-global/...)
Logs or screenshots
Raw ACP sample (redacted):
initialize succeeds with protocolVersion:1
session/new succeeds and returns sessionId
session/update emits several agent_message_chunk events
- Last chunk ends early (example tail:
...missing/c)
- Final response is still
stopReason:"end_turn"
Additional scope notes:
- Reproduced on node-connected path (paired node setup).
- In OpenClaw Web UI, full message is visible.
- Direct same-instance ACP→gateway path has not been tested yet.
Summary
ACP streaming sometimes drops the final tail of assistant output.
The run still finishes with
stopReason: "end_turn", but the last chunk text is incomplete.Steps to reproduce
openclaw acp --verbose{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1}}{"jsonrpc":"2.0","id":2,"method":"session/new","params":{"cwd":"/home/jaesbit/Work/openclaw-tests","mcpServers":[]}}{"jsonrpc":"2.0","id":3,"method":"session/prompt","params":{"sessionId":"<SESSION_ID>","prompt":[{"type":"text","text":"Please write a long test message in English, around 25 lines, with a title, a numbered list, and a final closing marker: END-OF-LONG-TEST-OK."}]}}session/updatenotifications and finalid:3response.Expected behavior
Final streamed assistant text should be complete (including the full tail/end marker context) before
end_turn.Actual behavior
session/updateevents arrive withsessionUpdate: "agent_message_chunk".{"jsonrpc":"2.0","id":3,"result":{"stopReason":"end_turn"}}Environment
openclaw --version)~/.npm-global/...)Logs or screenshots
Raw ACP sample (redacted):
initializesucceeds withprotocolVersion:1session/newsucceeds and returnssessionIdsession/updateemits severalagent_message_chunkevents...missing/c)stopReason:"end_turn"Additional scope notes: