Repository navigation
fix: restore Inbox delivery for committed human mentions - #178297
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: needs maintainer review before merge. What this changesThis PR runs queued Inbox operations outside the completed transcript writer’s async context. Example: Alice sends “@bob Please review.” with Bob selected as a mention recipient.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR provides a focused repair for missing committed-mention notifications, and the updated authority controls resolve the previous review’s concerns; no introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway’s transcript commit callback submits selected human mentions to the Inbox queue, which checks current session and recipient authority before persistence and notification. flowchart LR
A[Authenticated chat send] --> B[Transcript commit]
B --> C[Detached Inbox queue]
C --> D[Current recipient and session policy]
D --> E[Worker commit admission]
E --> F[Durable Inbox entry]
F --> G[Authorized views and notifications]
Technical reviewBest possible solution: Keep the existing Inbox owner and detach its accepted queue work while preserving current commit and disclosure checks. Do we have a high-confidence way to reproduce the issue? Current source preserves the completed-writer context into the Inbox sharing read, and the supplied authenticated Gateway regression reportedly fails on baseline with an empty Inbox; this review executed no target code. Is this the best way to solve the issue? This is the smallest complete repair: reuse the maintained detached-context helper at the existing queue owner rather than weaken transcript custody or duplicate recipient policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7ad64520b5a2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4, Tests +226. Total +230 across 3 files. Added test files: 1. 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 HistoryReview history (1 earlier review cycle)
Reviewed October 20, 2026, 6:08 AM ET / 10:08 UTC (Revision 2). |
|
@clawsweeper re-review The current head adds the pending-commit recipient-revocation control. The PR body now includes the passing authority checks and inspected live delivery media, with the composed runtime distinguished from isolated source proof. |
|
🦞👀 Re-review progress:
|
|
Fixed: committed human mentions now reach the eligible recipient’s Inbox exactly once. |
…8297) Restore Inbox delivery for committed human mentions while preserving current recipient authorization, idempotency, and accepted-work settlement. Fixes openclaw#178264.
What Problem This Solves
Fixes human mentions that are successfully posted to a conversation but never reach the eligible recipient's Inbox. This affects ordinary administrator-to-administrator messages as well as paths used by restricted senders: transcript persistence succeeds, while the separate mention effect fails during its session read.
Fixes #178264.
User Impact
Eligible recipients receive one Inbox entry for a committed mention. Retrying the same input does not create another notification. The original message remains governed by its existing commit guard, and the Inbox continues to apply current recipient access, session identity, duplicate suppression, and shutdown rules.
This restores the existing mention contract without changing permissions, membership, schema, configuration, or retention. Existing missing notifications are not backfilled from transcript history.
Why This Change Was Made
The transcript recorder publishes its committed state before invoking the original-input callback. That correctly ends the original writer's input custody. The Inbox queue previously inherited that writer's async context, so its later sharing read could borrow the completed writer and reject the stale input authority.
The existing Inbox queue now enters the maintained detached async context before tracking accepted work in its own scope. It retains FIFO ordering, drains accepted work on disposal, and acquires current authority through the existing mention owners. The transcript guard itself is unchanged.
Evidence
A regression uses an isolated Gateway, two authenticated administrator clients, and the existing local Responses-provider fixture. On unchanged main, selected mentions commit and the agent replies normally, but the recipient Inbox stays empty. The diagnostic traces the failure to the obsolete input custody guard during the separate sharing read. The regression checks the correct recipient and excerpt, a committed message sequence, and idempotent replay without another entry.
Changed-file formatting/lint and affected production/test type checks pass. Existing caller and Inbox tests pass for queued delivery, recipient revocation, duplicate suppression, scheduler cancellation, and accepted-work settlement. The separate source-custody suite passes all 13 controls; the original commit guard was not changed.
The Inbox owner suite also pauses a new entry immediately before the real worker commit, revokes the recipient through the profile writer, then resumes that commit. It confirms no durable entry or push is produced and the current Inbox read is forbidden. Its existing foreign-profile controls verify that another profile cannot list or dismiss the intended recipient's entry, including rejection of an explicit foreign
profileId. All 31 cases pass; the new revocation case takes 1.170 seconds, and the full owner file reports 83.29 seconds in Vitest / 114.54 seconds in the native runner including preparation.pnpm test src/gateway/server.mentions-committed.test.ts --maxWorkers=1passes on the repair and fails with an empty Inbox on baseline5bd24d8a8eb354fad8c3fecb29affff0628c7aae. The passing test takes 16.743 seconds; Vitest reports 44.66 seconds including cold transformation, and the native test runner reports 47.22 seconds. This real Gateway boundary is necessary to exercise authenticated input-writer custody; a bare recorder does not reproduce that lifecycle. The current CI run used 7,617 aggregate job seconds, with 33 jobs passing and 28 outside the selected scope; its production-type failure reproduces with the identical 809 DOM/JSX diagnostics on main revision37e60afc6d2ffb3dab5dee16a52f2aae2554d4abwithout this patch. The separate graph repair landed in #178306. Production core types pass on the prospective merge resultff9534db8b0adc483d31d819fdbd87ca2a08ff5d.Independent engineering review is clean on
7e8347a. Actual browser proof on a composed native runtime confirms automatic delivery in both guest-to-administrator and administrator-to-eligible-guest directions. Each uses one new send, observes arrival before any diagnostic Inbox read, retains the item after Open and a real reconnect, and removes it through its own Dismiss control. The production Inbox file is byte-identical to this PR; the isolated two-administrator regression remains separate source proof. ClawSweeper reviewed7e8347aat Platinum with no findings. Final target7ad64520b5a2e13f1512d353b49c38bc616f3054still fails the real Gateway regression with an empty Inbox. The exact prospective merge result passes that regression and all 31 Inbox and 13 original-custody controls. This refresh covers upstream input-staging and session-reader changes; existing unaffected proof remains applicable.Visual evidence
Recipient camera: automatic arrival, open, reconnect and dismissal
recipient.mp4
Visual verification
617f152e8112ae21211e84f3461d74efdff218b4Sender camera: selected mention and one send
guest-to-admin-sender-single-send.mp4
The two camera clips have separate local timelines. Personal labels and private pages are masked; no frames within either selected interval were removed.