Skip to content

ci: gate bundled-channel-config-metadata staleness in check-shard#80552

Closed
hclsys wants to merge 3 commits into
openclaw:mainfrom
hclsys:fix/ci-guard-bundled-channel-config-metadata-80536-clean
Closed

ci: gate bundled-channel-config-metadata staleness in check-shard#80552
hclsys wants to merge 3 commits into
openclaw:mainfrom
hclsys:fix/ci-guard-bundled-channel-config-metadata-80536-clean

Conversation

@hclsys

@hclsys hclsys commented May 11, 2026

Copy link
Copy Markdown

Fixes #80536

Problem

src/config/bundled-channel-config-metadata.generated.ts is a checked-in codegen output that is not regenerated by npm run build. When a PR extends an extension's config-schema.ts without also hand-editing the bundled file, CI passes but the runtime validator rejects the new field at gateway startup with must NOT have additional properties.

The script to detect this already exists (scripts/generate-bundled-channel-config-metadata.ts --check / pnpm check:bundled-channel-config-metadata) but was never wired into CI.

Fix

Add a check-bundled-channel-config-metadata entry to the check-shard matrix and handle the bundled-channel-config-metadata task in the runner's case statement.

Changes

File Change
.github/workflows/ci.yml +6 lines: matrix entry + case handler

Pre-implement audit

  1. Existing-helper check: pnpm check:bundled-channel-config-metadata already exists in package.json — no new helper introduced.
  2. Shared-helper caller check: only ci.yml is changed; no shared TS helper is touched.
  3. Broader-fix rival scan: zero rival PRs for Channel config-schema additions in downstream patches not picked up by runtime validator (codegen-bundled JSON schema is checked-in, not regenerated at build) #80536.

Real behavior proof

  • Behavior or issue addressed: src/config/bundled-channel-config-metadata.generated.ts can become stale when extensions add new config schema fields — PR CI passes but the gateway crashes at startup with must NOT have additional properties. This PR wires the existing staleness-check script into the CI check-shard matrix so the stale-generated-file failure is caught in CI before runtime.
  • Real environment tested: openclaw/openclaw main branch, Ubuntu 22.04, Node v22.14.0, repo cloned locally.
  • Exact steps or command run after this patch: Ran the staleness check directly against the current repo to verify the script works and exits cleanly:
    node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check
    
    To verify the failure path, temporarily corrupted the generated file (appended a dummy field), re-ran, then restored:
    node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check
    [bundled-channel-config-metadata] stale generated output at src/config/bundled-channel-config-metadata.generated.ts
    (exit 1)
    
  • Evidence after fix: Terminal output from running the check on current main (clean state):
    $ node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check
    $ echo $?
    0
    
    Terminal output with a manually-staled generated file (confirms detection works):
    $ node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check
    [bundled-channel-config-metadata] stale generated output at src/config/bundled-channel-config-metadata.generated.ts
    $ echo $?
    1
    
  • Observed result after fix: Check exits 0 on a current repo; exits 1 with a clear path-specific error message when the generated file is stale. The new check-bundled-channel-config-metadata CI shard will run this check on every PR, catching the staleness class of failure described in Channel config-schema additions in downstream patches not picked up by runtime validator (codegen-bundled JSON schema is checked-in, not regenerated at build) #80536 before it reaches runtime.
  • What was not tested: Windows CI runners. The pnpm generate:bundled-channel-config-metadata regeneration workflow itself — this PR only wires the check, not the fix command.

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 11, 2026
@clawsweeper

clawsweeper Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR adds a check-bundled-channel-config-metadata check-shard matrix entry and dispatch case in .github/workflows/ci.yml to run the existing generated-metadata staleness check in CI.

Reproducibility: yes. Source inspection shows current main consumes generated channel metadata at runtime, the existing checker detects stale generated output, and current main does not run that checker in the check-shard before this PR.

Real behavior proof
Sufficient (terminal): The PR body includes after-patch terminal output for clean and intentionally stale generated metadata, and the live PR checks include a successful new CI shard and Real behavior proof checks.

Next step before merge
No repair lane is needed; the PR is focused, proof and CI are sufficient, and there are no blocking findings.

Security
Cleared: The diff only adds an existing repository check to a read-only CI job and does not add dependencies, actions, secrets, permissions, downloads, or package-resolution changes.

Review details

Best possible solution:

Land this narrow CI guard after normal maintainer approval, leaving broader build-time regeneration or live-schema policy changes to separate review.

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

Yes. Source inspection shows current main consumes generated channel metadata at runtime, the existing checker detects stale generated output, and current main does not run that checker in the check-shard before this PR.

Is this the best way to solve the issue?

Yes for this PR's scope. Running the existing read-only staleness check in CI is the narrowest maintainable guard; automatically regenerating during build would be a broader follow-up decision.

What I checked:

  • Current main lacks the CI shard: On current main, the check-shard matrix includes preflight, prod types, lint, dependencies, policy, test types, and strict smoke only; the case dispatcher has no bundled-channel-config-metadata task. (.github/workflows/ci.yml:1311, 6066e878f690)
  • PR wires the existing task: The PR diff adds check-bundled-channel-config-metadata to the check-shard matrix and dispatches bundled-channel-config-metadata) to pnpm check:bundled-channel-config-metadata. (.github/workflows/ci.yml:1331, 4a4428c61722)
  • Existing package script: package.json already defines check:bundled-channel-config-metadata as node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check, so the PR does not add a new dependency or helper script. (package.json:1342, 6066e878f690)
  • Check mode fails on stale output: The generator exits 1 with a stale generated output message when --check detects a changed output, and the shared helper returns without writing when check is true. (scripts/generate-bundled-channel-config-metadata.ts:269, 6066e878f690)
  • Runtime uses generated metadata: Config validation imports GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA, builds bundledChannelSchemaById, and validates configured channel blocks against those schemas, matching the linked runtime-validator problem. (src/config/validation.ts:40, 6066e878f690)
  • Relevant CI succeeded: Live PR status shows the new check-bundled-channel-config-metadata check, workflow sanity checks, Real behavior proof, check, and build-artifacts completed successfully at PR head 4a4428c617228694396c2c0d776442978c8a4fe2. (4a4428c61722)

Likely related people:

  • Takhoffman: Commit ed2798417e002cf8a295eac1642bfadf96e11b86 restored the bundled channel config metadata gate and added the generator/check surface used by this PR. (role: introduced check primitive; confidence: high; commits: ed2798417e00; files: package.json, scripts/generate-bundled-channel-config-metadata.ts, src/config/bundled-channel-config-metadata.generated.ts)
  • steipete: Recent commits refactored channel config metadata into plugin-owned manifests and touched both the generator path and CI workflow surface. (role: major metadata and CI area contributor; confidence: high; commits: 40bd36e35d33, dd098596cf34, 2ac2f0fce57d; files: .github/workflows/ci.yml, scripts/generate-bundled-channel-config-metadata.ts, src/config/bundled-channel-config-metadata.generated.ts)
  • pgondhi987: Commit 93ff72a5e853e52239c90b8aa0cfa9e6714c558e recently refreshed src/config/bundled-channel-config-metadata.generated.ts while changing Matrix channel config schema behavior. (role: recent generated metadata contributor; confidence: medium; commits: 93ff72a5e853; files: src/config/bundled-channel-config-metadata.generated.ts, extensions/matrix/src/config-schema.ts)
  • hclsys: Beyond this PR, hclsys has merged current-main work in src/config/validation.ts and related config validation tests. (role: adjacent config validation contributor; confidence: medium; commits: b3e42bf32792; files: src/config/validation.ts, src/config/config.plugin-validation.test.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 6066e878f690.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 11, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
hclsys and others added 3 commits May 11, 2026 13:42
Adds a check-shard matrix entry that runs
`pnpm check:bundled-channel-config-metadata` (which already exists but
was never wired into CI). The script exits 1 with a clear message when
`src/config/bundled-channel-config-metadata.generated.ts` is stale
relative to the per-extension zod schemas, so any PR that extends an
extension's config-schema without regenerating the bundled file will now
fail CI instead of silently shipping a half-broken validator.

Fixes openclaw#80536

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@hclsys

This comment was marked as low quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. size: XS

Projects

None yet

1 participant