Skip to content

Commit 44c7bae

Browse files
author
HCL
committed
docs(imessage): warn that cliPath wrappers must stream JSON-RPC stdio (#84330)
A custom `cliPath` wrapper or SSH proxy in front of `imsg` must behave like a transparent stdio pipe for long-lived JSON-RPC: small newline- framed messages can sit indefinitely if the wrapper buffers stdin until EOF or a large block fills. The visible symptom is `imsg rpc timeout (chats.list)` or repeated channel restarts even though `imsg rpc` is healthy. Add a <Warning> block in the 'Remote Mac over SSH' Tab listing the six interoperability requirements the issue calls out, and note that filter pipelines like `ssh host imsg | grep ...` need `stdbuf -oL` on every stage to stay safe.
1 parent 48acdd3 commit 44c7bae

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

docs/channels/imessage.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ exec ssh -T gateway-host imsg "$@"
118118
OpenClaw uses strict host-key checking for SCP, so the relay host key must already exist in `~/.ssh/known_hosts`.
119119
Attachment paths are validated against allowed roots (`attachmentRoots` / `remoteAttachmentRoots`).
120120

121+
<Warning>
122+
Any `cliPath` wrapper or SSH proxy you put in front of `imsg` MUST behave like a transparent stdio pipe for long-lived JSON-RPC. OpenClaw exchanges small newline-framed JSON-RPC messages over the wrapper's stdin/stdout for the lifetime of the channel:
123+
124+
- Forward each stdin chunk/line **as soon as bytes are available** — don't wait for EOF.
125+
- Forward each stdout chunk/line promptly in the reverse direction.
126+
- Preserve newlines.
127+
- Avoid fixed-size blocking reads (`read(4096)`, `cat | buffer`, default shell `read`) that can starve small frames.
128+
- Keep stderr separate from the JSON-RPC stdout stream.
129+
130+
A wrapper that buffers stdin until a large block fills will produce symptoms that look like an iMessage outage — `imsg rpc timeout (chats.list)` or repeated channel restarts — even though `imsg rpc` itself is healthy. `ssh -T host imsg "$@"` (above) and `socat - EXEC:"ssh host imsg",pty,stderr` are safe. Pipelines like `ssh host imsg | grep -v '^DEBUG'` are NOT — line-buffered tools can still hold frames; use `stdbuf -oL -eL` on every stage if you must filter.
131+
</Warning>
132+
121133
</Tab>
122134
</Tabs>
123135

0 commit comments

Comments
 (0)