Skip to content

fix(doctor): diagnose malformed provider catalogs - #88351

Merged
steipete merged 13 commits into
mainfrom
fuzz-critical-provider-catalog-20260530
May 31, 2026
Merged

steipete merged 13 commits into
mainfrom
fuzz-critical-provider-catalog-20260530

Conversation

@vincentkoc

@vincentkoc vincentkoc commented May 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • moves malformed static provider catalog handling out of runtime projection and into openclaw doctor
  • keeps unified text provider catalog projection on the typed provider catalog contract instead of carrying fallback/skip semantics in core runtime code
  • adds the core/doctor/provider-catalog-projection health check for full provider registrations
  • reports malformed provider containers, provider entries, model lists, model row iteration failures, unreadable rows, invalid provider/model keys, invalid static catalog order/hooks, and proxy/access errors from static catalog hooks

Verification

  • node scripts/run-vitest.mjs src/flows/doctor-core-checks.runtime.test.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.test.ts src/flows/doctor-health-conversion-plan.test.ts src/plugin-sdk/provider-entry.test.ts
  • node_modules/.bin/oxfmt --check src/plugins/provider-catalog-unified-text.ts src/flows/doctor-core-checks.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-core-checks.runtime.ts src/flows/doctor-core-checks.runtime.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts src/flows/doctor-health-conversion-plan.ts src/flows/doctor-health-conversion-plan.test.ts
  • node scripts/run-oxlint.mjs src/flows/doctor-core-checks.runtime.ts src/flows/doctor-core-checks.runtime.test.ts src/plugins/provider-catalog-unified-text.ts
  • pnpm tsgo:test
  • git diff --check origin/main...HEAD
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --prompt-file /tmp/provider-catalog-doctor-review-context.txt

Real behavior proof

Behavior addressed: malformed static provider catalog output is diagnosed by doctor instead of adding runtime fallback/tolerance to unified text provider catalog projection.

Real environment tested: local OpenClaw checkout on branch head 876fdda5a352b0f15bfbe2abe9be43ebada7c596.

Exact steps or command run after this patch: ran focused Vitest suites for doctor health checks, doctor contributions, conversion-plan wiring, and provider-entry projection coverage; ran formatter, targeted lint, test typecheck, diff whitespace check, and autoreview.

Evidence after fix: tests cover full provider registrations, invalid provider containers, falsy malformed results, invalid or missing models, invalid model iterators, unreadable provider/model rows, invalid provider keys, invalid model ids/names, invalid static catalog order/hooks, revoked proxy handling, static catalog hook failures, and doctor contribution rendering.

Observed result after fix: openclaw doctor health check paths report actionable malformed provider catalog findings while runtime projection keeps the typed provider catalog contract.

What was not tested: no live provider/network catalog calls; scoped to static provider catalog validation.

@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels May 30, 2026
@vincentkoc
vincentkoc force-pushed the fuzz-critical-provider-catalog-20260530 branch from 4de36d8 to 8a7ab79 Compare May 30, 2026 14:27
@clawsweeper

clawsweeper Bot commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 31, 2026, 9:37 AM ET / 13:37 UTC.

Summary
The branch adds a core doctor health check and normal doctor contribution for malformed static provider catalog projection, with focused tests and a comment keeping runtime projection on the typed catalog contract.

PR surface: Source +529, Tests +606. Total +1135 across 8 files.

Reproducibility: no. executed high-confidence current-main repro was run in this read-only review. The source path is clear: current projection directly iterates provider catalog rows, and the PR adds focused tests for malformed shapes that would otherwise reach that projection boundary.

Review metrics: 1 noteworthy metric.

  • Doctor Health Checks: 1 added. A new normal doctor contribution can change operator-facing health status for existing provider catalog issues.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Confirm maintainer acceptance of the new doctor health failure mode for malformed static provider catalogs.
  • [P2] Add or cite representative openclaw doctor smoke proof for healthy bundled provider catalogs before landing if maintainers want stronger upgrade confidence.

