Repository navigation
refactor(runtime): deslop impossible internal states - #165236
Conversation
Use canonical typed owners for bundled SDK capabilities, config and prompt results, normalized attachments, channel state, and UI projections. Remove the private ACP-only driver registry and copied interface/projection layers. Preserve external input validation and authority, lifecycle, and storage checks. Fix Matrix recovery-key confirmation by verifying authenticated key metadata instead of indexing a secret-name status map by storage-key ID. Retain the existing backup-transition fallback and reject wrong keys or a changed active key.
|
🦞👀 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: blocked before merge. Reviewed October 4, 2026, 11:19 PM ET / October 5, 2026, 03:19 UTC (Revision 3). ClawSweeper reviewWhat this changesThis PR simplifies internal runtime, plugin, provider, and UI contracts and fixes confirmation of valid Matrix recovery keys. Merge readiness⛔ Blocked before merge - 4 items remain The Matrix recovery-key fix remains useful and is absent from current main and the latest release. The previously reported OC Path baseline finding remains unresolved; no additional blocking runtime defect was established. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s runtime connects configured providers, channel plugins, browser operations, and the Control UI through shared typed contracts. Matrix recovery verification checks supplied key material before retaining it for encrypted account recovery. flowchart TD
A[Configuration and user requests] --> B[Typed runtime owners]
B --> C[Providers and channel plugins]
B --> D[Browser and Control UI]
E[Matrix recovery key] --> F[Authenticated key check]
F --> G[Active key recheck]
G --> H[Retain or discard recovery key]
Before merge
Findings
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep the canonical typed owners and authenticated Matrix recovery check, with the suppression baseline accurately reflecting the remaining exceptions. Do we have a high-confidence way to reproduce the issue? Yes, from source: the removed suppression and retained baseline entry deterministically violate the local ratchet, and the current-head hosted annotation names the same entry. No local tests were executed. Is this the best way to solve the issue? Yes, the owner-based simplifications and shared authenticated key check are appropriate; the remaining baseline correction is mechanical. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 417d5c306fff. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Evidence: inherited Control UI failuresThe UI failures from CI run 37254795343 were reproduced independently in a clean checkout of main
The metadata change is attributable to main commit The sidebar is owned by the application shell, outside the changed router outlet. The metadata failures also reproduce with main's unmodified outlet. No assertions, timers, thresholds, or retries were changed to qualify these results. Baseline commands used The initial Windows declaration-fixture failure was separately reproduced in unrelated PR #165225, run 37248949425, job 111572759573. Main fixed the missing |
* refactor(runtime): deslop impossible internal states Use canonical typed owners for bundled SDK capabilities, config and prompt results, normalized attachments, channel state, and UI projections. Remove the private ACP-only driver registry and copied interface/projection layers. Preserve external input validation and authority, lifecycle, and storage checks. Fix Matrix recovery-key confirmation by verifying authenticated key metadata instead of indexing a secret-name status map by storage-key ID. Retain the existing backup-transition fallback and reject wrong keys or a changed active key. * test(matrix): initialize crypto fixtures independently * test: align SDK fixtures with native contracts * refactor: preserve concrete contracts in deslop * test: honor native browser and Matrix fixture contracts * test(channels): document ACP fixture isolation
#165236 shrank extensions/oc-path/src/oc-path/universal.ts under the max-lines budget, so the shrink-only ratchet requires removing its grandfathered entry. Main's check:changed failed on it (run 37266484130).
openclaw#165236 shrank extensions/oc-path/src/oc-path/universal.ts under the max-lines budget, so the shrink-only ratchet requires removing its grandfathered entry. Main's check:changed failed on it (run 37266484130).
What Problem This Solves
Internal code repeatedly rechecks shapes guaranteed by its current owners and pinned dependencies, making real validation and lifecycle boundaries harder to follow.
User Impact
The cleanup preserves config, persisted data, protocol shapes, CLI output, model-facing text, and visible UI. A Matrix fix also stops valid recovery keys from being discarded when verification does not newly enable a backup. Wrong keys and a changed active key remain rejected.
Why This Change Was Made
This is one cross-cutting batch of simplifications, with validation retained at external, persisted-data, permission, and ownership boundaries.
Fixes Found Along the Way
Matrix's
secretStorageKeyValidityMapis indexed by secret names, but recovery verification indexed it by storage-key ID. It reports stored-secret coverage, not cryptographic key validity. Recovery verification now shares the existing authenticated key-check owner, requires IV/MAC metadata, validates the key's MAC, and rechecks the active key after the awaited validation. The existing independently proven backup transition remains available when key proof is unavailable.Evidence
Production change: 1,104 added / 2,158 removed = 1,054 net production lines removed, excluding tests, fixtures, documentation, and generated files.
Validation used isolated Linux on Hetzner, Node 24.21.0, and pinned pnpm 12.5.1. The final test-only correction is bound to reviewed and tested tree
33b3f530433725fc594c55d9eb65f913482046f9; passing results for unchanged inputs were retained:expected false to be true).Commands included
node scripts/run-vitest.mjswith the five changed Matrix suites,scripts/check-madge-import-cycles.tsandscripts/check-import-cycles.ts,scripts/run-tsgo.mjswith the four owning graphs, andscripts/run-oxlint.mjswith the touched paths. Hosted CI 37258399667 passed on exact head16f759397ec33905dc96f4414265b92512e50a1e: 81 jobs succeeded and 20 were skipped. Squash auto-merge completed asae6676dc252516ebe479631d474fe66531f4df01; merge ancestry was verified on fresh main.Validation also caught two incomplete test fixtures: an onboarding timeout response lacked native Headers, and a Matrix backup-error case depended on a missing SDK method. The fixtures now model the actual Fetch/SDK contracts while retaining their original assertions. Matrix event fixtures were extracted intact to satisfy the file-growth ratchet.
The first hosted CI correction supplies the required native browser event lifecycle and Matrix room-list promises in two test doubles, retaining their assertions. Both suites pass all 18 tests on Hetzner; both cycle checks remain at zero, and the affected test typecheck and lint pass. The assertion baseline was regenerated with its owner and only shrank (26 assertions).
The second CI correction documents the existing ACP mocks' genuine import-time isolation and removes two obsolete mock-baseline entries for the deleted registry suite through the owning generator. The two ACP suites pass all 26 tests (17 seconds including setup); lint passes, both cycle checks remain at zero, and the regenerated mock-export ratchet passes with 10,774 entries.
Inherited Control UI failures were reproduced on clean main
43856f78ec629f0c72180359a0ce85f06759974f, without this PR: the sidebar suites produced 5 failed / 6 passed, and the full metadata-observation suite produced 2 failed / 14 passed with the same assertion values. These failing-baseline results are recorded separately from passing candidate proof and required no exception: the final exact-head CI run passed.