Skip to content

Commit a57ab24

Browse files
clawsweeper[bot]HCLTakhoffman
authored
docs(imessage): warn that cliPath wrappers must stream JSON-RPC stdio (#84330) (#84420)
Summary: - The PR adds a Warning block to `docs/channels/imessage.md` explaining that iMessage `cliPath` wrappers and SSH proxies must stream long-lived JSON-RPC stdin/stdout incrementally. - Reproducibility: not applicable. for this docs-only PR. Source inspection verifies the runtime uses long-lived line-framed stdio, and current main lacks the operator warning being added. Automerge notes: - PR branch already contained follow-up commit before automerge: docs(imessage): warn that cliPath wrappers must stream JSON-RPC stdio… Validation: - ClawSweeper review passed for head a371ee9. - Required merge gates passed before the squash merge. Prepared head SHA: a371ee9 Review: #84420 (comment) Co-authored-by: HCL <chenglunhu@gmail.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
1 parent c982358 commit a57ab24

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) is safe because it forwards OpenClaw's `cliPath` arguments such as `rpc` and `--db`. 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)