Skip to content

fix(discord): avoid doctor runtime loading - #119391

Merged
vincentkoc merged 2 commits into
mainfrom
fix/discord-doctor-metadata
Aug 5, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/discord-doctor-metadata

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where the release unit-fast lane could exceed its 120-second per-test timeout while evaluating Discord allowFrom policy. Doctor capability discovery loaded the full Discord plugin graph when static metadata was unavailable, including in packaged installs where Discord is excluded from dist/extensions.

Why This Change Was Made

Publishes Discord's existing doctor capability contract and makes doctor read it through the canonical bundled channel catalog before falling back to runtime plugin loading. That reader uses package manifests in source checkouts and the generated dist/channel-catalog.json in packaged installs.

The packaged-layout regression removes the bundled plugin directory, supplies only the generated catalog, and verifies that neither runtime plugin loader is called.

User Impact

No intentional product behavior changes. Release and CI validation no longer pay the Discord runtime-load cost for static doctor policy checks, and packaged installs use the same static capability contract.

Evidence

AI-assisted: yes. The implementation was independently reviewed with the repository autoreview workflow.

Punchcard-Session: amber-workshop-river-yr

Punchcard-Session: amber-workshop-river-yr
@vincentkoc vincentkoc self-assigned this Aug 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord scripts Repository scripts commands Command implementations size: XS maintainer Maintainer-authored PR labels Aug 5, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 10:26 PM ET / August 5, 2026, 02:26 UTC.

ClawSweeper review

What this changes

This PR adds Discord’s existing Doctor policy metadata to the package catalog and makes Doctor read that static packaged catalog before loading a channel plugin.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: the exact head resolves the prior packaged-layout finding by using generated channel metadata before either runtime loader. Current main still takes the bundled-discovery route, so this repair remains necessary.

Priority: P2
Reviewed head: b0d230f403271e0c840cc06ff051f62c65865a64

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, canonical repair with the prior packaged-layout blocker addressed by an exact-head regression fixture.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal release-validation repair is not subject to the external-contributor real-behavior-proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal release-validation repair is not subject to the external-contributor real-behavior-proof gate.
Evidence reviewed 5 items Current-main failure path: Current main first queries bundled-only metadata, then falls through to runtime plugin loading when metadata is absent; Discord is excluded from the packaged bundled-extension directory.
Catalog is the packaged artifact: Runtime postbuild writes the official channel catalog to dist, supplying static data without importing a channel runtime.
Exact-head repair: The PR consults normalized bundled/generated catalog metadata before the runtime fallback, preserving the fallback for channels with no static contract.
Findings None None.
Security None None.

How this fits together

Doctor validates channel allowlist policy and migrations before a channel runtime is needed. Packaged OpenClaw uses the generated channel catalog for static metadata when separately distributed plugins such as Discord are absent from the core distribution.

flowchart LR
A[Doctor policy check] --> B[Channel identifier]
B --> C[Generated channel catalog]
C --> D[Discord policy metadata]
D --> E[Doctor validation]
C --> F[Runtime plugin fallback]
F --> E
Loading

Before merge

  • Resolve merge risk (P1) - The generated catalog becomes the packaged source of truth for four Discord Doctor capabilities; retain the catalog-generation and packaged-layout regression gates to prevent source/package drift.
  • Complete next step (P2) - No repair lane is needed: the exact head resolves the prior finding and requires normal exact-head CI completion.
Agent review details

Security

None.

PR surface

Source +4, Tests +134, Config +6, Other +6. Total +150 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 3 20 16 +4
Tests 4 139 5 +134
Docs 0 0 0 0
Config 1 6 0 +6
Generated 0 0 0 0
Other 1 6 0 +6
Total 9 171 21 +150

Review metrics

Metric Value Why it matters
Production versus test LOC production +16 (32 added, 16 removed); tests +134 (139 added, 5 removed) The production growth establishes a single static packaged-metadata boundary and is covered primarily by focused regression fixtures.
Doctor metadata contract 4 capability fields added in 2 generated-source artifacts The package manifest and generated catalog must remain aligned for source and packaged Doctor behavior.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/channels/bundled-channel-catalog-read.test.ts, migration/backfill/repair: src/commands/doctor/channel-capabilities.packaged.test.ts, migration/backfill/repair: src/commands/doctor/channel-capabilities.test.ts, unknown-data-model-change: src/commands/doctor/channel-capabilities.packaged.test.ts, unknown-data-model-change: src/commands/doctor/channel-capabilities.ts, vector/embedding metadata: src/commands/doctor/channel-capabilities.packaged.test.ts, and 3 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Land with the catalog contract (recommended)
    Accept the bounded release-automation risk once exact-head checks complete, because the packaged fixture now covers the only new metadata source-of-truth boundary.

Technical review

Best possible solution:

Keep the generated catalog as the canonical static control-plane source, with runtime loading only as the fallback for channels that do not publish Doctor capabilities.

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

Yes—package an install without Discord under dist/extensions, then run the Doctor allowlist-policy path; current main misses static Discord metadata and reaches runtime loading, while the PR fixture models that layout.

Is this the best way to solve the issue?

Yes—the generated catalog is the established packaged control-plane artifact, and the patch removes the duplicate bundled-only lookup rather than adding another runtime path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 392e1c0620b5.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal release-validation repair is not subject to the external-contributor real-behavior-proof gate.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded release-validation reliability repair without an intentional user-facing behavior change.
  • merge-risk: 🚨 automation: The PR changes the static metadata route used by Doctor during release and CI validation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal release-validation repair is not subject to the external-contributor real-behavior-proof gate.

Evidence

What I checked:

Likely related people:

  • Shakker: Current-main blame attributes the original Doctor lookup and catalog-reader implementation to the commit that introduced these files; deeper history is unavailable in this partial checkout. (role: feature introducer; confidence: medium; commits: 28495ea691d2; files: src/commands/doctor/channel-capabilities.ts, src/channels/bundled-channel-catalog-read.ts)

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 (2 earlier review cycles)
  • reviewed 2026-08-05T01:11:29.477Z sha 3f72ccf :: found issues before merge. :: [P1] Read the packaged channel catalog before loading Discord
  • reviewed 2026-08-05T02:15:18.303Z sha 3f72ccf :: found issues before merge. :: [P1] Read the packaged catalog before claiming no runtime load

@vincentkoc
vincentkoc marked this pull request as ready for review August 5, 2026 01:39
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 5, 2026
Punchcard-Session: amber-workshop-river-yr
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(discord): avoid doctor runtime loading This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@vincentkoc
vincentkoc merged commit 1ee0564 into main Aug 5, 2026
206 of 215 checks passed
@vincentkoc
vincentkoc deleted the fix/discord-doctor-metadata branch August 5, 2026 03:05
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 5, 2026
* origin/main: (22 commits)
  refactor(plugins): consolidate lifecycle hook dispatch (#119429)
  fix(ci): stabilize TUI PTY proof ownership (#119420)
  test(system-agent): reduce suite setup overhead (#119424)
  fix(ui): keep session rail pill status from overlapping the headline (#119397)
  fix(discord): avoid doctor runtime loading (#119391)
  fix(media): decouple playback cache retention (#119417)
  fix(slack): infer upload filename extensions from MIME types (#119399)
  refactor(channels): unify configured binding resolution (#119414)
  refactor(google-meet): unify gateway and tool dispatch (#119413)
  test(state): reuse legacy database fixtures (#119423)
  fix(reset): preserve bootstrap guidance for dynamic models (#119179)
  fix(chutes): honor serving context limits (#119196)
  refactor(status): consolidate scan projections and lazy loaders (#119412)
  fix(status): status --all slows down with missing plugins (#119203)
  refactor(gateway): consolidate usage reporting and caches (#119409)
  perf(gateway): keep reload and recovery machinery off gateway cold start (#119094)
  fix(cli): align TaskFlow controller columns for wide text (#118801)
  fix: make startup migration restart guidance install-neutral (#119406)
  fix(ci): preserve cache warmer shard envelopes (#119403)
  fix(sessions): preserve compatible auth profiles on model changes (#117550)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
* fix(discord): publish doctor capability metadata

Punchcard-Session: amber-workshop-river-yr

* fix(doctor): read packaged channel metadata

Punchcard-Session: amber-workshop-river-yr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord commands Command implementations maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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