Repository navigation
fix(imessage): align final delivery proof with destination history - #185409
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesUpdates the iMessage delivery fixture and expected RPC sequence to include destination-history chat lookup. Example: A rich-link reply sends “provider-visible ordinary final” to chat 123.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this PR repairs an obsolete test expectation without changing runtime behavior or weakening delivery checks; no actionable introduced defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe iMessage monitor feeds inbound messages into reply dispatch; confirmed outbound delivery invokes destination-history routing, which may resolve opaque chat selectors through the native transport. flowchart TD
A[Inbound rich link] --> B[iMessage monitor]
B --> C[Reply dispatcher]
C --> D[Native send]
D --> E[Destination history owner]
E --> F[iMessage chat lookup]
D --> G[Delivery hook and echo persistence]
Technical reviewBest possible solution: Merge the focused fixture repair while preserving the existing production delivery and destination-history owners. Do we have a high-confidence way to reproduce the issue? The unchanged main assertion permits only send, while source tracing establishes the subsequent chats.list lookup; the PR reports a matching red-before/green-after run, and exact-head CI succeeds. Is this the best way to solve the issue? This is the smallest complete repair: provide the existing lookup owner with a valid direct-chat fixture and retain exact send cardinality, destination, hook, persistence, and suppression checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1891d8319638. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +5. Total +5 across 1 file. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 27, 2026, 12:15 AM ET / 04:15 UTC. |
|
Merged via squash.
|
…penclaw#185409) Repair the iMessage rich-link final-delivery test's stale single-RPC expectation. Breaking commit dc60bf2 (PR openclaw#182329) added destination-history recording after confirmed outbound sends. Its fallback invokes the iMessage session resolver, which intentionally resolves opaque chat_id selectors through chats.list to distinguish direct chats from groups (PR openclaw#173493). Supply the matching direct-chat identity in the native fixture and require exactly one send to chat 123 followed by exactly one bounded chats.list lookup. Duplicate sends, extra RPCs, wrong recipients, missing hooks, missing SQLite echo persistence, and visible hidden tool output remain rejected. Production behavior is unchanged. Proof: reproduced the original failure on unchanged main, then passed all 3 monitor.plugin-payload tests and all 18 session-route tests locally. Extension-test types, targeted lint, formatting, and diff checks pass. Exact-head CI run 40446394704 passed all 17 selected jobs on 7e0ecf5; the repaired file passed all 3 tests in CI. Codex autoreview was clean, and coordinator review accepted the stricter assertion. No live Gateway or user state was accessed.
* fix(imessage): use a PostgreSQL-safe recovery cursor key
The recovery cursor was keyed by `${accountId}\^@${dbIdentity}`.
PostgreSQL plugin state rejects NUL in keys, so the startup cursor lookup
threw PLUGIN_STATE_INVALID_INPUT and the channel exited on every start.
Key the cursor by a sha256 prefix of the (account, identity) pair, like the
other iMessage plugin-state keys, and adopt a cursor still stored under the
NUL key (SQLite only) once by listing the namespace instead of looking it up.
* ci: re-run against current main (monitor.plugin-payload test fixed by #185409)
…4919) * fix(imessage): use a PostgreSQL-safe recovery cursor key The recovery cursor was keyed by `${accountId}\^@${dbIdentity}`. PostgreSQL plugin state rejects NUL in keys, so the startup cursor lookup threw PLUGIN_STATE_INVALID_INPUT and the channel exited on every start. Key the cursor by a sha256 prefix of the (account, identity) pair, like the other iMessage plugin-state keys, and adopt a cursor still stored under the NUL key (SQLite only) once by listing the namespace instead of looking it up. * ci: re-run against current main (monitor.plugin-payload test fixed by openclaw#185409)
Related: #182329, #173493
What Problem This Solves
Fixes the iMessage rich-link final-delivery test failing on main and on PRs that select its extension shard.
User Impact
No runtime behavior changes. The test again verifies final native delivery, exactly one successful
message_senthook, SQLite echo persistence, and suppression of hidden tool output against the current delivery contract.Why This Change Was Made
The breaking commit is
3fe7f1e2a43c33005e7015ec559e1d006df0b8e5(#182329). It records confirmed outbound payloads through the destination-history owner. When no current local destination binding is available, that owner calls the channel session resolver. iMessage intentionally resolves opaquechat_idselectors throughchats.listto distinguish direct chats from groups (#173493,2a1151addfbf). This is an intentional read after the send, not a duplicate delivery.The native fixture now supplies the matching direct chat. The assertion requires exactly two RPCs in order: one
sendto chat 123 with the expected final text, then onechats.listwith limit 1000. Extra sends, extra RPCs, and wrong chat IDs still fail. The hidden-output case still requires zero native calls and zero hooks. No production owner, state shape, config, or compatibility path changes. Simplification pass: one existing test updated; production +0/-0, tests +10/-5 (net +5).Evidence
node scripts/run-vitest.mjs extensions/imessage/src/monitor.plugin-payload.test.ts --maxWorkers=1on unchangeddee511a5cc0ee477037ff9e54c7b0e6b9935a9ba: 1 failed, 2 passed. Final delivery sawsendfollowed bychats.list, violating the old single-call assertion. Wall time 150.41s (cold compiler preparation); test time about 3.73s.node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfo: passed.node scripts/run-vitest.mjs extensions/imessage/src/session-route.test.ts --maxWorkers=1: 18 passed, including direct chat selectors, native/configured groups, and unresolved-selector refusal. Wall time 111.16s (cold compiler preparation); tests totaled about 0.12s.node scripts/run-oxlint.mjs --tsconfig test/tsconfig/tsconfig.extensions.test.json extensions/imessage/src/monitor.plugin-payload.test.ts: passed.node scripts/run-format.mts --check extensions/imessage/src/monitor.plugin-payload.test.tsandgit diff --check: passed.7e0ecf5034a7f95c5f722dfdffeb4eff36ebfff1: SUCCESS, all 17 non-skipped jobs passed. The changed extension shard ran the repaired test. Both requiredopenclaw/ci-gatecheck instances passed. Repository watcher: GREEN, zero pending checks; earlier draft-era checks were superseded. No reruns or retry pushes.No live Gateway, Messages account, or user state was accessed. Native macOS delivery is mocked; this is a test-contract repair, not live platform proof. The breaking commit is attributed from its parent-relative production patch and merged PR contract; a historical checkout/bisect was unnecessary.