Repository navigation
refactor(config): deslop config third pass - #159054
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: blocked before merge. Reviewed September 26, 2026, 2:49 PM ET / 18:49 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch consolidates duplicated configuration validation, plugin activation, and session storage logic while aiming to preserve existing behavior. Merge readiness⛔ Blocked before merge - 5 items remain This is a distinct third cleanup pass; the two related passes are merged, but current main still has the code this branch consolidates. I found no definite introduced defect. The captured PR evidence still leaves fresh setup and current-head upgrade compatibility unverified. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw loads operator configuration to validate settings and select plugins before the Gateway starts. The Gateway then reads and writes session state for conversations, history, recovery, and cleanup. flowchart LR
A[Operator configuration] --> B[Load and validate]
B --> C[Plugin selection]
B --> D[Gateway]
D --> E[Session reads and writes]
E --> F[SQLite session state]
F --> G[History and recovery]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the consolidated owners only after fresh setup and an existing-state upgrade confirm preserved defaults, plugin activation, migration outcomes, and session history. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor reports no independent product defect; review turns on preserving existing behavior. Is this the best way to solve the issue? Yes, provisionally: the inspected changes reuse existing owners and reveal no definite defect, while installation-path compatibility still needs confirmation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 910145c4195d. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 |
985be77 to
d7ec402
Compare
What Problem This Solves
The third config cleanup pass removes remaining duplicate projections, schema/type declarations, and forwarding code across config and session storage.
Related: #157146, #158295. This is a maintainer-requested subsystem sweep following those passes.
User Impact
No intended user-visible change. Config acceptance, rejection messages, keys, public exports, secret redaction and resolution, Doctor migration order, config/include writes, environment substitution, audit records, session authority, transactions, and retention keep their existing contracts. No new migration or operator action is needed.
Why This Change Was Made
The production sweep read the whole config subtree, largest files first. The resulting diff removes 1,264 net production lines (+1,215/-2,479); tests and schema baselines are unchanged.
Fixes Found Along the Way
No independent product defect has been confirmed during the sweep.
Evidence
Current head
d7ec402c6a4668cb35eb62a8836b534fc3fa47bais green in hosted CI, includingopenclaw/ci-gate, Linux/Windows selections, types, lint, build, and guards.Remote validation passed on Blacksmith Testbox
tbx_01m3ffjdj9b4v3x9yjqpjb3vqs(runner). The wrapper's transport commit wase23e36ab6ad2deda468076a11ff6be8c928ddcb4; the validation shell asserted its physical checkout and exact source tree9da97dfeb5c539bdea927f0ad0c3bd40af2cdea0, matching the PR head, before installing frozen dependencies and running any gate. The complete command and both Docker lanes exited 0; Docker cleanup joined.node scripts/check-changed.mjs --base df50212501d139a38d264f15f2a62b4a2ca501f8 --head HEAD: passed, including core types, all 25 core test-type shards, dead-export scanning, lint with zero warnings/errors, channel metadata, config documentation baselines, and structural guards.run-vitestselection:src/plugin-sdk/api-baseline.test.ts,test/scripts/native-declaration-boundary.test.ts,src/config/issue-location.test.ts,src/config/schema.test.ts,src/config/env-preserve.test.ts,src/config/config.env-vars.test.ts, andsrc/config/sessions/session-accessor.sqlite-mutation-worker.runtime.test.ts. Passed 288 tests across seven files/three shards in 41.32s, with three existing platform-specific skips.node scripts/run-vitest.mjs src/config src/plugin-sdk/channel-policy.test.ts packages/gateway-protocol/src/talk-config.contract.test.ts src/commands/doctor/shared/legacy-config-migrate.test.ts src/commands/doctor/shared/legacy-config-migrate.e2e.test.ts: all five shards passed in 1,231.38s including runtime preparation. Runtime-config passed 6,476 tests across 473 files in 747.10s, with six existing skips; the other shards passed 288 tests, including 17 Doctor migration E2E tests.pnpm build: passed in 6m 17.8s, including all 158 public plugin SDK subpaths.node scripts/package-openclaw-for-docker.mjs --skip-build --allow-unreleased-changelogproduced the candidate tarball and passed package integrity checks.node scripts/test-docker-all.mjswithOPENCLAW_DOCKER_ALL_LANES='published-upgrade-survivor npm-onboard-channel-agent'passed both lanes on their first attempt: published updater in 317s and clean onboarding in 103s.The published-updater cell used
[email protected]→ candidate2026.9.6, scenariobase, and manual restart. Its inspected receipt recordscandidateInstallMode=updater,updateOutcome=success, andupdateRecovery=null; installed package identity, automatic migration before standalone Doctor, post-Doctor config validation, config/session-state survival, and Gateway health/readiness/status all passed. Startup took 27s; the three probes took 1s each. Env-backed SecretRefs are covered by this fixture;$includeand${VAR}preservation are covered by the config tests rather than this updater cell.The clean-install lane starts from an asserted empty home, installs the candidate npm tarball with its matching companion package, performs noninteractive onboarding using SecretRefs, checks channel/config/status surfaces, runs Doctor and a mocked model turn, and proves installed Gateway startup/restart with persisted execution identity. This is packaged CLI/Gateway proof with synthetic credentials, not a live channel or model-service claim. Together, these results address the automated review's outstanding first-install and current-head existing-state compatibility requests. No stored format or migration contract changes in this PR.
This PR changes no tests, config schema snapshots, or validation baselines. The assertion-safety baseline only shrinks to match removed assertions. Earlier validation attempts lost SSH transport; the completed run used heartbeat/log supervision. An attempted local fallback was stopped because of host load. The first hosted run exposed an unrelated SDK fixture whose diagnostic-method spy had become stale after main moved validation into emission. The branch was rebased onto main's repair
2b2ae319c923751bc9621af6942867ccf4f3302e(also tracked in #159085), preserving the patch, and current-head validation above passed.Independent review disposition
Codex autoreview completed at P2 scope. Its four findings were checked against the full source and rejected; none is an accepted/actionable finding:
restart-recovery-receipt.ts: bothhasActiveClaimandhasClaimlessLiveDeliveryStatealready requireentry.sessionId === scope.sessionId. The removed caller comparisons duplicated these unchanged fences.session-accessor.sqlite-maintenance-store.ts:applySessionEntryMaintenanceInDatabasereturns an empty plan formaintenance.mode === "warn"before its sole call to the privatecanSkipSessionEntryMaintenanceInDatabasehelper. Warn-only mode still cannot reach enforcement.store-maintenance-operations.ts:applyEnforcedMaintenancecreates a new local map, and its only setter writesundefined. The planner callback finishes before the map reaches cleanup; no concrete transcript path can be overwritten by that setter.session-accessor.types.ts:SessionTranscriptAccessScopeexplicitly retainssessionFile?: string, so intersecting it with the requiredsessionKeypreserves the deprecated locator. All core test-type shards, including public SDK callers, passed.