Risk before merge

  • [P1] Merging this changes normal openclaw doctor behavior: malformed static provider catalogs now make doctor health unhealthy instead of remaining a runtime/model-catalog projection failure.
  • [P1] The new normal doctor contribution resolves full provider registrations and executes static catalog hooks; the context is sterile, but maintainers should accept that broader provider-plugin execution and diagnostic surface before merge.

Maintainer options:

  1. Accept Stricter Doctor Diagnostics (recommended)
    Maintainers can land if they intentionally want malformed static provider catalogs to fail normal doctor health and guide operators to fix or disable the plugin.
  2. Add Representative Doctor Smoke Proof
    Before merge, run a real or packaged openclaw doctor/provider-catalog smoke against representative bundled provider catalogs to show the new check stays clean for healthy installs.
  3. Pause If Runtime Tolerance Is Desired
    If maintainers want old malformed catalog tolerance or runtime fallback semantics, pause this PR and choose that provider catalog contract explicitly instead.

Next step before merge

  • [P2] Human review is the next action because the PR has a protected maintainer label and compatibility/auth-provider merge risk, with no narrow automated repair identified.

Security
Cleared: No dependency, workflow, lockfile, secret, or supply-chain changes were found; the new static catalog execution uses the existing sterile context and is tracked as compatibility risk rather than a concrete security defect.

Review details

Best possible solution:

Land only after maintainer review confirms the stricter doctor-owned provider catalog diagnostics are intentional and representative provider catalog proof is adequate, while keeping runtime projection on the typed contract.

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

No executed high-confidence current-main repro was run in this read-only review. The source path is clear: current projection directly iterates provider catalog rows, and the PR adds focused tests for malformed shapes that would otherwise reach that projection boundary.

Is this the best way to solve the issue?

Mostly yes: moving malformed catalog diagnostics into doctor matches the repository preference to keep runtime projection on a typed contract. The remaining question is merge policy, because the new doctor check deliberately makes malformed provider catalogs operator-visible and unhealthy.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 5dc4531fdf56.

Label changes

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: The PR is member-authored, so the external-contributor real behavior proof gate does not apply; the body records focused tests and explicitly says no live provider/network catalog calls were tested.
  • remove rating: 🌊 off-meta tidepool: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority provider/doctor hardening change with limited blast radius but compatibility-sensitive diagnostics.
  • merge-risk: 🚨 compatibility: The PR makes malformed static provider catalogs fail normal doctor health, which can change upgrade/operator experience for existing plugin setups.
  • merge-risk: 🚨 auth-provider: The changed surface resolves provider plugins and validates provider catalog/model rows that feed model choice and provider routing diagnostics.
  • 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: The PR is member-authored, so the external-contributor real behavior proof gate does not apply; the body records focused tests and explicitly says no live provider/network catalog calls were tested.
Evidence reviewed

PR surface:

Source +529, Tests +606. Total +1135 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 5 531 2 +529
Tests 3 617 11 +606
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 1148 13 +1135

What I checked:

  • Repository policy applied: Root policy treats plugin APIs, provider routing, config/defaults, fallback behavior, and stricter validation as compatibility-sensitive review surfaces. (AGENTS.md:18, 5dc4531fdf56)
  • Scoped plugin policy applied: The plugin scoped guide says provider auth/catalog/onboarding stay plugin-owned and loader behavior must align with documented plugin contracts. (src/plugins/AGENTS.md:31, 5dc4531fdf56)
  • Current projection surface: Current main synthesizes text model catalog providers from provider staticCatalog and runs results through projectProviderCatalogResultToUnifiedTextRows, whose loop directly reads providerConfig.models. (src/plugins/model-catalog-registration.ts:149, 5dc4531fdf56)
  • PR implementation surface: The PR adds collectProviderCatalogProjectionFindings, resolves full provider registrations, groups static catalogs by order, executes static catalog hooks, and returns doctor findings for malformed catalog results. (src/flows/doctor-core-checks.runtime.ts:423, cf2d4fe3561f)
  • Doctor wiring: The PR registers doctor:provider-catalog-projection in the normal doctor contribution list and marks ctx.healthOk false when findings are present. (src/flows/doctor-health-contributions.ts:1144, cf2d4fe3561f)
  • Focused test coverage: The PR adds provider catalog projection tests for unreadable entries, invalid model ids/names/lists, invalid provider keys, invalid static catalog order/hooks, and revoked proxy behavior. (src/flows/doctor-core-checks.runtime.test.ts:510, cf2d4fe3561f)

