Repository navigation
fix(imessage): keep replies in the current conversation - #133499
omarshahine merged 14 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:18 AM ET / 04:18 UTC. ClawSweeper reviewWhat this changesThis PR makes iMessage direct replies use the inbound chat ID or GUID, rejects redacted action targets with a current-conversation remedy, and passes authoritative chat type into message-action discovery. Merge readinessKeep open: current main still builds direct iMessage replies from an unset-service handle, while this branch carries the inbound chat identifier through immediate delivery and prevents models from retrying redacted targets. The remaining uncertainty is installed-bridge behavior, not a demonstrated patch defect. Priority: P1 Review scores
Verification
How this fits togetherThe iMessage plugin converts bridge inbound events into an OpenClaw reply route, then the generic reply pipeline and shared message tool dispatch replies or native actions. This change preserves the trusted conversation identity through that handoff so direct messages do not depend on service auto-detection or model-visible PII. flowchart LR
A[iMessage bridge inbound event] --> B[Inbound conversation classification]
B --> C[Exact reply route selection]
C --> D[Reply pipeline]
B --> E[Runtime prompt and message tool discovery]
E --> F[Action authorization and dispatch]
D --> G[iMessage bridge delivery]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +42, Tests +145, Docs +1. Total +188 across 23 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain this owner-boundary repair and record a redacted beta trace for numeric-ID and GUID-only direct replies before promotion beyond beta. Do we have a high-confidence way to reproduce the issue? Yes for a source-level reproduction: current main constructs Is this the best way to solve the issue? Yes: the branch repairs the inbound route owner, preserves the durable service-qualified origin, and uses generic typed discovery rather than a configuration workaround or model-side target reconstruction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ee3ee255d8d9. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (18 earlier review cycles; latest 8 shown)
|
|
ClawSweeper follow-up for reviewed head
No autofix or automerge is enabled. |
|
@clawsweeper re-review New exact head: |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Exact head is now |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review New exact head: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review New exact head: |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Exact head: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper automerge |
|
🦞👀 Approver: I left the PR open for the remaining gate instead of bypassing it. Automerge progress:
|
|
Maintainer decision: accept the selector-contract risk and proceed with landing this exact head using the green focused coverage and CI. The missing redacted installed-imsg traces for both numeric @clawsweeper automerge |
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
|
@clawsweeper approve |
) * fix(imessage): preserve current conversation routes * fix(imessage): preserve direct action discovery * fix(agents): pass chat type to action discovery * fix(imessage): reject redacted target aliases * fix(imessage): prefer exact inbound chat guid * docs(plugins): describe chat-type discovery scope * test(imessage): cover routed discovery context * docs(changelog): attribute current conversation fix * test(docs): sync release navigation fixture * chore: leave release notes to release flow * docs(changelog): note iMessage direct reply fix * chore: keep release changelog generated --------- Co-authored-by: Omar Shahine <[email protected]>
Closes #133468
What Problem This Solves
Fixes an issue where iMessage users replying in a direct conversation could lose automatic threaded replies and current-conversation actions when
channels.imessage.servicewas unset. Automatic finals reached delegated-reply authorization as an ambiguousauto:<handle>route, while model-visible peer redaction encouraged message actions to retry the literal***destination.Why This Change Was Made
Direct inbound turns now carry the bridge-provided numeric chat ID, or the authoritative chat GUID when no numeric ID exists, as their immediate reply target while retaining the service-qualified handle as the durable follow-up route. This keeps the trusted current conversation exact and PII-free without relaxing same-account or same-conversation authorization.
Core propagates the inbound
chatTypeinto channel-owned action discovery so a numeric direct-chat target cannot expose group-only actions. The iMessage tool prompt tells the model to omit current-conversation targets, andtarget,to,chatGuid, orchatIdentifiercontaining the literal redaction marker fail before parsing or bridge dispatch with that recovery guidance.User Impact
With the default/unset service, automatic direct-message replies and targetless native actions such as polls stay in the current iMessage chat. Redacted display values are no longer retried as executable destinations. Explicitly unbound, wrong-account, and cross-chat delegated references remain rejected.
Evidence
Pre-fix production incident, 2026-08-30
2026.9.1-beta.1, imsg0.13.4, bridge v2 healthy.Delegated iMessage message references require a current same-account conversation binding when the Messages database is unavailable.send_attempt_started; its pending-delivery notice appeared after/new, making the successful reset look broken.service="imessage"mitigation, a threaded inbound message received the automatic replyYes — I’m here.in the same thread nine seconds later with no new delivery-recovery errors. This is mitigation evidence, not proof of this patch.***. Six reply/poll retries using redacted or malformed targets failed over about 127 seconds. Two direct imsg poll sends to the same numeric chat delivered immediately and rendered correctly, isolating the defect to OpenClaw's current-conversation route.Post-fix automated proof for exact head
fa318748d95009c745a66f862f389efe9c852e29chat_id, thenchat_guid, before a service-qualified handle fallback. The durable route remains service-qualified.chatTypeis propagated through runtime prompt preparation, embedded discovery, message-tool discovery, and execution. Direct numeric chats hide group-only actions; group chats retain them.***intarget,to,chatGuid, orchatIdentifieris rejected before bridge dispatch with omit-target remediation.openclaw/mainat5835fbeac7d6be65612fb666f47f10b6bc4ca30c; the sole conflict was resolved with main’s generalized release-route assertions.docs:list: passed, 1,525 indexed lines.git diff --checkand changelog attribution validation: passed.f4a978146492ee38a90f38601001f18b7dde8117: scoped clean through P2; patch rated correct at 0.90 confidence. The two later changelog-policy commits have zero net tree delta.Live after-proof status
No live post-fix claim is made yet. The isolated dev proof run was blocked before the patched Gateway became ready because copied agent databases require stopped-writer identity migration. Initial restore also exposed stale dev-config validation ordering; production was manually restored and verified healthy with one bridge v2 process. The operational fixes are tracked independently in #133478 and Lobster issues/PRs #338/#339. They are proof dependencies only and are not branch ancestors of this PR.
Validation notes
send.test.tsandmessage-tool.test.tscases. Exact-head CI is green: 214 passed, 44 skipped, zero pending or failed.chatType: groupin reconstructed prompts. The only failure on5b812d3was release-doc fixture drift in shardchecks-node-compact-small-44; current main now owns a generalized fix and that exact test passes locally. Exact-head CI is green. Exact-head ClawSweeper review is complete with no actionable findings;needs-humanremains only for installed-bridge proof and maintainer handling.Production code delta: +50/-8; tests and test support: +151/-9; documentation: +2/-1; changelog: 0. The production growth spans the exact-route producer, redaction guard, bounded model guidance, and generic discovery context propagation. No configuration or database surface is added. Release-note context remains in this PR body; the root changelog has no PR delta and remains release-owned.