docs(imessage): warn that cliPath wrappers must stream JSON-RPC stdio… · openclaw/openclaw@a57ab24
clawsweeper
·
2026-05-20
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -118,6 +118,18 @@ exec ssh -T gateway-host imsg "$@"
|
118 | 118 | OpenClaw uses strict host-key checking for SCP, so the relay host key must already exist in `~/.ssh/known_hosts`. |
119 | 119 | Attachment paths are validated against allowed roots (`attachmentRoots` / `remoteAttachmentRoots`). |
120 | 120 | |
| 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 | + |
121 | 133 | </Tab> |
122 | 134 | </Tabs> |
123 | 135 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。