Skip to content

docs(imessage): warn that cliPath wrappers must stream JSON-RPC stdio (#84330)#84347

Closed
hclsys wants to merge 1 commit into
openclaw:mainfrom
hclsys:docs-imessage-clipath-stdio-streaming-84330
Closed

docs(imessage): warn that cliPath wrappers must stream JSON-RPC stdio (#84330)#84347
hclsys wants to merge 1 commit into
openclaw:mainfrom
hclsys:docs-imessage-clipath-stdio-streaming-84330

Conversation

@hclsys

@hclsys hclsys commented May 19, 2026

Copy link
Copy Markdown

Fixes #84330.

docs/channels/imessage.md documents that channels.imessage.cliPath can be pointed at an SSH/custom wrapper but doesn't call out a critical interoperability requirement: the wrapper must forward JSON-RPC stdin/stdout incrementally. The OpenClaw iMessage channel exchanges small newline-framed JSON-RPC frames over the wrapper's stdio for the channel's entire lifetime. A wrapper that reads with a large blocking read(N) or buffers stdin until EOF will make small frames like chats.list sit indefinitely, producing symptoms that look exactly like an iMessage outage (imsg rpc timeout (chats.list), repeated channel restarts) even though imsg rpc itself is fine.

Changes

  • docs/channels/imessage.md: add a <Warning> block inside the "Remote Mac over SSH" Tab listing the six interoperability requirements the issue calls out (forward stdin/stdout promptly, preserve newlines, don't wait for EOF, avoid fixed-size blocking reads, keep stderr separate). Cite the exact symptom phrasing the issue uses (imsg rpc timeout) so operators searching for that error find the warning. Note the practical pitfall that pipelines like ssh host imsg | grep ... need stdbuf -oL -eL on every stage to stay safe — line-buffered tools can still hold frames otherwise.

Diff stat: 1 file, +12 / -0. Documentation-only.

Real behavior proof

  • Behavior or issue addressed: Sanitized issue evidence — the issue describes that a custom stdio bridge wrapper using a large blocking read(N) produced imsg rpc timeout (chats.list) until the wrapper was changed to forward bytes/lines as soon as they were available. The fix documents this constraint at the spot operators actually look.

  • Real environment tested: Local Node 22.x. Probe at /tmp/probe_84330.mjs (a) verifies the <Warning> block was added to docs/channels/imessage.md and lives inside the "Remote Mac over SSH" Tab, (b) checks coverage against the issue's "Expected Documentation" list — all six bullets present (forward stdin/stdout promptly, preserve newlines, don't wait for EOF, avoid fixed-size blocking reads, keep stderr separate), (c) confirms the exact symptom phrasing imsg rpc timeout is cited so operators searching for that error find this section, (d) confirms surrounding sections (Tab intro + Requirements heading) are unchanged, (e) checks <Warning> open/close tags are balanced.

  • Exact steps or command run after this patch: node /tmp/probe_84330.mjs

  • Evidence after fix:

PASS: <Warning> block added that mentions cliPath wrapper
PASS: warning block lives inside the 'Remote Mac over SSH' Tab
PASS: all 6 required bullets from issue's "Expected Documentation" are covered
PASS: warning cites the exact symptom from the issue ('imsg rpc timeout')
PASS: surrounding sections (Tab intro + Requirements heading) are unchanged
PASS: <Warning> open/close tags balanced (4 pairs)

ALL CASES PASS
  • Observed result after fix: Operators following the "Remote Mac over SSH" Tab now see the streaming requirement directly under the wrapper-script example. The Warning calls out the visible symptom (imsg rpc timeout), the structural requirements, and a common pitfall (grep pipelines without stdbuf -oL) that produces the same failure mode.

  • What was not tested: No iMessage instance was actually run against a buffering wrapper to reproduce the symptom — this is a documentation-only change to an existing operator-facing manual page. The doc updates the section the issue explicitly suggests in "Suggested Location" (docs/channels/imessage.md near the Remote Mac over SSH wrapper section).

Audit (per CLAUDE rules — all 5 steps)

  • Existing-helper check: No code helper introduced — documentation block additive. The <Warning> Mintlify component is the established callout convention used throughout this doc and across the docs site. PASS
  • Shared-helper caller check: No code is being modified, so no caller-side contracts exist. PASS
  • Broader-fix rival scan: gh pr list --search '84330 in:title,body' and gh pr list --search 'iMessage cliPath wrapper' return no open PRs. Issue timeline shows zero cross-references. PASS
  • Recent-merge audit: git log --oneline -5 -- docs/channels/imessage.md shows no recent commits touching this file. PASS
  • Prototype-pollution scan: N/A — markdown.

…openclaw#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.
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Summary
Adds a Warning block to docs/channels/imessage.md under Remote Mac over SSH explaining that cliPath wrappers must stream JSON-RPC stdin/stdout promptly.

Reproducibility: yes. at source level: current main lacks the warning, and the runtime client uses long-lived newline-framed JSON-RPC over the configured cliPath stdio. I did not run a live iMessage wrapper repro.

PR rating
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Summary: Good focused docs fix with one minor command example to tighten before automerge.

Rank-up moves:

  • Remove or complete the socat example so it forwards the rpc and optional --db arguments OpenClaw passes to cliPath.
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Real behavior proof
Not applicable: Real behavior proof is not required because this PR only changes files under docs/.

Risk before merge

  • The added socat example can be copied as a cliPath wrapper that drops the rpc and --db arguments OpenClaw passes to the wrapper.
  • Docs rendering/link validation was not run in this read-only review; normal docs CI should remain the merge gate for rendering.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the new warning, but remove or rewrite the socat example so every shown wrapper forwards OpenClaw's arguments, then merge after docs CI.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
The remaining action is a narrow docs repair suitable for automation on the PR branch; no runtime or product decision is needed.

Security
Cleared: The diff is docs-only and does not change workflows, dependencies, scripts, credentials, or runtime security boundaries.

Review findings

  • [P3] Make the socat example forward cliPath arguments — docs/channels/imessage.md:130
Review details

Best possible solution:

Keep the new warning, but remove or rewrite the socat example so every shown wrapper forwards OpenClaw's arguments, then merge after docs CI.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main lacks the warning, and the runtime client uses long-lived newline-framed JSON-RPC over the configured cliPath stdio. I did not run a live iMessage wrapper repro.

Is this the best way to solve the issue?

Mostly yes. Documenting the streaming requirement in the Remote Mac setup section is the right fix, but the added socat example should be complete or removed before automerge.

Label changes:

  • add P3: This is a low-risk documentation improvement for an iMessage operator troubleshooting footgun.
  • add status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Not applicable: Real behavior proof is not required because this PR only changes files under docs/.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 🚀 automerge armed.

Full review comments:

  • [P3] Make the socat example forward cliPath arguments — docs/channels/imessage.md:130
    The new warning lists socat - EXEC:"ssh host imsg",pty,stderr as a safe wrapper, but OpenClaw spawns cliPath with arguments like rpc and optional --db. A wrapper using this command as written drops those arguments, so the remote imsg would not enter RPC mode; either remove the socat example or show a complete wrapper that preserves "$@".
    Confidence: 0.86

Overall correctness: patch is correct
Overall confidence: 0.88

Acceptance criteria:

  • pnpm docs:list
  • git diff --check

What I checked:

  • Current docs gap: Current main documents channels.imessage.cliPath as an SSH wrapper in the Remote Mac tab, but the section ends without the requested warning about buffering, EOF waits, newline preservation, or stderr separation. Public docs: docs/channels/imessage.md. (docs/channels/imessage.md:89, ad925bd43b1e)
  • Runtime stdio contract: The iMessage client spawns the configured CLI with piped stdin/stdout/stderr, reads stdout line-by-line, writes JSON-RPC requests as newline-terminated JSON, and reports imsg rpc timeout (<method>) when a response does not arrive. (extensions/imessage/src/client.ts:95, ad925bd43b1e)
  • PR patch scope: The PR modifies only docs/channels/imessage.md, adding a Warning with the expected streaming requirements and the imsg rpc timeout (chats.list) symptom phrase. (docs/channels/imessage.md:121, 44c7bae10d4d)
  • Patch apply and whitespace check: The patch applies cleanly to current main with whitespace errors treated as failures. Public docs: docs/channels/imessage.md. (docs/channels/imessage.md:121, 44c7bae10d4d)
  • Linked issue context: The linked issue asks for this exact docs note near the Remote Mac wrapper section and lists the same six interoperability requirements.
  • Canonical search: Search for the central issue terms found the linked issue and this PR as the active pair, with no separate merged fix already covering the work.

Likely related people:

  • steipete: History shows substantial recent work around iMessage docs/runtime, including remote SCP/SSH hardening and the latest release touch of the affected docs/client files. (role: recent adjacent contributor; confidence: medium; commits: 49d0def6d1e8, 50a2481652b6; files: docs/channels/imessage.md, extensions/imessage/src/client.ts)
  • sebslight: Authored the iMessage docs modernization that introduced the current Remote Mac over SSH section this PR extends. (role: docs page contributor; confidence: high; commits: 6758b6bfe4d6, 93bf75279fbb; files: docs/channels/imessage.md)
  • scoootscooob: Moved the iMessage channel into extensions/imessage, including the current JSON-RPC stdio client used as the contract proof. (role: runtime path contributor; confidence: medium; commits: 0ce23dc62d37; files: extensions/imessage/src/client.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against ad925bd43b1e.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Moonlit Merge Sprite

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: finds missing screenshots.
Image traits: location flaky test forest; accessory proof snapshot camera; palette violet, aqua, and starlight; mood curious; pose stepping out of a freshly hatched shell; shell frosted glass shell; lighting golden review-room light; background smooth stones and checkmarks.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Moonlit Merge Sprite in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@openclaw-barnacle openclaw-barnacle Bot added the proof: supplied External PR includes structured after-fix real behavior proof. label May 19, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper hatch

@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper PR egg hatch requested.

I queued a comment sync for this PR. If the egg is hatchable, ClawSweeper will generate the image once and update the existing review comment.
Action: PR egg hatch queued (workflow sweep.yml, event repository_dispatch).
The ASCII egg stays as the fallback.

@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper could not hatch this PR egg yet.

Reason: there is no current durable ClawSweeper review record for this PR, so there is no PR egg state record to update.
Ask for @clawsweeper re-review first, then retry @clawsweeper hatch after the ClawSweeper review comment appears.

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper hatch

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper automerge is enabled.

  • Head: 44c7bae10d4d
  • Label: clawsweeper:automerge
  • Action: exact-head review queued (workflow sweep.yml, event repository_dispatch).
  • Flow: review this head, repair/rebase only if needed, then re-review the exact repaired head before merge.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-05-20 03:42:32 UTC review queued 44c7bae10d4d (queued)
  • 2026-05-20 03:33:51 UTC review requested repair 44c7bae10d4d (structured ClawSweeper marker: fix-required (finding=review-feedback sha=44c7ba...)

@clawsweeper clawsweeper Bot added status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper 🐠 reef update

Thanks for the contribution. ClawSweeper hit a branch-permission wall on this PR, so it opened a replacement branch to keep review moving while preserving credit.

Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
Replacement PR: #84420
Why close: this run explicitly closes the superseded source PR after the credited replacement PR is open, so review continues in one place.
This closeout is intentional for this run: the replacement PR is now the active review lane.
The original contribution stays credited in the replacement PR context.
Co-author credit kept:

fish notes: model gpt-5.5, reasoning high; reviewed against a371ee9.

@clawsweeper clawsweeper Bot closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: iMessage cliPath wrappers must stream JSON-RPC stdio incrementally

2 participants