Skip to content

refactor(config): deslop config and secrets - #157146

Merged
steipete merged 2 commits into
mainfrom
deslop/l29-config-owners-20260923
Sep 24, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/l29-config-owners-20260923

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Config loading and secret preparation duplicate validation, target descriptions, result projections, and forwarding layers that must otherwise stay synchronized.

User Impact

No user-visible behavior change or migration. Config keys/defaults, validation and diagnostic text, generated schema/docs, SecretRef precedence, exec-provider restrictions, persisted state, Gateway protocol, and public plugin SDK contracts are preserved.

Why This Change Was Made

Existing owners now supply the shared behavior:

  • Config schema shapes, env collection, plugin enable matching, roster/merge helpers, and snapshot projection reuse canonical implementations. The plugin-metadata loader no longer accepts unused effectiveConfigRaw.
  • Session transcript workers share result validation/envelopes and append options. The unused synchronous tail reader and only its exclusive test cases are removed; main's message-by-id/message-count behavior remains.
  • Secrets reuse one assignment collector, auth-profile owner enumeration, target registry compiler/default descriptor, and provider error boundary. Configure/apply/audit share projections and mutations. Provider env lookup uses a direct lazy cache instead of a private Proxy.

Registry discovery order, aliases, and includeInPlan remain covered by all six daemon-install consumer suites. Storage transactions, permissions, exec allowlists, redaction, revocation, and retention are unchanged.

Evidence

Production-filter diff: 69 files changed, 1218 insertions(+), 2701 deletions(-) — 1,483 net lines removed (1,482 production TypeScript lines plus one shrink-only baseline line):

git diff --shortstat $(git merge-base origin/main HEAD) -- . \
  ':(exclude)**/*.test.*' ':(exclude)**/test/**' ':(exclude)docs/**'

Independent Codex autoreview is clean through P2, including the final path-input cleanup. No accepted/actionable findings remain. Both subsequent rebases are patch-identical by git range-diff.

  • Exact-head hosted CI on a39f016dbefb5bf0df5655d0b4a9774149968051: green, including the aggregate CI/security status. CI run.
  • Final node scripts/check-changed.mjs --base 4098a8106338d925a0be4ebf472fcaf1686d94c9: passed on final head in 1,742.301s on Linux Testbox. Earlier complete Linux runs passed, including all 25 typecheck shards and three Knip scans. No timeout or skip settings changed.
  • pnpm config:schema:check, pnpm config:docs:check, pnpm config:channels:check, pnpm plugin-sdk:surface:check, pnpm plugin-sdk:check-exports, and node scripts/run-vitest.mjs test/scripts/plugin-sdk-surface-report.test.ts: passed on final head. Generated-source git diff --exit-code: zero drift. Final Testbox run.
  • The current replacement for retired plugin-sdk:api:check, pnpm plugin-sdk:api:diff --base 4098a8106338d925a0be4ebf472fcaf1686d94c9 --head HEAD: passed in 319.560s. Zero entrypoint or export additions/removals and zero direct signature changes. Its 993 reachable records reduce to 17 unique declaration differences; review confirmed internal export/type changes and type-emission ordering, with no public SDK contract break. Main's renderer fix fix(ci): render empty tuple SDK defaults #157183 resolves the earlier base-and-head DataView failure.
  • node scripts/run-vitest.mjs with 990 selected focused/cross-shard files: passed in 2,570.620s on the original implementation, including config/secrets suites, affected consumers, and all six daemon-install suites. Two UI E2E files passed (8 tests). The subsequent credential discriminant correction emitted identical JavaScript; the local path-binding cleanup separately passed five boundary tests. pnpm build passed in 1,179.755s, and the later E2E bootstrap completed a full build in 18m34s. This proof was retained across the patch-identical rebases; final-head CI and the checks above cover the final source.
  • node scripts/test-docker-all.mjs, scoped to onboard (local-basic,local-auth-refs) and published-upgrade-survivor with baseline [email protected]: passed. Fresh setup took 24s; the auth-profile upgrade cell took 296s; the SQLite/session cell took 326s. Both receipts confirm the installed published updater performed the update successfully, with no recovery. Gateway SecretRef activation/authentication/readiness passed; sessions.list and chat.history verified eight conversations across two agents before and after a manual Gateway restart. The bounded synthetic fixture contained 12 sessions, 50 events, and eight cron jobs; this is functional compatibility proof, not stress coverage. Package source was 8df9af674e5cc3576cce4643252f54d54d6d85cd before the final patch-identical rebase; tarball SHA-256 38841ddb335fa5d2f8ff95dd3dbc5e3a56bb135a65dfaaf76dc6b9c5b295c017. Installed-package Testbox run.

The registry E2E limitation is pre-existing: the identical 12-file selection on one Linux Testbox failed 28 cases on clean baseline cdd5eebe3c87b2ed6478358514e2d30a39b2a2ac and 27 on the candidate, with zero candidate-only failures. Ten candidate files / 136 tests passed. The earlier comparison likewise had 27 baseline versus 26 candidate failures, with zero candidate-only failures. Latest A/B run. No assertions or timeouts were weakened, and these delivery-settlement failures are not claimed fixed.

CI recovery: rebased to include #157133's missing wrapper-archive dependencies. A same-host tooling A/B reproduced its 11 failures on the old merge baseline; the corrected candidate removed those failures. An intermittent native-TypeScript context canceled stderr assertion remains recorded. A later hosted worker-facade case hit its existing 120-second timeout; replaying its original 42-file shard passed on both base and candidate (155.907s / 164.361s total; the case took 32.762s / 43.255s). Neither passing replay is claimed as a fix. Final CI is green after the necessary SDK-reporter rebase.

Changed-test cost with pnpm test <file> --maxWorkers=1 on Linux Testbox: io.context.plugin-metadata.test.ts 15.455s; session-accessor.sqlite-cold-read.test.ts 63.421s; session-cold-storage.test.ts 53.320s; runtime-shared.test.ts 1.631s. No new tests, sleeps, worker pins, or serial configuration were added.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: a39f016dbefb5bf0df5655d0b4a9774149968051
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/config/types.secrets.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/apply.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/audit.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/auth-profiles-scan.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/channel-secret-basic-runtime.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/configure.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/egress-proxy/proxy-server.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/json-pointer.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/legacy-secretref-env-marker.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/path-utils.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/plan.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/provider-auth-evidence.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/provider-env-vars.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/resolve.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-auth-collectors.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-auth-profile-owner.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-config-collectors-core.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-config-collectors-memory.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-config-collectors-plugins.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-config-collectors-sandbox.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-config-collectors-tts.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-degraded-state.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-fast-path.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-gateway-auth-surfaces.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-owner-assignments.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • 7 additional sensitive files; see the workflow summary.

Carefully review these changes before merging.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 24, 2026, 7:57 AM ET / 11:57 UTC (Revision 4).

ClawSweeper review

What this changes

The branch consolidates configuration and plugin checks, SecretRef handling, and session transcript worker helpers, and removes a synchronous transcript-tail reader.

Merge readiness

⛔ Blocked before merge - 2 items remain

This cleanup remains distinct from current main. The prior review’s update-proof request is addressed in the PR body, and source inspection found no definite introduced defect. The linked Testbox logs could not be independently inspected.

Priority: P3
Reviewed head: a39f016dbefb5bf0df5655d0b4a9774149968051

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The refactor has substantial focused and exact-head validation with no identified correctness defect; the Testbox receipts could not be independently checked through the linked logs.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The maintainer-authored proof gate does not apply. The PR body reports a real published-updater-to-candidate run covering config, auth profiles, and SQLite sessions plus fresh setup; the linked Testbox logs were inaccessible to this reviewer. The inspected patch changes runtime handling rather than a stored-data format.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored proof gate does not apply. The PR body reports a real published-updater-to-candidate run covering config, auth profiles, and SQLite sessions plus fresh setup; the linked Testbox logs were inaccessible to this reviewer. The inspected patch changes runtime handling rather than a stored-data format.
Evidence reviewed 7 items Introduced code: The pinned merge-base-to-head diff consolidates plugin readiness, secret assignment, and transcript worker result handling; the inspected changes retain the existing decision paths.
Secrets boundary: The existing assignment collector becomes the direct caller target; the apply path still projects changes before captured file and auth-store writes.
Current-main necessity: Fetched main changes only config defaults and its test within the config and secrets trees since the pinned base; it does not contain this consolidation.
Findings None None.
Security None None.

How this fits together

OpenClaw loads configuration and plugin metadata, resolves credentials, and supplies the resulting state to the Gateway. Session history is read from SQLite through transcript workers for Gateway clients.

flowchart LR
A[Config and auth stores] --> C[Config validation]
B[Plugin manifests] --> C
C --> D[Secret preparation]
D --> E[Gateway runtime]
F[Session SQLite store] --> G[Transcript worker]
G --> E
Loading

Before merge

  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
Agent review details

Security

None.

PR surface

Source -1482, Tests -6, Other -1. Total -1489 across 73 files.

View PR surface stats
Area Files Added Removed Net
Source 68 1204 2686 -1482
Tests 4 4 10 -6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 5 -1
Total 73 1212 2701 -1489

Review metrics

None.

Technical review

Best possible solution:

Keep configuration, credential, and transcript decisions with their existing owners while preserving fresh-install and upgrade behavior.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR removes duplicate implementation rather than reporting a broken behavior.

Is this the best way to solve the issue?

Yes: the branch reuses existing config, secrets, and transcript owners without adding a competing configuration or credential path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 074198a6341a.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal simplification with no intended user-visible behavior change.
  • merge-risk: 🚨 compatibility: Plugin selection and config loading affect existing installations, although the PR body records a published-updater compatibility run.
  • merge-risk: 🚨 auth-provider: SecretRef and auth-profile preparation affect credential availability, although the reported upgrade cells cover retained auth state.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored proof gate does not apply. The PR body reports a real published-updater-to-candidate run covering config, auth profiles, and SQLite sessions plus fresh setup; the linked Testbox logs were inaccessible to this reviewer. The inspected patch changes runtime handling rather than a stored-data format.

Evidence

What I checked:

  • Introduced code: The pinned merge-base-to-head diff consolidates plugin readiness, secret assignment, and transcript worker result handling; the inspected changes retain the existing decision paths. (src/config/plugin-auto-enable.shared.ts:393, a39f016dbefb)
  • Secrets boundary: The existing assignment collector becomes the direct caller target; the apply path still projects changes before captured file and auth-store writes. (src/secrets/apply.ts:765, a39f016dbefb)
  • Current-main necessity: Fetched main changes only config defaults and its test within the config and secrets trees since the pinned base; it does not contain this consolidation. (074198a6341a)
  • Prior review and updated proof: The preceding completed review had no findings and requested a published-release updater run. The reviewed PR body now reports fresh setup and two [email protected] upgrade cells with retained auth-profile and session checks. (a39f016dbefb)
  • Exact-head CI: The hosted CI run completed successfully on the exact reviewed head. (a39f016dbefb)
  • Testbox inspection limit: The linked installed-package Testbox run reports a cancelled conclusion. Its logs could not be fetched because the Actions log host was blocked, so the PR body's detailed receipts were not independently checked through that link.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Yuval Dinodia: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-24T08:36:00.036Z sha 1aed6677d19355ffa3f0fae60c6a56ad8526bed1 :: blocked before merge. :: none
  • reviewed 2026-09-24T09:31:33.855Z sha 8df9af6 :: blocked before merge. :: none
  • reviewed 2026-09-24T10:57:31.043Z sha a39f016 :: blocked before merge. :: none

@steipete
steipete force-pushed the deslop/l29-config-owners-20260923 branch from 1aed667 to 8df9af6 Compare September 24, 2026 09:13
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@steipete
steipete force-pushed the deslop/l29-config-owners-20260923 branch from 8df9af6 to a39f016 Compare September 24, 2026 10:48
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 24, 2026
@steipete
steipete merged commit f2e0c54 into main Sep 24, 2026
236 checks passed
@steipete
steipete deleted the deslop/l29-config-owners-20260923 branch September 24, 2026 13:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
* refactor(config): deslop config and secrets

* refactor(config): keep session path input immutable
wangmiao0668000666 added a commit to wangmiao0668000666/openclaw that referenced this pull request Oct 2, 2026
…ifestSetupProvider

The rebase onto main's openclaw#157146 metadata contribution refactor made tsgo infer
the fixture's authEvidence as { type: string }[], which no longer satisfies
PluginManifestSetupProviderAuthEvidence (missing required credentialMarker,
non-literal type). Annotate the fixture and supply the required marker.

Formatting proven separately: oxfmt 0.67.0 --check passes on the staged file
(the host has no node_modules for the hook to run it).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant