fix(config): use static channel metadata in docs baseline#51161
Conversation
…ic-channel-metadata
Greptile SummaryThis PR fixes a baseline drift issue in config doc generation by sourcing channel Key changes:
One style concern worth noting: Confidence Score: 4/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/config/doc-baseline.ts
Line: 311
Comment:
**Empty `blurb` silently wins over `plugin.description`**
`ChannelMeta.blurb` is always a `string` (never `undefined`) because `toChannelMeta` normalises it with `|| ""`. This means when a bundled channel plugin exists in the catalog but has no blurb configured, `catalogMeta?.blurb` evaluates to `""`, and the `??` operator does **not** fall through to `plugin.description` (since `""` is not nullish). The fallback is silently lost.
The same pattern is duplicated on line 335 in the parallel branch.
Consider using `||` instead of `??` so that an empty string also triggers the fallback:
```suggestion
const description = catalogMeta?.blurb || plugin.description;
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/config/doc-baseline.ts
Line: 335
Comment:
**Same empty `blurb` issue in the parallel branch**
Same as the issue in the sequential debug branch above — `catalogMeta?.blurb ?? plugin.description` will not fall through to `plugin.description` when the catalog entry exists with an empty blurb.
```suggestion
const description = catalogMeta?.blurb || plugin.description;
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: "Merge branch 'main' ..." |
| const loaded = await promise; | ||
| const catalogMeta = channelCatalogById.get(plugin.id); | ||
| const label = catalogMeta?.label ?? plugin.name ?? plugin.id; | ||
| const description = catalogMeta?.blurb ?? plugin.description; |
There was a problem hiding this comment.
Empty
blurb silently wins over plugin.description
ChannelMeta.blurb is always a string (never undefined) because toChannelMeta normalises it with || "". This means when a bundled channel plugin exists in the catalog but has no blurb configured, catalogMeta?.blurb evaluates to "", and the ?? operator does not fall through to plugin.description (since "" is not nullish). The fallback is silently lost.
The same pattern is duplicated on line 335 in the parallel branch.
Consider using || instead of ?? so that an empty string also triggers the fallback:
| const description = catalogMeta?.blurb ?? plugin.description; | |
| const description = catalogMeta?.blurb || plugin.description; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/config/doc-baseline.ts
Line: 311
Comment:
**Empty `blurb` silently wins over `plugin.description`**
`ChannelMeta.blurb` is always a `string` (never `undefined`) because `toChannelMeta` normalises it with `|| ""`. This means when a bundled channel plugin exists in the catalog but has no blurb configured, `catalogMeta?.blurb` evaluates to `""`, and the `??` operator does **not** fall through to `plugin.description` (since `""` is not nullish). The fallback is silently lost.
The same pattern is duplicated on line 335 in the parallel branch.
Consider using `||` instead of `??` so that an empty string also triggers the fallback:
```suggestion
const description = catalogMeta?.blurb || plugin.description;
```
How can I resolve this? If you propose a fix, please make it concise.| bundledChannelPlugins.map(async (plugin) => { | ||
| const catalogMeta = channelCatalogById.get(plugin.id); | ||
| const label = catalogMeta?.label ?? plugin.name ?? plugin.id; | ||
| const description = catalogMeta?.blurb ?? plugin.description; |
There was a problem hiding this comment.
Same empty
blurb issue in the parallel branch
Same as the issue in the sequential debug branch above — catalogMeta?.blurb ?? plugin.description will not fall through to plugin.description when the catalog entry exists with an empty blurb.
| const description = catalogMeta?.blurb ?? plugin.description; | |
| const description = catalogMeta?.blurb || plugin.description; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/config/doc-baseline.ts
Line: 335
Comment:
**Same empty `blurb` issue in the parallel branch**
Same as the issue in the sequential debug branch above — `catalogMeta?.blurb ?? plugin.description` will not fall through to `plugin.description` when the catalog entry exists with an empty blurb.
```suggestion
const description = catalogMeta?.blurb || plugin.description;
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eea9988fd4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| listChannelPluginCatalogEntries({ | ||
| workspaceDir: repoRoot, | ||
| env, |
There was a problem hiding this comment.
Exclude workspace overrides from channel metadata lookup
loadBundledConfigSchemaResponse now resolves channel labels/blurbs through listChannelPluginCatalogEntries({ workspaceDir: repoRoot, ... }), but that catalog API gives workspace entries higher priority than bundled. When a developer has a local .openclaw/extensions override for a channel ID (for example while testing a plugin), this code will pull that local label/blurb into the docs baseline, making release:check nondeterministic and potentially publishing non-bundled metadata. To keep the baseline stable, this path should use bundled-only metadata rather than discovery results that include workspace/config origins.
Useful? React with 👍 / 👎.
Summary
pnpm release:checkfailed because config-doc baseline generation could pick up channel label/help from config-schema import side effects instead of the static metadata we actually want.openclaw.channel.label/blurb) and uses config-surface imports only for schema shape.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
None.
Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
pnpm build.pnpm test -- src/config/doc-baseline.integration.test.ts src/config/doc-baseline.test.ts src/config/schema.test.ts.pnpm release:check.Expected
release:checkpasses.Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
channels.matrixbaseline help stays on the static package blurb instead of the runtime homeserver blurb.check, fresh branch-from-origin/mainrebuild, andrelease:checkpack validation.pnpm testsuite.Review Conversations
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/config/doc-baseline.ts,src/config/doc-baseline.integration.test.ts.Risks and Mitigations