Repository navigation
refactor(state): reuse worker output contract and simplify row refresh - #159473
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 27, 2026, 8:26 AM ET / 12:26 UTC (Revision 6). ClawSweeper reviewWhat this changesThe branch passes a dirty session row’s identity directly to its Gateway refresh operation and derives the shared-state worker’s result type from its backend contract. Merge readiness✅ Ready for maintainer review Keep open. Current main still has the lint-triggering code, while the merged native-fixture repair addressed a separate prerequisite. The introduced changes preserve the inspected row-refresh and worker-output contracts. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway session-row projection turns committed session changes into rows used by session reads. Separately, the shared-state worker receives state commands, performs SQLite work, and returns typed results. flowchart LR
A[Session changes] --> B[Dirty session rows]
B --> C[Gateway row projection]
C --> D[Session read response]
E[State commands] --> F[Shared state worker]
F --> G[SQLite state]
F --> H[Worker result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -7. Total -7 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the single backend output contract and the existing dirty-row refresh order while restoring strict lint compliance. Do we have a high-confidence way to reproduce the issue? Yes. Current main retains the reported expression under the repository's 700-line rule, and the PR body gives a specific 701/700 strict-lint result; this review did not execute lint. Is this the best way to solve the issue? Yes. The row identity remains evaluated inside the same guard, and the backend contract already defines the worker's output union. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 69809d7a9427. 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
HistoryReview history (5 earlier review cycles)
|
57bb5dc to
8f2d542
Compare
|
Merged via squash.
|
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases. Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward. Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
openclaw#159473) * fix(codex): keep native completion fixture within lint policy * refactor(state): reuse worker output contract and simplify row refresh
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases. Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward. Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases. Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward. Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases. Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward. Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases. Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward. Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases. Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward. Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
* refactor(infra): deslop infra fifth pass Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases. Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward. Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650. * refactor(infra): name the directive migration parser explicitly Distinguish the directive parser from the media-persistence parser, whose error contract differs, and update both internal callers. Preserve JSON parsing, migration errors, and persistent behavior. Linux Testbox: exact export-collision guard, targeted lint, core types, 45 migration/archive tests, import boundaries, and build passed. Fresh Codex P0-P2 review is clean. * refactor(infra): retain canonical reader diagnostics after rebase * refactor(infra): retain explicit ClawHub guard entries
* refactor(infra): deslop infra fifth pass Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases. Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward. Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by openclaw#159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in openclaw#159650. * refactor(infra): name the directive migration parser explicitly Distinguish the directive parser from the media-persistence parser, whose error contract differs, and update both internal callers. Preserve JSON parsing, migration errors, and persistent behavior. Linux Testbox: exact export-collision guard, targeted lint, core types, 45 migration/archive tests, import boundaries, and build passed. Fresh Codex P0-P2 review is clean. * refactor(infra): retain canonical reader diagnostics after rebase * refactor(infra): retain explicit ClawHub guard entries
Related: #158940. Unblocks the inherited strict projection lint failure in #151674.
What Problem This Solves
Strict ordinary lint rejects the resident session-row projection at 701 counted lines against its existing 700-line limit. The projection has a one-use identity binding, and the shared-state dispatcher independently reconstructs an output union already owned by its backend contract.
User Impact
No intended behavior, schema, permission, protocol or configuration change. The row identity is evaluated the same number of times, in the same order, inside the same dirty-row guard. The worker reuses its existing backend output type. No limit, baseline, suppression or test assertion changes.
Why This Change Was Made
Pass the identity directly to the existing refresh operation and derive the worker return type from
OpenClawStateWorkerBackend['execute']. The composed branch retains current main's canonical completion observer from #159553; there is no remaining fixture change or dependency on the closed #159550.Evidence
Current main
7f43b351has exactly the failing projection blobe8b90850. Strict type-aware lint reproduced 701/max700 withGITHUB_ACTIONSunset, then passed for both changed production files. Formatting and diff checks pass.All 26 existing projection tests passed before and after, exercising dirty-key refresh, row identity, aliases, lineage and current facts. Vitest file durations were 93.35 seconds before and 59.47 seconds after on the development host; these are validation measurements, not a performance claim. No tests were added or weakened.
Node 24.21's TypeScript transform emitted byte-identical worker JavaScript before and after the output-type change: SHA-256
26e3fea827d3121765c69bbc57051002759a9afdbb59466f9b2fe7f14f143552. Fresh independent review of the complete composed diff is clean through P2. The final production hunks are unchanged from the original reviewed PR; its earlier Testbox and full-check evidence is retained. Core typechecking also passes on the final composition. Fresh CI and hosted review qualify merge headb12a1d913e5e4cb0c8c23a0c2a03f69703cbae2abefore landing.The first refreshed CI used an older merge context and exposed an inherited provider installation type error. Canonical fix
57f12db99ee3restores the producer contract and is now an ancestor of this candidate. The PR does not introduce a separate provider repair; the failed run and its source identity remain retained.