Repository navigation
perf(gateway): keep migration preflight imports light - #188876
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
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. |
This was referenced Oct 31, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 31, 2026
Keep the existing migration assertion as a leaf and move its unchanged execution to the direct runtime owner. Move two shared helpers to their existing owners to remove eager backedges. Read all plugin migration obligations first and skip the pending-only read when empty, retaining separate pending-status handling otherwise. Synthetic graph counts: 1616 to 958 source modules and 778 to 424 compiled chunks. Empty pending-only reads: 1 to 0. The raw whole-flow cohort is confounded by unchanged startup/usage work; no total-work or latency improvement is claimed. Exact-head PostgreSQL approval, two isolated production reviews, focused regressions, CI/three PostgreSQL shards, and published-driver update qualification are recorded in the PR.
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.
Problem and change
Gateway config preflight imports session migration execution/recovery although it only needs the migration-complete assertion. Keep that assertion as one leaf implementation and move the byte-identical execution body to its runtime owner. Move two shared helpers to their existing owners to remove eager backedges, and update callers/mocks without a compatibility reexport.
Plugin readiness reads all pending/deferred obligations first and returns when empty. Nonempty startup still reads pending status separately: decoded obligations do not retain status and cannot replace that query. Admitted live reads, leases, inspection, config publication, settlement, warnings, legacy/deferred receipts, ambiguity refusal and profile-aware Doctor guidance remain. No schema, integrity, identity, transaction, security or MAIN-floor change. C and E remain held.
Acceptance and measured work
Acceptance was published before measurement: committed teamBoot workload, compiled isolated Gateway, eight synthetic agents / 10,000 sessions / at least 5 GiB of synthetic state on internal disk, real authenticated WebSocket reads, plugin post-bind and cleanup. Intended cohorts: cloned/unsealed and retained boots, with empty/pending/deferred obligations kept separate. Win: shrink the static eager graph with four heavy owners absent; empty readiness two reads→one, no attributable MAIN increase or extra nonempty request. Any adverse cell of at least 20% stops for attribution. Timing requires the shared lock, load1 <24 and at least five interleaved pairs on the same platform; otherwise counts only, no latency/CPU or percentile claim.
These are static graph counts, not evaluated imports or a latency measurement. Four heavy owners are absent:
session-accessor.sqlite-import.ts,deferred-plugin-session-empty.ts,deferred-plugin-session-verification.ts,openclaw-agent-db.ts. Base isbdb7d4ad4afb4b337e9908b752d663bcffa48624; candidate graph was measured at7b8bc57fc19e96a0dfb129749dc3ee690cc35216, whose production/scripts match finalfe80c3bb52aea1aee49a3d8b85be7c61d8140596.Empty pending-only SELECTs fell 1→0 in both native states; existing all-obligation reads remain unchanged. SQL shapes still select
id, report_json, statusfrommigration_runswithid LIKE ?,status IN (?)orIN (?,?), ordered byid. Before: pending-only then all obligations. After: all obligations, then pending-only iff nonempty. No write intervenes; SQL text and write envelopes are unchanged.Adverse raw counts and attribution
The one-pair whole-flow cohort is nonpassing and confounded: fresh all-process SQL/requests 3,407/682→5,116/856, Gateway MAIN 1,151→1,153; retained SQL 4,047→6,866. These values are retained, not averaged away, and establish no total-work or retained-seal improvement.
Fresh MAIN adds two existing legacy scans: six→eight distinct agents, one scan each, no duplicates. Retained scans reached eight→five agents. All 3,234 retained-candidate shutdown payload reads come from unchanged usage-rollup backfill. The moved execution body and 13 relevant owner files are unchanged; plugin post-bind does not drain the independent canonical/transcript/usage owners. Two independent audits found no B/D-created invocation or added-work path.
The coordinator accepted qualification on the narrow import/read counts after this attribution. Separate native pending/deferred arms were not run; their behavior is covered by focused owner tests and PostgreSQL conformance. No total SQL, MAIN, CPU, latency or size-scaling improvement is claimed. An optional fixture-completion experiment was discarded without a production or benchmark commit and is not acceptance evidence.
Behavior, review and size
Owner/runtime 214 + Doctor 49 tests passed. Three missing-import fixture errors were corrected and replayed; nine source-recovery, fourteen prefix, readiness/import regressions and four final benchmark cases passed. Read-count/import regressions fail on base. Two isolated production reviews plus correction/workload/CI-fixture delta reviews are clean. Assertions remain; mock-baseline change is shrink-only.
Production +11 LOC, tests/helpers −3 LOC, tooling +195 LOC, other −1 LOC. The module boundaries require modest production growth. Source-based worker and dialect ratchets remain active; unrelated generated Markdown drift was excluded. The benchmark adds two synthetic preparation transactions, not Gateway runtime work.
Final qualification and overlap
Exact final head
fe80c3bb52aea1aee49a3d8b85be7c61d8140596: qualification 41151959662 passed types, all five typed-lint shards, lint, dependencies/Knip, source contracts, architecture/Madge and ratchets. All three actual PostgreSQL conformance steps passed: jobs 124390684084, 124390684129, 124390684061.The actual published-driver update job 124392608480 passed, including the executed
Run targeted Docker E2E lanesstep. Its source is7b8bc57fc19e96a0dfb129749dc3ee690cc35216; the final-head delta is only three test-fixture lines and removal of an obsolete mock-baseline line. All production and benchmark scripts are byte-identical, so the update result is reused under the test-only rule.A nonrequired SDK documentation contract test fails identically on main
a32d79a2c763:exec-approvals-runtimeis documented without its typed public declaration. All six inputs are byte-identical. This is an attributed inherited failure, not a passing test. Other unrelated nonrequired broad failures are not claimed as inherited or repaired. Fail-closed scripts verify the exact head, required checks, named static gates, actual PG/update execution and current indexed overlaps before the merge.Six-item PG review: unchanged SQL/write envelopes; same result sets/decoding; no cache/generation shortcut; unchanged schema/admission/integrity; no work moves to MAIN; focused red/green owner proof plus three actual PG shards. Exact-head coordinator approval is recorded for
fe80c3bb52aea1aee49a3d8b85be7c61d8140596.Paired base-only/base+candidate merge trees across 92 indexed open-main peers add zero conflict paths or blocks. The exact peer identities and source proof hashes are recorded in the local final overlap report; no exception applies.
Open PR overlap inventory (all: zero added paths/blocks)
#188890, #188577, #188492, #188479, #188397, #188063, #187924, #187824, #187495, #187281, #187269, #187268, #187104, #186896, #186891, #186793, #185928, #185841, #185615, #184863, #184750, #184370, #183825, #183729, #183696, #182701, #181807, #181303, #181057, #180539, #180286, #180233, #177351, #177190, #175490, #174972, #174943, #172313, #171189, #170165, #169241, #168956, #168615, #168054, #167706, #167703, #167471, #167292, #166965, #166488, #166166, #166140, #165824, #165766, #165486, #165039, #164229, #163835, #163377, #163267, #161997, #161339, #160332, #159569, #158723, #158419, #158030, #157679, #157292, #156344, #155106, #153511, #149906, #149882, #149241, #147932, #147886, #145895, #144065, #141004, #140609, #137788, #137594, #137435, #136554, #136476, #136274, #135296, #129388, #129191, #126924, #101294