Likely related people:

  • sqsge: Current-main blame for provider catalog projection and provider-discovery contract code points to commit a76db8c, which is the central surface this PR diagnoses. (role: recent area contributor; confidence: medium; commits: a76db8cff37a; files: src/plugins/provider-catalog-unified-text.ts, src/plugins/provider-discovery.ts, src/flows/doctor-core-checks.runtime.ts)
  • steipete: The PR timeline and commit list show steipete authored most of the current branch commits, renamed the PR to the doctor-focused scope, and force-pushed the reviewed head. (role: recent branch contributor; confidence: medium; commits: a97d91eee230, 82d186d9b19d, cf2d4fe3561f; files: src/flows/doctor-core-checks.runtime.ts, src/flows/doctor-health-contributions.ts, src/plugins/provider-catalog-unified-text.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@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. labels May 30, 2026
@vincentkoc
vincentkoc force-pushed the fuzz-critical-provider-catalog-20260530 branch from 8a7ab79 to d06ca46 Compare May 30, 2026 17:04
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels May 30, 2026
@vincentkoc
vincentkoc force-pushed the fuzz-critical-provider-catalog-20260530 branch from d06ca46 to 7e96af5 Compare May 30, 2026 17:35
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 30, 2026
@vincentkoc
vincentkoc force-pushed the fuzz-critical-provider-catalog-20260530 branch 2 times, most recently from 0cf8ec9 to 33a8362 Compare May 30, 2026 21:16
@vincentkoc
vincentkoc marked this pull request as ready for review May 30, 2026 21:18
@vincentkoc vincentkoc self-assigned this May 30, 2026
@vincentkoc
vincentkoc force-pushed the fuzz-critical-provider-catalog-20260530 branch 5 times, most recently from bcd51a4 to c11f6d7 Compare May 31, 2026 03:09
@vincentkoc
vincentkoc force-pushed the fuzz-critical-provider-catalog-20260530 branch 3 times, most recently from b364db3 to d9d13ac Compare May 31, 2026 10:34
@steipete steipete changed the title fix(plugin-sdk): isolate provider catalog projection failures fix(doctor): diagnose malformed provider catalogs May 31, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. labels May 31, 2026
@steipete
steipete force-pushed the fuzz-critical-provider-catalog-20260530 branch from 147b44d to cf2d4fe Compare May 31, 2026 13:30
@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: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels May 31, 2026
@steipete
steipete force-pushed the fuzz-critical-provider-catalog-20260530 branch from cf2d4fe to 876fdda Compare May 31, 2026 13:43
@steipete

Copy link
Copy Markdown
Contributor

Pre-merge verification for head 876fdda5a352b0f15bfbe2abe9be43ebada7c596:

  • node scripts/run-vitest.mjs src/flows/doctor-core-checks.runtime.test.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.test.ts src/flows/doctor-health-conversion-plan.test.ts src/plugin-sdk/provider-entry.test.ts
  • node_modules/.bin/oxfmt --check src/plugins/provider-catalog-unified-text.ts src/flows/doctor-core-checks.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-core-checks.runtime.ts src/flows/doctor-core-checks.runtime.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts src/flows/doctor-health-conversion-plan.ts src/flows/doctor-health-conversion-plan.test.ts
  • node scripts/run-oxlint.mjs src/flows/doctor-core-checks.runtime.ts src/flows/doctor-core-checks.runtime.test.ts src/plugins/provider-catalog-unified-text.ts
  • pnpm tsgo:test
  • git diff --check origin/main...HEAD
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --prompt-file /tmp/provider-catalog-doctor-review-context.txt

GitHub CI: all PR checks green on run 26714273631 plus selected security/quality checks for this head.

Known proof gap: no live provider/network catalog calls; this is scoped to static provider catalog doctor validation.

@steipete
steipete merged commit cc29005 into main May 31, 2026
146 of 148 checks passed
@steipete
steipete deleted the fuzz-critical-provider-catalog-20260530 branch May 31, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR 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. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants