[Refactor] Split channel schema imports#82007
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: not applicable. this is a refactor PR rather than a bug report. The relevant verification is the import-boundary proof in the PR body plus the added startup-import test. Real behavior proof Next step before merge Security Review detailsBest possible solution: Merge this narrow import-boundary refactor after normal maintainer review and CI if the branch remains green, while keeping public schema access through the existing plugin SDK subpaths. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor PR rather than a bug report. The relevant verification is the import-boundary proof in the PR body plus the added startup-import test. Is this the best way to solve the issue? Yes. Moving the generic What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0db097936568. |
4bfa951 to
cb11e02
Compare
Signed-off-by: samzong <samzong.lu@gmail.com>
cb11e02 to
3807251
Compare
steipete
left a comment
There was a problem hiding this comment.
Maintainer verification before merge.
Behavior addressed: OpenClawSchema generic channel validation imports the generic channel config schema directly, avoiding provider-specific channel schema modules during this startup path.
Real environment tested: local macOS checkout rebased onto current origin/main.
Exact steps or command run after this patch:
- git pull --ff-only
- gh pr checkout 82007 --repo openclaw/openclaw
- git rebase origin/main
- /Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode branch --parallel-tests "node scripts/run-vitest.mjs src/config/zod-schema.startup-import.test.ts src/config/zod-schema.providers.lazy-runtime.test.ts src/config/config.acp-binding-cutover.test.ts src/config/group-policy.test.ts src/config/context-visibility.test.ts"
- git diff --check origin/main...HEAD
- git push --force-with-lease prhead HEAD:refactor/schema-import-split
- gh pr checks 82007 --repo openclaw/openclaw --watch --interval 15
Evidence after fix: Codex review exited clean with no accepted/actionable findings; focused local tests passed 5 files / 34 tests; extra adjacent schema guard probes passed 2 files / 3 tests and 3 files / 28 tests; GitHub checks passed on head SHA 3807251.
CI/Testbox run IDs: CI 25902849196, CodeQL 25902849182, CodeQL Critical Quality 25902849162, Workflow Sanity 25902849185, OpenGrep PR Diff 25902849189, Real behavior proof 25902856038, Dependency Change Awareness 25902847782.
Observed result after fix: PR remains a 4-file schema import split, rebase clean, no provider-specific zod-schema providers barrel import remains in the generic OpenClawSchema path, and all required GitHub checks are green.
What was not tested: No live channel runtime or Crabbox E2E; this is an internal config schema import-boundary refactor.
Thanks @samzong.
Split generic channel config schema out of the provider schema barrel so OpenClawSchema no longer imports provider-specific channel schemas for generic channel defaults validation. Co-authored-by: samzong <samzong.lu@gmail.com>
Split generic channel config schema out of the provider schema barrel so OpenClawSchema no longer imports provider-specific channel schemas for generic channel defaults validation. Co-authored-by: samzong <samzong.lu@gmail.com>
Split generic channel config schema out of the provider schema barrel so OpenClawSchema no longer imports provider-specific channel schemas for generic channel defaults validation. Co-authored-by: samzong <samzong.lu@gmail.com>
Split generic channel config schema out of the provider schema barrel so OpenClawSchema no longer imports provider-specific channel schemas for generic channel defaults validation. Co-authored-by: samzong <samzong.lu@gmail.com>
Summary
OpenClawSchemapulled the genericChannelsSchemathroughzod-schema.providers.ts, so validating generic channel defaults depended on the provider schema barrel.zod-schema.channels-config.ts, imported it directly fromzod-schema.ts, and pointed the existing lazy-runtime guard at the new module.config/io -> validationstartup path or its generated bundled channel config metadata import.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
OpenClawSchemageneric channel validation no longer imports the provider schema barrel just to validatechannels.defaults.node scripts/run-vitest.mjs src/config/zod-schema.startup-import.test.ts src/config/zod-schema.providers.lazy-runtime.test.ts src/config/config.acp-binding-cutover.test.ts src/config/group-policy.test.ts src/config/context-visibility.test.ts;node scripts/build-all.mjs cliStartup;pnpm deadcode:unused-files;rg -n "providers-whatsapp|providers-core|channels-config|zod-schema\\.providers" dist -g 'zod-schema*.js'.dist/zod-schema-U0Wq5vAP.js:420://#region src/config/zod-schema.channels-config.ts; the same command produced nozod-schema.providers-coreorzod-schema.providers-whatsapplines.OpenClawSchema.safeParse({ channels: { defaults: ..., discord: {} } })succeeds without loading provider-specific channel schema modules, and the deadcode check accepts the removed internal provider barrel.src/config/bundled-channel-config-metadata.generated.tsfrom the broaderconfig/io -> validationgateway startup path; that broader startup-boundary split is intentionally left out of this PR.Root Cause (if applicable)
N/A.
Regression Test Plan (if applicable)
src/config/zod-schema.startup-import.test.ts,src/config/zod-schema.providers.lazy-runtime.test.tsOpenClawSchemacan validate generic channel defaults without loading provider-specific schema modules.User-visible / Behavior Changes
None.
Diagram (if applicable)
N/A.
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
node scripts/run-vitest.mjs src/config/zod-schema.startup-import.test.ts src/config/zod-schema.providers.lazy-runtime.test.ts src/config/config.acp-binding-cutover.test.ts src/config/group-policy.test.ts src/config/context-visibility.test.tsnode scripts/build-all.mjs cliStartuppnpm deadcode:unused-filesgit diff --check HEAD~1..HEADpnpm changed:lanes --jsonrg -n "providers-whatsapp|providers-core|channels-config|zod-schema\\.providers" dist -g 'zod-schema*.js'Expected
zod-schema.channels-config.tsdirectly.Actual
node scripts/build-all.mjs cliStartuppassed.pnpm deadcode:unused-filespassed.git diff --check HEAD~1..HEADpassed.pnpm changed:lanes --jsonreportedcoreandcoreTestsonly.src/config/zod-schema.channels-config.tsand no provider schema modules for this path.Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
Compatibility / Migration
Yes/No) Yes; no package export or production import used the removed internalsrc/config/zod-schema.providers.tsbarrel.Yes/No) NoYes/No) NoRisks and Mitigations
None.