Repository navigation
fix(gateway): stop input effects after caller authority closes - #150640
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. Reviewed September 26, 2026, 12:30 PM ET / 16:30 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch checks live caller and request ownership before Gateway agent resets, input writes, media persistence, and reset confirmations, while preserving committed reset and delivery outcomes for retries. Merge readiness✅ Ready for maintainer review Current main still lacks the Gateway checks needed for this fix. The latest head addresses the earlier retry finding, and the supplied production-path proof covers the main authority and delivery cases. Keep the protected PR open for normal review and merge gates. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway accepts agent requests and prepares session input before an agent run starts. It records session changes and may send a reset confirmation through the outbound delivery system. flowchart LR
A[Agent request] --> B[Caller authority]
B --> C[Request reservation]
C --> D{Still current?}
D -->|Yes| E[Reset or stage input]
D -->|No| F[Reject new effects]
E --> G[Record outcome]
G --> H[Reply or confirmation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +96, Tests +1836. Total +1932 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one Gateway-owned live-authority check through reset adoption, input commit, and final delivery, with retry replay preserving the original committed outcome. Do we have a high-confidence way to reproduce the issue? Yes: registered agent RPC cases can revoke or replace a delegated caller while reset, input, or delivery is pending. I did not execute them on fetched current main; its source still shows the missing checks. Is this the best way to solve the issue? Yes. The branch composes the existing runtime-authority, reservation, storage, and delivery owners instead of introducing a parallel authority store or interface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against be46e6966c2b. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Preserve current caller and accepted-input custody, retain committed reset receipts, and prove the real authority boundaries. Co-authored-by: sallyom <[email protected]> Co-authored-by: vincentkoc <[email protected]>
3a60dfe to
8ccaaaa
Compare
Preserve committed reset idempotency without converting failed confirmation delivery into successful retry responses. Co-authored-by: sallyom <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Final land-ready verification — Gateway input authorityReviewed source: f36be49. No blocking findings. Best fix: compose the existing caller/admission/reservation owners before effects; record failed confirmation outcomes at their producer. Accepted-child custody remains independent. First-key interruption/cleanup policy is removed, not supplemented with a second authority store or retry path. Production +156/-60 (net +96); tests/support +1862/-26. Growth supplies the missing effect fences and committed-outcome reconciliation. Proof: eight genuine baseline assertion failures, fifteen passing controls; then all 23 boundary cases plus 646 sibling cases pass. Fresh core, all 25 selected type graphs and a literal build pass. Runs: RED, FULL, TYPES, BUILD. Final independent autoreview: two scoped-clean passes, no actionable findings. Public integration: CI 36255123412 is green, 122 successful / 23 skipped jobs. Required ci-gate and security checks passed. Gateway job 108440890712 actually executes all 23 authority cases within 1,096 passing tests / 92 files on merge 40367b7c (be46 + f36), including strict/ambiguous retry and accepted-custody controls. Raw log hash and checkout identity verified. Public build-artifacts was skipped—not a fresh build. Latest main 88816f7 also composes conflict-free; no material candidate-owner incompatibility found. Latest ClawSweeper review: no findings, Before merge: None, no new Rank-up moves. Prior strict-retry repair and explicit one-worker cost request are addressed. Serial process wall: 67.45 s; FULL job: 945 s—not a billing estimate or controlled speedup. Native review validation and Executed commands, contracts and limitsPinned CI recipes ran /usr/bin/time -f 'PR150640_PROOF wall_s=%e user_s=%U sys_s=%S maxrss_kib=%M exit=%x' env OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/gateway/server.agent-runtime-authority-proof.test.ts --maxWorkers=1 --reporter=verbose --reporter=github-actions --reporter=./scripts/lib/vitest-resource-reporter.mts
pnpm tsgo:core
node scripts/run-tsgo-core-test-shards.mjs --changed-paths-json "$changed_json"
pnpm buildSibling Personally checked upstream Codex at e766f7598993ce37cf61b9c26c80cc2ba3a4f2d7, SQLite/transcript/media and Gateway authority owners are real; inference and recording channel adapter are synthetic. Process-local dedupe remains five minutes / 1,000 entries, not durable exactly-once. The pre-existing F-RESET-POSTCOMMIT-NOTIFY callback/notification gap stays named in the PR body, not claimed repaired. This lands the input-authority slice of #135838, not that entire batch. |
|
Merged via squash.
|
…law#150640) Preserve live caller and reservation ownership across Gateway reset, input, media and confirmation effects. Keep committed reset outcomes and strict-delivery errors truthful on retry without repeating effects or overwriting newer reservations. Related: openclaw#135838. This lands the input-authority slice, not the entire remaining replacement batch. Verification: 23 owner/effect cases plus 646 sibling cases; fresh core and 25 consumer type graphs; fresh build. Baseline demonstrates eight genuine assertion failures with fifteen controls. Final public checks and native guarded landing gates are required on the same source head. Work session: https://team.openclaw.ai/chat/roboclaw/dashboard/70f8933b-db6b-4809-b9a8-941957263614 Co-authored-by: sallyom <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Related: #135838
Additional instructions
Allow edits from maintainers remains enabled.
What Problem This Solves
Fixes an issue where users cancelling or replacing a delegated request could still see a session reset, queued input, saved media or a reset confirmation. Also fixes retries that repeated a completed reset or incorrectly reported success after confirmation delivery failed, and old request cleanup overwriting a newer request’s status.
Why This Change Was Made
Compose the existing caller/session guards with canonical reservation ownership across preaccept effects, interruption, cleanup and lifecycle rotation; release caller-admission assertions only when input synchronously transfers to the accepted child. Retain the original reset and reply outcomes without repeating effects, while preserving client-authority forwarding, operator cancellation, sessionless/recovery/settle-wake paths and existing test coverage; remove duplicated first-key cleanup/interruption policy.
Production: +156/-60 (net +96); tests/support: +1862/-26. Production growth supplies previously missing live authority and all-key ownership checks plus committed-reset/error reconciliation across existing owners; no second store, fallback execution path or cached authorization is added.
User Impact
Contributor credit: @sallyom and @vincentkoc.
Work sessions
Evidence
Normal-hook source
f36be495d0330fd3377e6f6c33caa4fe2d21cc14, parent8ccaaaae043181a9a7861ef4b4c8ad1dfe614351, treebdb45af3662396a775f060f44e625c014acfc6c1. The downloaded artifact, ZIP digest, bundle, parent/tree/patch, bot author and both exact human trailers were independently verified.bdb45aftree passed. It is not reused v1 evidence or the skipped public build.8be6c5aseparately demonstrated eight failures/six controls. It is not conflated with the new8ccaaaaebaseline above.Final integration gates passed on source
f36be495d0330fd3377e6f6c33caa4fe2d21cc14. Public CI 36255123412 succeeded: 122 passed / 23 skipped jobs; requiredopenclaw/ci-gate, CodeQL, Critical Quality, OpenGrep and Security Review are green. Actual Gateway job passed all 23 authority cases within 1,096 tests / 92 files on synthetic merge40367b7c52f33f140febee0740e070f10ac1d47a(basebe46e6966c2b52c6cde06abf965c44f9a175a47f, tree37afd232b1fb20a8ba3e9337d19f10df508671bd). This is separate public composition proof, not relabeled private source-tree proof. Public build-artifacts was skipped; the fresh private literal build above remains the build evidence.Fresh ClawSweeper review, revision 3 on exact
f36be495, has no actionable findings or before-merge items; prior retry/cost requests are addressed. Latest main88816f79b42c0a85f9ecd1d99593d50554807092also composes conflict-free; subsequent owner-neighborhood drift was inspected. Native guarded preparation passed on the same source head. Landing is authorized through the repository-native guarded flow, without a freshness-only rebase or bypass.Observed behavior and measured proof cost
The 23 cells comprise 19 registered-RPC/effect cases and four real admission/cache/lease interruption controls, sharing the suite-level Gateway fixture. SQLite, transcript, media, authority owners and native Stop are real. Inference and a filesystem recording channel adapter are synthetic boundaries—not authenticated external-channel, provider, worker, ACP or Codex runtime proof.
Explicit one-worker measurement: resource receipts confirm one selected file and effective
maxWorkers=1. Fixed proof: 67.45 s full-process wall, 66.88 s repository-wrapper wall, 62.110 s native run elapsed, 9.474 s module tests/lifecycle duration, and 4.042 s summed printed case durations. Native collection—including transform waits—was 50.583 s; setup was 0.646 s. These distinct measurements are not interchangeable.FULL consumed 945 CI job-seconds, including checkout/setup; the complete validation recipe was 574 s. TYPES: 1,772 job-seconds; BUILD: 1,607 job-seconds; RED: 502 job-seconds. These are observed durations, not billing estimates or a controlled speedup claim. The fixture intentionally pays real Gateway/SQLite initialization once to cover final effects that the former mocked proof missed. No coverage was removed to reduce cost.
Build warnings: TypeScript experimental-API notices and the existing startup-CSS advisory with 1,036 bytes of hard-ceiling headroom. No baseline was raised; no causal CSS delta is claimed for this Gateway-only repair.
Named follow-up — F-RESET-POSTCOMMIT-NOTIFY: existing reset postcommit notifications/ACP metadata can precede the producer callback; incognito deletion has a separate unbinding path. A failure before that callback can withhold the committed fact. Those injected-failure paths were not proven or repaired here; this PR does not claim every possible postcommit failure is covered.
View the OpenClaw team session