Repository navigation
refactor(config): simplify remaining config helpers - #162097
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 30, 2026, 4:06 PM ET / 20:06 UTC. ClawSweeper reviewWhat this changesThe PR simplifies documentation exports and cron-owner classification, removes duplicate session-key normalization, and deletes an unused model-config type. Merge readiness⛔ Blocked before merge - 1 item remains Current main still contains the older helpers, so this focused cleanup remains useful. Source inspection found no introduced change to the examined config-write or session-key contracts. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw config helpers generate configuration documentation and guard config writes. Session-key routing maps inbound messages to persisted session buckets. flowchart LR
A[Config and message inputs] --> B[Config helpers]
B --> C[Docs schema loader]
B --> D[Cron owner check]
B --> E[Session key builder]
C --> F[Generated config docs]
D --> G[Config write or refusal]
E --> H[Session store bucket]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -17. Total -17 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Retain the canonical session-key builder and the existing cron refusal contract, then land the smaller helpers through the normal PR gates. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR reports no defect. Existing tests and the inspected source define the behavior it aims to preserve. Is this the best way to solve the issue? Yes: the patch reuses existing owners for normalization and documentation exports without adding a competing config path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7045908edbfc. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
## What Problem This Solves Finishes four small helper cleanups found during the maintainer-requested eighth config sweep. ## User Impact No user-visible change. Config schemas, defaults, environment handling, migration decisions, refusal order, and persisted session keys stay the same. ## Why This Change Was Made - Remove the unused `DiscoveryToggleConfig` type left after its model discovery fields were retired. It has no repository consumers or public SDK export; the still-used Bedrock type remains. - Re-export the docs baseline functions directly through the existing lazy runtime facade, preserving names and dependency order. - Let the canonical main-session-key builder perform main-key normalization once. - Classify cron ownership once instead of allocating two filtered arrays and repeating the same lookups. Production diff: 23 added / 40 removed, **17 net lines removed**. No tests changed. ## Evidence - Independent review found no actionable P0-P2 findings. - Blacksmith Testbox `tbx_01m3sxdrf1qfe6fc408sjgf0bf`, [run 36767521248](https://github.com/openclaw/openclaw/actions/runs/36767521248), verified the four source hashes against base `c3dd660f699728d5ba714e447f8484590d085f5d`. - 63 tests passed across docs baseline, cron ownership, session key, session path, and filesystem import-boundary suites. - Generated config docs hashes/counts, core typechecking, and changed-file lint passed. - Both import-cycle checks reported zero cycles. - No schema, generated snapshots, dependencies, or protected SQLite accessor files changed. ### Config compatibility assessment The review's requested compatibility assessment is complete. This changes no schema, default, environment variable, migration marker, redaction rule, or stored format. The docs facade exposes the same five operations in the same dependency order. Main-key normalization remains with `buildAgentMainSessionKey`, which already calls `normalizeMainKey`; persisted keys are unchanged. Cron classification preserves both predicates, counts, refusal order, and the existing repair/recheck path. The removed type has no consumers and is absent from public SDK exports. No updater or live-upgrade execution is claimed. ### Exact-head hosted CI [Run 36769831270](https://github.com/openclaw/openclaw/actions/runs/36769831270) completed on `91162736eeb2b9660af6c7c48ab32438ed70c23a`: 143 jobs passed, 22 skipped, two test jobs failed, and the CI gate failed downstream. Security-fast, dependency review, security-sensitive review, all selected types/lint/build checks, and architecture checks passed. `checks-node-changed-compact-large-26` ([job 110073528939](https://github.com/openclaw/openclaw/actions/runs/36769831270/job/110073528939)) fails `setup-inference.first-signin.integration.test.ts:420:38`: expected `confirm`, received `note`, in the same-owner sign-in/revoked-retry case. The identical failure is present on unrelated PR openclaw#162093, head `be4f3855425d239b494f77e308881b2b0c7a3157`, [run 36769218900 / job 110071456815](https://github.com/openclaw/openclaw/actions/runs/36769218900/job/110071456815). That PR changes only `src/agents/apply-patch-paths.ts`. The assertion was introduced by openclaw#162020, which is already this PR's base; no Gateway/authentication source or test changes here. `checks-node-changed-compact-small-4-1` ([job 110073535262](https://github.com/openclaw/openclaw/actions/runs/36769831270/job/110073535262)) fails `server.catalog-startup.test.ts:86:3`, “starts with provider settings without model rows when a channel is auto-enabled,” with `Test timed out in 90000ms`. The same case/error appears in the latest CI for unrelated PR openclaw#160471's still-current head `f007e2c16e02455a3ace3d5e803af02bccac4130`: [September 28 run 36428787158 / job 108950748546](https://github.com/openclaw/openclaw/actions/runs/36428787158/job/108950748546). This is independent current-PR evidence, not a claim that the latest hourly main reproduced the timeout. The docs facade is only loaded by docs baseline generation, the removed type has no runtime effect, and the session helper still applies the same canonical normalization. The cron change only combines synchronous classification; it adds no await, retry, startup operation, or changed refusal decision. The startup fixture has no legacy cron jobs. Gateway/catalog/auth source and both failing tests are unchanged by this PR. These inherited failures remain with the main-CI coordinator; no retry, timeout increase, assertion change, or main repair is included. The maintainer-authorized exception is pinned to the exact tested head and does not describe the hosted run as green. The catalog-startup test has identical Git blob `d60a895ece760b2cfb5f066acf0787a8a2ee4f11` at this PR's base/head and the independent PR head above.
What Problem This Solves
Finishes four small helper cleanups found during the maintainer-requested eighth config sweep.
User Impact
No user-visible change. Config schemas, defaults, environment handling, migration decisions, refusal order, and persisted session keys stay the same.
Why This Change Was Made
DiscoveryToggleConfigtype left after its model discovery fields were retired. It has no repository consumers or public SDK export; the still-used Bedrock type remains.Production diff: 23 added / 40 removed, 17 net lines removed. No tests changed.
Evidence
tbx_01m3sxdrf1qfe6fc408sjgf0bf, run 36767521248, verified the four source hashes against base3c0ae56c634e664ff12cfc2664bcdb9cf330ce5f.Config compatibility assessment
The review's requested compatibility assessment is complete. This changes no schema, default, environment variable, migration marker, redaction rule, or stored format. The docs facade exposes the same five operations in the same dependency order. Main-key normalization remains with
buildAgentMainSessionKey, which already callsnormalizeMainKey; persisted keys are unchanged. Cron classification preserves both predicates, counts, refusal order, and the existing repair/recheck path. The removed type has no consumers and is absent from public SDK exports. No updater or live-upgrade execution is claimed.Exact-head hosted CI
Run 36769831270 completed on
91162736eeb2b9660af6c7c48ab32438ed70c23a: 143 jobs passed, 22 skipped, two test jobs failed, and the CI gate failed downstream. Security-fast, dependency review, security-sensitive review, all selected types/lint/build checks, and architecture checks passed.checks-node-changed-compact-large-26(job 110073528939) failssetup-inference.first-signin.integration.test.ts:420:38: expectedconfirm, receivednote, in the same-owner sign-in/revoked-retry case. The identical failure is present on unrelated PR #162093, headbe4f3855425d239b494f77e308881b2b0c7a3157, run 36769218900 / job 110071456815. That PR changes onlysrc/agents/apply-patch-paths.ts. The assertion was introduced by #162020, which is already this PR's base; no Gateway/authentication source or test changes here.checks-node-changed-compact-small-4-1(job 110073535262) failsserver.catalog-startup.test.ts:86:3, “starts with provider settings without model rows when a channel is auto-enabled,” withTest timed out in 90000ms. The same case/error appears in the latest CI for unrelated PR #160471's still-current headf007e2c16e02455a3ace3d5e803af02bccac4130: September 28 run 36428787158 / job 108950748546. This is independent current-PR evidence, not a claim that the latest hourly main reproduced the timeout.The docs facade is only loaded by docs baseline generation, the removed type has no runtime effect, and the session helper still applies the same canonical normalization. The cron change only combines synchronous classification; it adds no await, retry, startup operation, or changed refusal decision. The startup fixture has no legacy cron jobs. Gateway/catalog/auth source and both failing tests are unchanged by this PR. These inherited failures remain with the main-CI coordinator; no retry, timeout increase, assertion change, or main repair is included. The maintainer-authorized exception is pinned to the exact tested head and does not describe the hosted run as green.
The catalog-startup test has identical Git blob
d60a895ece760b2cfb5f066acf0787a8a2ee4f11at this PR's base/head and the independent PR head above.