Repository navigation
fix(gateway): retain first-send consent database custody - #170716
Merged
Merged
Conversation
Carry the initialization snapshot physical source into its existing commit guard so first-send native-runtime consent cannot create a session in a replacement database. Preserve both-store emptiness and no-admission regression assertions.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Contributor
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. |
…redmain-native-consent-source
This was referenced Oct 13, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 14, 2026
…nclaw#170716) ## What Problem This Solves First-send native-runtime confirmation must keep session creation bound to the physical database read during preparation. Scheduled main CI found that replacing that database before commit could leave an initialized session row in a store that was not the prepared owner. The regression came from `9dc20c232a5293f429234eb327bd5b1c961cb230` (openclaw#170536): removing duplicate target-absence checks also dropped source custody. The snapshot owner already captured the database identity, but discarded it; commit then captured the replacement. This is a real user-data custody boundary, so the check stays at the creation effect. This change carries the snapshot's existing `databaseSource` into the existing final initialization guard. It adds no check, SQL statement, worker request, or handshake. Cohort-reader and in-memory callers retain their behavior. The removed target-absence checks stay removed. The regression keeps its assertions that both stores remain empty and no reply or run is admitted; only the expected error text changes. ## Evidence - Existing failure: [scheduled run 38352378612, compact-large9](https://github.com/openclaw/openclaw/actions/runs/38352378612/job/115147565692), at `ddb003ef80607326ec14581c2670ae5407af1b14`. - Changed-file oxfmt, plain oxlint, and `git diff --check` passed. Private-content scans and the repository formatting hook passed at commit. - Codex autoreview: scoped-clean through P2, one completed review attempt. - Candidate behavioral proof: [focused CI 38357203921](https://github.com/openclaw/openclaw/actions/runs/38357203921/job/115162748437) passed the exact original case `rejects first-send consent when its captured database owner is replaced` on the reviewed candidate. One case passed, nine were filtered; case 11.094 seconds, Vitest 55.76 seconds, wrapper 62.55 seconds. The workflow verified pinned source and a clean final source diff. No local suite or broad static scan ran under compute conservation. No warmed-path SQL or T1 performance change is claimed; no harness run was needed. Source scope is three files, **+18 / -5**. Reviewed candidate: `a98eaf10ecf23b194e7b4c722012added4d2c8ed`. Ordinary CI 38355813699 exposed three other failures: orphan recovery also fails scheduled main (run 38352378612, job 115147565399); the recovery fixture type error is fixed by openclaw#170722 (`b47aa9f9`); the auth endpoint fixture failure is fixed by openclaw#170735 (`e5a6bd5c`) after baseline reproduction of all five errors and a five-case candidate pass. Integrated head `9da579411f381299ced29ed7473cb1c8059a7659` merges main `116f0502239e7f1cd4a85f57331f986f616e8939`, including both landed repairs without conflicts; the original failures remain evidence and are not represented as passing CI. The integration preserves the reviewed three-file patch (+18/-5). Changed-file formatting, oxlint and diff checks passed on the integrated source; fresh ordinary CI completed all runtime and static jobs. The exact-case hosted proof above remains evidence for the unchanged repair. Final integrated-head CI: build, production/test types, lint, architecture, security and database ratchets passed (T1 454 → 454; compatibility calls 9 → 9; dialect groups 0 → 0). The sole failed test is the unchanged orphan-recovery case in [38360337902/job115173163487](https://github.com/openclaw/openclaw/actions/runs/38360337902/job/115173163487): expected provider count 2, got 1, with the capability-preparation error. This matches [scheduled main 38352378612/job115147565399](https://github.com/openclaw/openclaw/actions/runs/38352378612/job/115147565399). Landing uses the authorized inherited-failure exception; CI is not represented as green. The separately landed orphan repair remains subject to its own original-flow proof.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
First-send native-runtime confirmation must keep session creation bound to the physical database read during preparation. Scheduled main CI found that replacing that database before commit could leave an initialized session row in a store that was not the prepared owner.
The regression came from
869ceef2c25f9c966bfb574b6f5206d1fc685039(#170536): removing duplicate target-absence checks also dropped source custody. The snapshot owner already captured the database identity, but discarded it; commit then captured the replacement. This is a real user-data custody boundary, so the check stays at the creation effect.This change carries the snapshot's existing
databaseSourceinto the existing final initialization guard. It adds no check, SQL statement, worker request, or handshake. Cohort-reader and in-memory callers retain their behavior. The removed target-absence checks stay removed. The regression keeps its assertions that both stores remain empty and no reply or run is admitted; only the expected error text changes.Evidence
4e3b11bf5c8d011bf1b690424862737b06493a63.git diff --checkpassed. Private-content scans and the repository formatting hook passed at commit.rejects first-send consent when its captured database owner is replacedon the reviewed candidate. One case passed, nine were filtered; case 11.094 seconds, Vitest 55.76 seconds, wrapper 62.55 seconds. The workflow verified pinned source and a clean final source diff. No local suite or broad static scan ran under compute conservation.No warmed-path SQL or T1 performance change is claimed; no harness run was needed. Source scope is three files, +18 / -5. Reviewed candidate:
a98eaf10ecf23b194e7b4c722012added4d2c8ed.Ordinary CI 38355813699 exposed three other failures: orphan recovery also fails scheduled main (run 38352378612, job 115147565399); the recovery fixture type error is fixed by #170722 (
605065ce); the auth endpoint fixture failure is fixed by #170735 (66f611cd) after baseline reproduction of all five errors and a five-case candidate pass. Integrated head9da579411f381299ced29ed7473cb1c8059a7659merges main0348a2526c561d8ccce61bfd23931024a6b8f13e, including both landed repairs without conflicts; the original failures remain evidence and are not represented as passing CI.The integration preserves the reviewed three-file patch (+18/-5). Changed-file formatting, oxlint and diff checks passed on the integrated source; fresh ordinary CI completed all runtime and static jobs. The exact-case hosted proof above remains evidence for the unchanged repair.
Final integrated-head CI: build, production/test types, lint, architecture, security and database ratchets passed (T1 454 → 454; compatibility calls 9 → 9; dialect groups 0 → 0). The sole failed test is the unchanged orphan-recovery case in 38360337902/job115173163487: expected provider count 2, got 1, with the capability-preparation error. This matches scheduled main 38352378612/job115147565399. Landing uses the authorized inherited-failure exception; CI is not represented as green. The separately landed orphan repair remains subject to its own original-flow proof.