perf(imessage): show typing sooner for slow replies#95621
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 6:26 PM ET / 22:26 UTC. Summary PR surface: Source +66, Tests +258, Docs 0. Total +324 across 4 files. Reproducibility: yes. Current main source shows read receipts awaited before dispatch and native typing created after context/reply setup, while the PR body provides live iMessage timing, DB, and log evidence; I did not run a fresh live iMessage turn in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land after a maintainer explicitly accepts best-effort read receipts and earlier direct typing as the desired iMessage default, while leaving broader latency instrumentation to #96148. Do we have a high-confidence way to reproduce the issue? Yes. Current main source shows read receipts awaited before dispatch and native typing created after context/reply setup, while the PR body provides live iMessage timing, DB, and log evidence; I did not run a fresh live iMessage turn in this read-only review. Is this the best way to solve the issue? Yes, with maintainer acceptance. The implementation stays in the iMessage plugin, reuses the existing direct reply target builder, preserves no-typing-capability progress options, and leaves broader latency instrumentation to the related tracker. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c6f5725906dc. Label changesLabel justifications:
Evidence reviewedPR surface: Source +66, Tests +258, Docs 0. Total +324 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
6bfc194 to
c94ea0a
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
2 similar comments
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
Fixed the remaining ClawSweeper blocker in 33f931f. What changed:
Proof:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review The requested predicate split and no-typing-capability regression test are now pushed at 33f931f. CI is green and the previous author action appears addressed. |
553941f to
b87e5dd
Compare
b87e5dd to
65e9ad1
Compare
|
Merged via squash.
Thanks @omarshahine! |
Merged via squash. Prepared head SHA: 65e9ad1 Co-authored-by: omarshahine <[email protected]> Co-authored-by: omarshahine <[email protected]> Reviewed-by: @omarshahine
Merged via squash. Prepared head SHA: 65e9ad1 Co-authored-by: omarshahine <[email protected]> Co-authored-by: omarshahine <[email protected]> Reviewed-by: @omarshahine
What Problem This Solves
Live iMessage turns can feel sluggish when the accepted message enters expensive setup before the model starts responding. In the profiled path, iMessage dispatch itself was quick, but context/session/model setup could leave the sender with no immediate feedback.
Read receipts were also on the accepted-turn critical path, so a slow private API
readRPC could delay dispatch before the agent even started.Why This Change Was Made
This moves iMessage private-API UI feedback off the critical path:
imsgtyping support;readcall cannot block dispatch or the monitor client's watch stream.The direct typing target reuses the existing iMessage reply target builder, so SMS-vs-iMessage service selection remains consistent with final replies.
User Impact
Users most likely to benefit are people using OpenClaw over iMessage direct messages where responses can take several seconds because of long context, tool setup, model latency, or context-engine work. They should see the iMessage typing bubble sooner after the turn is accepted, which improves perceived responsiveness even when the underlying model path is still slow.
Required setup for the visible typing/read-receipt benefit:
imsgprivate API bridge available viaimsg launch;imsg status --jsonreporting RPC methods that includetypingfor early typing, andreadfor read receipts;session.typingMode/agents.defaults.typingModeunset or set toinstant;The read-receipt optimization benefits hosts with private-API
readsupport whenchannels.imessage.sendReadReceiptsis not disabled.Performance Savings
Live dogfood runs showed the user-visible read/typing feedback delay drop from about
10ssend-to-read before this work to about2safter moving the read receipt off the accepted-turn critical path. On the same setup, disabling the older 7s iMessage split-send debounce produced about1ssend-to-read, which confirmed this PR removes the private-API read RPC from the hot path and leaves the remaining delay to debounce/model/context work.For slow model/context turns, the savings are mostly perceived responsiveness: the native iMessage typing cue is emitted before attachment/history/context/model setup, so users get immediate channel feedback while the expensive turn continues.
Evidence
Fresh live iMessage proof on commit
26a1d38904(2026-06-23):OpenClaw 2026.6.9 (26a1d38)and loadedextensions/imessagefrom this checkout.6340,is_from_me=0, textTest, created2026-06-23T14:20:55.574Z.6340hadis_read=1and non-zerodate_read=803917326885792000.imessage: mark read failedor typing failure log appeared during the validation window.Redacted live log sequence from the same PR checkout run:
Older local live proof:
10s; with this PR it was roughly2s; disabling the older 7s inbound debounce on the same setup reached roughly1s. That shows this PR removes the private-API read RPC from the accepted-turn hot path and leaves remaining delay to debounce/model/context work.imsg statusconfirmed advanced IMCore features were available, including read receipts and typing.imsg read --chat-id 7 --jsonreturned in0.06s,0.07s, and0.11s;imsg typing --chat-id 7 --duration 1s --jsonreturned in1.15s,1.20s, and1.21s.Local proof:
git diff --checkpassed.node scripts/run-vitest.mjs extensions/imessage/src/monitor.last-route.test.tspassed, 33 tests..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainreported no accepted/actionable findings.pnpm exec oxlint extensions/imessage/src/monitor/monitor-provider.tspassed after the lint follow-up.Current PR CI proof on commit
26a1d389044:Real behavior proofpassed.check-lintpassed after the lint follow-up.check-additional-extension-bundledpassed after the lint follow-up.Docs updated: https://docs.openclaw.ai/channels/imessage