Repository navigation
fix: preserve caller permissions in session continuations - #187346
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 real behavior proof before merge. What this changesThis PR preserves initiating callers’ permissions across session continuations and reserves session-principal authority for unattributed host work. Example: An exec completion continues work for original-guest, who has operator.write, in an administrator-owned session.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this maintainer-authored PR addresses a concrete continuation-authority gap; source review found no definite introduced bug. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway and reply admission accept continuation events, resolve their current caller authority, and pass that authority into managed tools and delayed node-completion delivery. flowchart TD
Caller[Initiating caller] --> Capture[Capture authority and policy]
Capture --> Continuation[Queued continuation or node completion]
Host[Unattributed host event] --> Principal[Current session principal]
Continuation --> Admission[Session admission]
Principal --> Admission
Admission --> Effect[Live authorization and final effect]
Technical reviewBest possible solution: Retain caller custody in the existing event and node owners, use the shared principal resolver only for unattributed host work, and demonstrate isolation at real effects. Do we have a high-confidence way to reproduce the issue? Current-main admission lacks the new principal fallback and caller classification, and the reverted predecessor documents the same refusal; no target code was executed during this read-only review. Is this the best way to solve the issue? The approach fixes the owning authority flow rather than bypassing tool checks, and the added lifetime handling is justified by delayed node completion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a78ea59e2fb0. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +346, Tests -2, Docs +7. Total +351 across 30 files. Added test files: 0. 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. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 29, 2026, 1:50 AM ET / 05:50 UTC. |
openclaw#187346) System-started turns now continue with the current authority of whoever started the work they continue. Before, they had no person authority: person-scoped tools like sessions_spawn refused with "User is not a participant of this turn" (8 Team-server refusals since 10-02; 4 in real-model stress on main), and the agent silently stopped work as soon as it continued from an event. - A guest's background exec, subagent or goal continues as that guest, keeping the guest's current policy (AutoReview etc.), revalidated at the point of effect. - Only system work with no originating caller (restart resume, unattributed events) falls back to the session principal's current authority. An explicit non-human assignment never falls back to a former human creator; no-principal turns get no person authority and an honest refusal. - Node exec completions keep the captured logical target and agent; the prefixed queue key is used only for storage and cleanup. - Cron keeps its own authority model. This redoes openclaw#187105, which was reverted in openclaw#187126 after it continued a guest-started background completion with owner authority (lost the guest's AutoReview). Proof at exact head b16e958: - The exec-completion sessions_spawn regression is red on base; guest-continuation, revocation and delayed-node custody tests pass; the node-owner regression is red on dc07bd4 and green here. - Locally, 21 files (430 tests) and ten static checks pass, including zero-cycle guards. - Exact-head CI: 93 jobs passed. The single failed job, checks-node-changed-compact-large-23, is sessions-create-thinking-claim.test.ts "...at the same timestamp (delivered-event)". It passed on both previous heads (dc07bd4, 425cbfb), the only change since is the unrelated 4-line node-owner fix, and it passed 6/6 locally on this head, so it is a timing intermittent.
…188105) Related: #161007, #180304, #187346 ## What Problem This Solves Fixes: an automation's failure repair turn cannot read or change the job it was asked to repair, so it asks the user to fix it instead. ## User Impact User impact: when an owned automation fails, the repair turn in its owner conversation can now read the job's runs and update the job when the job's requester is still an owner, so most repairs no longer need a human reply. Scheduler notices about a job follow the same rule. Risk to note: a job whose requester is not an owner (or whose stored operator source can no longer be restored) now gets read-only automation access in its repair and notice turns, and no session-owner fallback. Jobs that record no requester keep the session owner's current access, as other system turns do since #187346. ## Why This Change Was Made System-started turns got their authority from what kind of turn they were: a label match for notices (#180304), a caller rule for completions (#187346, which left cron out), and nothing for repairs, which went through the public `agent` RPC. Any client can send the repair's provenance label on that RPC, so it could never carry authority. Now: - A scheduler turn about a job acts for the job's recorded requester, the same requester and owner check its scheduled runs use (channel sender, profile, or restored operator source). Owner status is rechecked before each owner-only effect. - Repairs run on the host session-event path, like notices and completions. - Every host system turn gets one rule for caller-scoped automation reads; the `sourceTool === "cron"` match is gone. ## Evidence Production repair transcripts (read-only, one Gateway, since the repair feature shipped): 57 repair turns, 3 fixed their job, 28 asked the user. No repair turn ever completed an `automations` call: before 2026-10-19 the tool was absent, then a schema check failed, and since 2026-10-22 all 18 calls were refused by the owner gate. All 3 script-payload repairs were refused. Final-effect test `src/gateway/server-cron-failure-repair.final-effect.test.ts` runs the real repair dispatcher, real session-event admission, the turn's real tool surface and in-process Gateway dispatch into a real `CronService` and its store (model synthetic). Each case reports the tool result and the stored job afterwards: | Job requester | `automations update` | Stored description | |---|---|---| | Channel owner | ok | changed | | Channel non-owner | gated | unchanged | | Channel owner revoked while the repair was queued | turn refused at admission, no tool ran | unchanged | | Channel owner revoked after admission | refused: tool host retired by the config change | unchanged | | Restored Control UI admin operator source | ok | changed | | Restored non-admin operator source | gated | unchanged | | Operator source with its device revoked before the repair | gated (no session fallback) | unchanged | | Operator source device revoked while queued | turn refused at admission, no tool ran | unchanged | Two fixes came out of this proof: - The queued-revocation case first let the update through: the requester recheck read the config captured at capture time. It now reads the Gateway's current config, as completion turns do (`authority.isCurrent(getSessionEventRuntimeConfig())`). - A restored operator source is an owner only when it was a Control UI administrator, matching the job's in-session runs (`session-run.ts`). The non-admin case fails without this rule. On the base commit the file fails (the repair cannot dispatch outside the old lifecycle path); production transcripts above show the base refusal itself. Runtime-error suppression from #162772 is kept: repair session events set a host-owned `suppressErrorDelivery`, so error payloads stay in the transcript and out of chat. The owner-topic Gateway test now has the repair return a provider-error payload and asserts no chat delivery; without the flag that test fails (`prepareSessionEventDelivery` called once). Gateway cron suite (`server.cron.test.ts`): the owner-topic repair and NO_REPLY repair cases drive the real reply runtime; they check the owner topic's session and thread route, repair pending through retries until the turn settles (success and error), one escalation, and that a forged public `cron_failure_repair` label still gets no silence. The monotonic deadline cases in `server-cron-notifications.repair.test.ts` now run against the session-event dispatcher. Focused runs (`pnpm test <file> --maxWorkers=1`, wall time): | File | Tests | Time | |---|---|---| | `src/gateway/server-cron-failure-repair.final-effect.test.ts` (new) | 8 | 34 s | | `src/gateway/server-cron-notifications.repair.test.ts` | 2 | 7 s | | `src/gateway/tool-resolution.exclude.test.ts` | 37 | 9 s | | `src/agents/agent-tools.turn-authority.test.ts` | 14 | 1 s | | `src/gateway/server.cron.test.ts` | 15 | 30 s | | `src/auto-reply/reply/session-event-permissions.test.ts` | 27 | 37 s | | `src/cron/execution-context-admission.test.ts` | 26 | 6 s | The new test file adds about 8 s of test time (eight cases, one shared fixture). `server.cron.test.ts` stays at its prior cost. `oxfmt`, type-aware `oxlint` on changed files, `pnpm tsgo:core`, the `src` test-type shards and the baseline ratchets (`check:test-mock-exports`, `check:max-lines-ratchet`, `check:assertion-safety`, `check:test-timeout-race-ratchet`) pass. Hosted CI and the ClawSweeper review are green on the merged head. Gaps: - Profile requesters reuse the scheduled-run owner check unchanged; channel and operator-source requesters are the tested paths. - The managed tool host used by `openEventToolHost` does not pass `inputProvenance` into tool construction, so caller-scoped reads for non-owner turns are shown in the unit matrices, not this harness (the embedded attempt path does pass it). Follow-up. - Live proof needs a deploy; the next real failing job on a production Gateway will show it. Co-authored-by: Ayaan Zaidi <[email protected]>
…penclaw#188105) Related: openclaw#161007, openclaw#180304, openclaw#187346 ## What Problem This Solves Fixes: an automation's failure repair turn cannot read or change the job it was asked to repair, so it asks the user to fix it instead. ## User Impact User impact: when an owned automation fails, the repair turn in its owner conversation can now read the job's runs and update the job when the job's requester is still an owner, so most repairs no longer need a human reply. Scheduler notices about a job follow the same rule. Risk to note: a job whose requester is not an owner (or whose stored operator source can no longer be restored) now gets read-only automation access in its repair and notice turns, and no session-owner fallback. Jobs that record no requester keep the session owner's current access, as other system turns do since openclaw#187346. ## Why This Change Was Made System-started turns got their authority from what kind of turn they were: a label match for notices (openclaw#180304), a caller rule for completions (openclaw#187346, which left cron out), and nothing for repairs, which went through the public `agent` RPC. Any client can send the repair's provenance label on that RPC, so it could never carry authority. Now: - A scheduler turn about a job acts for the job's recorded requester, the same requester and owner check its scheduled runs use (channel sender, profile, or restored operator source). Owner status is rechecked before each owner-only effect. - Repairs run on the host session-event path, like notices and completions. - Every host system turn gets one rule for caller-scoped automation reads; the `sourceTool === "cron"` match is gone. ## Evidence Production repair transcripts (read-only, one Gateway, since the repair feature shipped): 57 repair turns, 3 fixed their job, 28 asked the user. No repair turn ever completed an `automations` call: before 2026-10-19 the tool was absent, then a schema check failed, and since 2026-10-22 all 18 calls were refused by the owner gate. All 3 script-payload repairs were refused. Final-effect test `src/gateway/server-cron-failure-repair.final-effect.test.ts` runs the real repair dispatcher, real session-event admission, the turn's real tool surface and in-process Gateway dispatch into a real `CronService` and its store (model synthetic). Each case reports the tool result and the stored job afterwards: | Job requester | `automations update` | Stored description | |---|---|---| | Channel owner | ok | changed | | Channel non-owner | gated | unchanged | | Channel owner revoked while the repair was queued | turn refused at admission, no tool ran | unchanged | | Channel owner revoked after admission | refused: tool host retired by the config change | unchanged | | Restored Control UI admin operator source | ok | changed | | Restored non-admin operator source | gated | unchanged | | Operator source with its device revoked before the repair | gated (no session fallback) | unchanged | | Operator source device revoked while queued | turn refused at admission, no tool ran | unchanged | Two fixes came out of this proof: - The queued-revocation case first let the update through: the requester recheck read the config captured at capture time. It now reads the Gateway's current config, as completion turns do (`authority.isCurrent(getSessionEventRuntimeConfig())`). - A restored operator source is an owner only when it was a Control UI administrator, matching the job's in-session runs (`session-run.ts`). The non-admin case fails without this rule. On the base commit the file fails (the repair cannot dispatch outside the old lifecycle path); production transcripts above show the base refusal itself. Runtime-error suppression from openclaw#162772 is kept: repair session events set a host-owned `suppressErrorDelivery`, so error payloads stay in the transcript and out of chat. The owner-topic Gateway test now has the repair return a provider-error payload and asserts no chat delivery; without the flag that test fails (`prepareSessionEventDelivery` called once). Gateway cron suite (`server.cron.test.ts`): the owner-topic repair and NO_REPLY repair cases drive the real reply runtime; they check the owner topic's session and thread route, repair pending through retries until the turn settles (success and error), one escalation, and that a forged public `cron_failure_repair` label still gets no silence. The monotonic deadline cases in `server-cron-notifications.repair.test.ts` now run against the session-event dispatcher. Focused runs (`pnpm test <file> --maxWorkers=1`, wall time): | File | Tests | Time | |---|---|---| | `src/gateway/server-cron-failure-repair.final-effect.test.ts` (new) | 8 | 34 s | | `src/gateway/server-cron-notifications.repair.test.ts` | 2 | 7 s | | `src/gateway/tool-resolution.exclude.test.ts` | 37 | 9 s | | `src/agents/agent-tools.turn-authority.test.ts` | 14 | 1 s | | `src/gateway/server.cron.test.ts` | 15 | 30 s | | `src/auto-reply/reply/session-event-permissions.test.ts` | 27 | 37 s | | `src/cron/execution-context-admission.test.ts` | 26 | 6 s | The new test file adds about 8 s of test time (eight cases, one shared fixture). `server.cron.test.ts` stays at its prior cost. `oxfmt`, type-aware `oxlint` on changed files, `pnpm tsgo:core`, the `src` test-type shards and the baseline ratchets (`check:test-mock-exports`, `check:max-lines-ratchet`, `check:assertion-safety`, `check:test-timeout-race-ratchet`) pass. Hosted CI and the ClawSweeper review are green on the merged head. Gaps: - Profile requesters reuse the scheduled-run owner check unchanged; channel and operator-source requesters are the tested paths. - The managed tool host used by `openEventToolHost` does not pass `inputProvenance` into tool construction, so caller-scoped reads for non-owner turns are shown in the unit matrices, not this harness (the embedded attempt path does pass it). Follow-up. - Live proof needs a deploy; the next real failing job on a production Gateway will show it. Co-authored-by: Ayaan Zaidi <[email protected]>
- Conflicts from openclaw#187346, which moved the node exec.started/finished/ denied handling out of server-node-events.ts into handleNodeExecEvent in server-node-events-exec-notice.ts. - server-node-events.ts: main's version. The pathPrepend warning hook (withNodeExecPathPrependWarning(text, cfg, agentId)) now sits after the "Exec finished" text in handleNodeExecEvent (main's code kept as is), same cfg and agentId. - server-node-events.session-events.test.ts: main's version plus this branch's run-path-* cases; the route test main removed stays removed.
…penclaw#188105) Related: openclaw#161007, openclaw#180304, openclaw#187346 Fixes: an automation's failure repair turn cannot read or change the job it was asked to repair, so it asks the user to fix it instead. User impact: when an owned automation fails, the repair turn in its owner conversation can now read the job's runs and update the job when the job's requester is still an owner, so most repairs no longer need a human reply. Scheduler notices about a job follow the same rule. Risk to note: a job whose requester is not an owner (or whose stored operator source can no longer be restored) now gets read-only automation access in its repair and notice turns, and no session-owner fallback. Jobs that record no requester keep the session owner's current access, as other system turns do since openclaw#187346. System-started turns got their authority from what kind of turn they were: a label match for notices (openclaw#180304), a caller rule for completions (openclaw#187346, which left cron out), and nothing for repairs, which went through the public `agent` RPC. Any client can send the repair's provenance label on that RPC, so it could never carry authority. Now: - A scheduler turn about a job acts for the job's recorded requester, the same requester and owner check its scheduled runs use (channel sender, profile, or restored operator source). Owner status is rechecked before each owner-only effect. - Repairs run on the host session-event path, like notices and completions. - Every host system turn gets one rule for caller-scoped automation reads; the `sourceTool === "cron"` match is gone. Production repair transcripts (read-only, one Gateway, since the repair feature shipped): 57 repair turns, 3 fixed their job, 28 asked the user. No repair turn ever completed an `automations` call: before 2026-10-19 the tool was absent, then a schema check failed, and since 2026-10-22 all 18 calls were refused by the owner gate. All 3 script-payload repairs were refused. Final-effect test `src/gateway/server-cron-failure-repair.final-effect.test.ts` runs the real repair dispatcher, real session-event admission, the turn's real tool surface and in-process Gateway dispatch into a real `CronService` and its store (model synthetic). Each case reports the tool result and the stored job afterwards: | Job requester | `automations update` | Stored description | |---|---|---| | Channel owner | ok | changed | | Channel non-owner | gated | unchanged | | Channel owner revoked while the repair was queued | turn refused at admission, no tool ran | unchanged | | Channel owner revoked after admission | refused: tool host retired by the config change | unchanged | | Restored Control UI admin operator source | ok | changed | | Restored non-admin operator source | gated | unchanged | | Operator source with its device revoked before the repair | gated (no session fallback) | unchanged | | Operator source device revoked while queued | turn refused at admission, no tool ran | unchanged | Two fixes came out of this proof: - The queued-revocation case first let the update through: the requester recheck read the config captured at capture time. It now reads the Gateway's current config, as completion turns do (`authority.isCurrent(getSessionEventRuntimeConfig())`). - A restored operator source is an owner only when it was a Control UI administrator, matching the job's in-session runs (`session-run.ts`). The non-admin case fails without this rule. On the base commit the file fails (the repair cannot dispatch outside the old lifecycle path); production transcripts above show the base refusal itself. Runtime-error suppression from openclaw#162772 is kept: repair session events set a host-owned `suppressErrorDelivery`, so error payloads stay in the transcript and out of chat. The owner-topic Gateway test now has the repair return a provider-error payload and asserts no chat delivery; without the flag that test fails (`prepareSessionEventDelivery` called once). Gateway cron suite (`server.cron.test.ts`): the owner-topic repair and NO_REPLY repair cases drive the real reply runtime; they check the owner topic's session and thread route, repair pending through retries until the turn settles (success and error), one escalation, and that a forged public `cron_failure_repair` label still gets no silence. The monotonic deadline cases in `server-cron-notifications.repair.test.ts` now run against the session-event dispatcher. Focused runs (`pnpm test <file> --maxWorkers=1`, wall time): | File | Tests | Time | |---|---|---| | `src/gateway/server-cron-failure-repair.final-effect.test.ts` (new) | 8 | 34 s | | `src/gateway/server-cron-notifications.repair.test.ts` | 2 | 7 s | | `src/gateway/tool-resolution.exclude.test.ts` | 37 | 9 s | | `src/agents/agent-tools.turn-authority.test.ts` | 14 | 1 s | | `src/gateway/server.cron.test.ts` | 15 | 30 s | | `src/auto-reply/reply/session-event-permissions.test.ts` | 27 | 37 s | | `src/cron/execution-context-admission.test.ts` | 26 | 6 s | The new test file adds about 8 s of test time (eight cases, one shared fixture). `server.cron.test.ts` stays at its prior cost. `oxfmt`, type-aware `oxlint` on changed files, `pnpm tsgo:core`, the `src` test-type shards and the baseline ratchets (`check:test-mock-exports`, `check:max-lines-ratchet`, `check:assertion-safety`, `check:test-timeout-race-ratchet`) pass. Hosted CI and the ClawSweeper review are green on the merged head. Gaps: - Profile requesters reuse the scheduled-run owner check unchanged; channel and operator-source requesters are the tested paths. - The managed tool host used by `openEventToolHost` does not pass `inputProvenance` into tool construction, so caller-scoped reads for non-owner turns are shown in the unit matrices, not this harness (the embedded attempt path does pass it). Follow-up. - Live proof needs a deploy; the next real failing job on a production Gateway will show it. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 8100c60) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 12819b3dac7eab80d73e174c19363fe1e29679e4)
What Problem This Solves
Fixes person-scoped session tools refusing system continuations while preserving the permissions of the caller who started the work. Replaces the reverted #187105 / #187126 approach.
User Impact
Guest-started exec completions, subagent handoffs, and Goal continuations retain the guest's current authority and policy, including AutoReview. Authority is revalidated before effects. Only host work with no originating caller uses the session principal's current authority. Cron retains its existing model. No configuration or data migration is required.
Why This Change Was Made
Continuation custody belongs to the initiating caller. Host-only metadata distinguishes known callers from unattributed work, and every principal fallback delegates to the existing principal-authority resolver. Revoked caller-bound work cannot fall back to the owner. Missing person authority is reported honestly.
Delayed node exec completion now retains the original authority, policy and delivery target from dispatch through settlement. Existing authorization matching and exec handling move into their existing owners, removing the superseded paths. Source-less node dispatch keeps its existing synchronous timing and lazy expiration behavior.
The node host's omitted-session-key target, legacy Mac run-ID matching and unbounded timeout behavior remain existing protocol contracts. A lost terminal event on a permanently connected unbounded run can retain its source until disconnect; live authority checks still apply.
Production grows by 350 lines, tests shrink by 2, and documentation grows by 7 across 30 files. No baseline, ceiling, dependency, schema, configuration or version changes. Main's inherited cron/registry/mock-ratchet repairs (#187120 and #187134) are integrated unchanged; duplicate repairs are absent from this diff.
Evidence
Exact head:
b16e958184ae234caca0cdf1e38c978ab327ec92.Clean focused proof passed: 21 files, 430 tests, zero unhandled errors. This includes the exec-event → managed tool host → unnamed
sessions_spawnregression, guest identity versus an administrator owner, revocation at child-launch effect, guest AutoReview, real delayednode.invokecompletion, prior CI-failing files, five heap-interrupted files, and prompt-prefix stability. All eight exact-head static checks passed: core and affected test typechecks, lint, formatting, source caps, test-line and mock-export ratchets, and diff sanity. Independent review found no actionable P0–P2 issues.The complete requested 3,522-file local inventory finished: 3,501 files admitted and 21 live files gated out. It reported 40,363 passed, 15 failed, 80 skipped tests, plus five approximately 4 GB V8 worker heap failures. All five interrupted files subsequently passed in the clean focused proof. Untouched pinned main reproduced 14 of the 15 failed assertions and the heap-limit failure. The two HTTP entry failures and the human provenance/steering failure also reproduce on main. The macOS web-fetch case invokes unsupported GNU
stat -c; repository snapshot setup rejects the volume ancestor permissions. No platform or security guard was bypassed, and no budget was raised.The earlier broad run recorded one intermittent cron DNS-deadline timer-count failure: clean replay on that head passed 19/19, isolated main passed 19/19, and the matching main cron group passed 2,470/2,470. The original failure and replay evidence are retained; no fix or proven root cause is claimed here. The remaining 14 broad assertion failures reproduce on untouched main.
All six failed jobs in prior CI run 40791570133 were diagnosed from logs fetched once and reproduced locally on the prior head or its actual CI merge. The exec authority regression was red on the redo base; delayed-node caller custody was red before its fix. The omitted-session-key row is green-only proof. An earlier interrupted run's native configuration-unload failure did not recur in the final seven-case recovery file; no repair is claimed. Live provider flags stayed off; no live Gateway, user state, deployment or release was touched.
The architecture failure is repaired at the contract owner:
NodeSystemRunEventSourcenow lives in the existing type-onlynode-invoke.types.tsleaf, so invocation types do not depend on the system-run implementation. The Madge guard reproduced one cycle before this repair and reports zero afterward; runtime cycle guard also reports zero. No exemption or baseline change.The requested pr-simplify pass removes 25 production lines versus the pre-simplification revision: inline the now-single-caller exec-notice enqueue helper at its owner, remove the impossible missing-receipt branch and unused exports, and share suppression cleanup. Existing authority, policy, routing and receipt-settlement behavior remain covered.
Necessary delayed-node growth against the merge base:
NodeRegistryinto its existing system-run owner.Node exec handoffs preserve the captured logical
globalsession and loaded agent owner; owner-prefixed queue identities are used only for occurrence storage and cleanup. The prior inlining accidentally passed the queue key to the handoff. The two existing global-owner assertions reproduced red ondc07bd49; current main56e3422cpasses all six cases. This repair fixes the product and keeps those assertions unchanged.The final exact-head local replay includes all three files matching
src/gateway/server-node-events*.test.tsandsrc/gateway/*system-event*.test.ts, plus the original 19 focused files (21 unique files); all 430 tests pass. Core/affected-test typechecks, lint, format, caps/ratchets and both cycle guards also pass. Full CI remains required before coordinator merge.