Skip to content

fix(plugin-sdk): isolate provider catalog projection failures - #88767

Merged
steipete merged 7 commits into
mainfrom
fuzz-critical-provider-catalog-pruned-20260530
Jun 1, 2026
Merged

steipete merged 7 commits into
mainfrom
fuzz-critical-provider-catalog-pruned-20260530

Conversation

@vincentkoc

@vincentkoc vincentkoc commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • isolates provider catalog projection so unreadable plugin-owned provider/model rows are skipped instead of hiding healthy siblings
  • filters malformed provider auth entries before provider registration while preserving valid auth methods and env vars
  • guards paired provider catalog API-key injection from throwing provider configs

Verification

  • node scripts/run-vitest.mjs src/plugin-sdk/provider-entry.test.ts src/plugins/provider-catalog.test.ts --reporter=dot passed 1 shard / 14 tests after final rebase
  • node_modules/.bin/oxfmt --check --threads=1 src/plugin-sdk/provider-entry.ts src/plugin-sdk/provider-entry.test.ts src/plugins/provider-catalog-unified-text.ts src/plugins/provider-catalog.ts src/plugins/provider-catalog.test.ts src/shared/safe-record.ts passed
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.json src/plugin-sdk/provider-entry.ts src/plugin-sdk/provider-entry.test.ts src/plugins/provider-catalog-unified-text.ts src/plugins/provider-catalog.ts src/plugins/provider-catalog.test.ts src/shared/safe-record.ts passed
  • git diff --check origin/main...HEAD passed after final rebase
  • private reported-name scrub over the branch diff passed
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main passed clean, overall 0.84
  • AWS Crabbox changed gate passed: provider aws, lease cbx_508d1fb17e4f, run run_421055b8dbcb, slug harbor-crab, command pnpm check:changed, selected lanes core, coreTests, extensions, extensionTests, exit 0
  • Blacksmith Testbox proof was attempted first but local Blacksmith auth is missing; AWS Crabbox was used instead of running the broad gate locally

Real behavior proof

Behavior addressed: hostile or malformed plugin provider catalog/auth rows no longer make provider projection fail before healthy sibling provider data can be used.

Real environment tested: linked OpenClaw gwt worktree rebased onto current origin/main, final head 1fcab057102b.

Exact steps or command run after this patch: rebased the pruned provider-catalog slice onto current origin/main, reran focused provider-entry/provider-catalog tests, formatter, lint, diff check, private-name scrub, branch autoreview, and AWS Crabbox pnpm check:changed.

Evidence after fix: focused regressions pass for unreadable provider catalog entries, unreadable provider model rows, unreadable provider auth option rows, and unreadable paired provider catalog configs while preserving healthy siblings.

Observed result after fix: healthy provider catalog rows and auth methods remain registered/projected while only unreadable sibling rows are omitted.

What was not tested: full repo-wide test suite or a live external plugin process; this PR uses the existing provider/plugin SDK harness plus remote changed-gate proof to exercise the projection paths directly.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels May 31, 2026
@clawsweeper

clawsweeper Bot commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 1, 2026, 12:28 AM ET / 04:28 UTC.

Summary
The branch adds shared safe record/catalog projection helpers, applies them to provider-entry/discovery/paired API-key catalog paths, updates cron nullable tool schemas and Codex prompt snapshots, and wraps Matrix auto-join invite tasks for lint-safe error handling.

PR surface: Source +254, Tests +563. Total +817 across 19 files.

Reproducibility: yes. by source inspection: current main directly enumerates and reads plugin-owned provider/model rows, so a throwing getter can abort projection before healthy siblings are used. I did not run tests because this review is read-only.

Review metrics: 1 noteworthy metric.

  • Provider catalog failure-mode paths: 3 paths changed. Model-catalog projection, discovery normalization, and paired API-key catalog injection now omit unreadable rows, which is the compatibility decision maintainers should notice before merge.

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:

  • [P2] Maintainers should explicitly accept the omit-bad-row provider catalog behavior before merge.
  • Confirm current-head checks cover the latest force-pushed head.

Risk before merge

  • [P1] The PR intentionally changes malformed plugin provider catalog/auth behavior from fail-whole-projection to omit-bad-row, so maintainers need to accept that plugin SDK/provider compatibility tradeoff before merge.
  • [P1] The PR body proof is harness-focused and changed-gate based; it explicitly did not exercise a live installed third-party plugin process.
  • [P1] The PR body names an older tested worktree head than the current PR head, so maintainers should rely on current-head checks before landing.

Maintainer options:

  1. Accept bad-row isolation (recommended)
    Maintainers can accept that malformed provider/auth rows are omitted while healthy siblings stay visible, then merge after current-head checks pass.
  2. Require strict diagnostics first
    If fail-whole-projection is intentional for plugin diagnostics, ask for an opt-in strict mode or doctor diagnostic before changing runtime semantics.
  3. Pause for live plugin proof
    If maintainers require proof from an installed third-party plugin process, hold the PR until that current-head scenario is shown.

Next step before merge

  • [P2] Manual maintainer review is the right lane because the remaining blocker is compatibility acceptance and current-head validation, not a narrow automated repair.

Security
Cleared: No concrete security or supply-chain regression was found; the diff adds no dependency/workflow/package changes and safe-read helpers reduce malformed plugin crash exposure.

Review details

Best possible solution:

Land the shared projection hardening only after maintainers explicitly accept omit-bad-row provider catalog semantics and current-head validation is green.

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

Yes, by source inspection: current main directly enumerates and reads plugin-owned provider/model rows, so a throwing getter can abort projection before healthy siblings are used. I did not run tests because this review is read-only.

Is this the best way to solve the issue?

Yes, conditional on maintainer acceptance: centralizing safe provider catalog copying is a better fix than scattered try/catch at each caller. The remaining question is whether omit-bad-row is the desired plugin SDK compatibility behavior.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P2: This is a bounded plugin SDK/provider catalog hardening fix with limited blast radius but real provider/plugin compatibility impact.
  • merge-risk: 🚨 compatibility: Merging changes malformed plugin provider catalog/auth rows from failing a whole projection to omitting only unreadable rows.
  • 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 contributor proof gate is not applicable because this is a maintainer/MEMBER PR; the body nevertheless records harness and AWS Crabbox changed-gate proof, with no live third-party plugin process.
Evidence reviewed

PR surface:

Source +254, Tests +563. Total +817 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 8 301 47 +254
Tests 11 671 108 +563
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 972 155 +817

What I checked:

  • Repository policy: Root policy treats plugin APIs, provider routing, config/defaults, setup, and fallback behavior as compatibility-sensitive merge risk, and this review applied that to the provider catalog failure-mode change. (AGENTS.md:30, dc9e67d2d472)
  • Current-main behavior: Current main projects provider catalog rows with Object.entries(result.providers) and direct providerConfig.models/model reads, so one unreadable plugin-owned row can abort the whole projection before healthy siblings are emitted. (src/plugins/provider-catalog-unified-text.ts:19, dc9e67d2d472)
  • Shared PR fix: The PR adds a shared ProviderCatalogResultProjection copier that safely reads provider/provider-list/model fields and returns only readable provider rows instead of exposing callers to throwing getters. (src/plugins/provider-catalog-result.ts:52, 9167b9525ce2)
  • Sibling surfaces updated: Provider discovery now consumes the same copied projection before normalizing provider keys, which keeps the runtime catalog and discovery paths aligned. (src/plugins/provider-discovery.ts:114, 9167b9525ce2)
  • Regression coverage: The branch adds tests for unreadable provider entries, model rows, auth option rows, paired provider configs, and preserving healthy siblings or id-only models. (src/plugin-sdk/provider-entry.test.ts:241, 9167b9525ce2)
  • Codex contract checked: Sibling Codex source stores dynamic tool input_schema as raw JSON, parses it through JsonSchema, and its supported schema subset includes null and anyOf, so the Codex prompt snapshot nullable schema update is not contradicted by Codex source. (../codex/codex-rs/tools/src/json_schema.rs:11, 3b7334d099b3)

Likely related people:

  • vincentkoc: Current main blame for provider catalog projection, discovery normalization, and provider-entry helper code points to commit 0c3644c authored by Vincent Koc. (role: current-main code author and recent area contributor; confidence: high; commits: 0c3644cb2477, dc9e67d2d472; files: src/plugins/provider-catalog-unified-text.ts, src/plugins/provider-discovery.ts, src/plugin-sdk/provider-entry.ts)
  • steipete: Recent history shows repeated provider catalog/helper work by Peter Steinberger, and most follow-up commits on this PR are authored and committed by him. (role: recent provider/catalog contributor and PR branch committer; confidence: high; commits: 956fe72b39e6, 0b26e4d72ae3, 39183746bab0; files: src/plugin-sdk/provider-entry.ts, src/plugins/provider-catalog.ts, src/plugins/provider-catalog-result.ts)
  • Takhoffman: Recent path history includes provider catalog normalization commits by Tak Hoffman around the same provider-catalog lookup surface. (role: adjacent provider catalog normalization contributor; confidence: medium; commits: 7ccf4552aca1, fe295b15a5a4; files: src/plugins/provider-catalog.ts, src/plugins/provider-discovery.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.

@vincentkoc
vincentkoc marked this pull request as ready for review May 31, 2026 20:09
@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. P2 Normal backlog priority with limited blast radius. labels May 31, 2026
@steipete steipete self-assigned this Jun 1, 2026

@steipete steipete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR hardens the unified model-catalog projection for provider-owned catalog/auth rows. The direction is useful, but the fix is currently one-sided: the same ProviderCatalogResult shape still flows through legacy discovery callers that do not use the new safe projection.

Findings

  • Blocking: unreadable provider entries still break live picker/list/implicit-provider discovery. The new regression at src/plugin-sdk/provider-entry.test.ts:241 only proves modelCatalogProvider.liveCatalog, which reaches projectProviderCatalogResultToUnifiedTextRows. But the same catalog hook still returns { providers } through provider.catalog.run, and current consumers call normalizePluginDiscoveryResult after the catalog try/catch: src/flows/model-picker.provider-catalog.ts:218, src/commands/models/list.provider-catalog.ts:303, and src/agents/models-config.providers.implicit.ts:417. normalizePluginDiscoveryResult still does Object.entries(result.providers) and reads each value directly at src/plugins/provider-discovery.ts:130, so the accessor used in the new test can still throw there and abort the picker/list/implicit-provider path instead of preserving the healthy sibling. The safe-record logic should either move into the shared ProviderCatalogResult normalization path, or the affected callers need matching coverage and isolation semantics.

LOC: +320/-34 (6 files)

Best-fix verdict: too narrow. The best fix is to centralize safe ProviderCatalogResult normalization/projection at the shared boundary used by both unified rows and legacy discovery, so the invariant is not split between two paths.

Alternatives considered: keeping the hardening only in provider-catalog-unified-text is insufficient because live picker/list/implicit-provider discovery still use normalizePluginDiscoveryResult; catching around each caller would duplicate policy and still leave future callers exposed.

Code read: src/plugin-sdk/provider-entry.ts, src/plugins/provider-catalog-unified-text.ts, src/plugins/provider-catalog.ts, src/shared/safe-record.ts, src/plugins/provider-discovery.ts, src/flows/model-picker.provider-catalog.ts, src/commands/models/list.provider-catalog.ts, src/agents/models-config.providers.implicit.ts, src/flows/doctor-core-checks.runtime.ts, src/plugins/model-catalog-registration.ts.

Verification checked: git diff --check origin/main...FETCH_HEAD passed; GitHub checks are green; I did not rerun PR tests locally because I stayed on main for review.

Remaining uncertainty: no live external plugin process was exercised here; this is source-path proof against the exact unreadable provider-row shape added by the PR.

@vincentkoc
vincentkoc force-pushed the fuzz-critical-provider-catalog-pruned-20260530 branch from d5e3c79 to 1fcab05 Compare June 1, 2026 02:06
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed 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 Jun 1, 2026
@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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XL and removed size: L labels Jun 1, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jun 1, 2026
@steipete
steipete force-pushed the fuzz-critical-provider-catalog-pruned-20260530 branch 3 times, most recently from f8bac15 to 18d8038 Compare June 1, 2026 04:16
@openclaw-barnacle openclaw-barnacle Bot added the channel: matrix Channel integration: matrix label Jun 1, 2026
@steipete
steipete force-pushed the fuzz-critical-provider-catalog-pruned-20260530 branch from 18d8038 to 9167b95 Compare June 1, 2026 04:22
@steipete

steipete commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Land-ready verification for 9167b9525ce20c5ae48db0a5a279082a24d468a3:

Local:

  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main clean, no accepted/actionable findings.
  • PATH="$HOME/.local/share/fnm/node-versions/v24.15.0/installation/bin:$PATH" node scripts/run-vitest.mjs src/agents/tools/cron-tool.schema.test.ts src/agents/tools/cron-tool.test.ts src/plugin-sdk/provider-entry.test.ts src/plugins/provider-catalog.test.ts src/plugins/provider-discovery.test.ts --reporter=verbose
  • PATH="$HOME/.local/share/fnm/node-versions/v24.15.0/installation/bin:$PATH" OPENCLAW_VITEST_MAX_WORKERS=2 NODE_OPTIONS=--max-old-space-size=8192 OPENCLAW_VITEST_SHARD_NAME=agentic-agents-tools OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 OPENCLAW_TEST_PROJECTS_PARALLEL=2 pnpm exec node scripts/test-projects.mjs test/vitest/vitest.agents-tools.config.ts
  • PATH="$HOME/.local/share/fnm/node-versions/v24.15.0/installation/bin:$PATH" pnpm prompt:snapshots:check
  • pnpm lint --threads=8
  • OPENCLAW_LOCAL_CHECK=0 NODE_BIN="$HOME/.local/share/fnm/node-versions/v24.15.0/installation/bin" PATH="$HOME/.local/share/fnm/node-versions/v24.15.0/installation/bin:$PATH" node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/matrix/src/matrix/monitor/events.ts extensions/matrix/src/matrix/monitor/auto-join.ts
  • git diff --check

CI:

  • gh pr checks 88767 --watch --interval 30 green on 9167b9525ce20c5ae48db0a5a279082a24d468a3.

@steipete steipete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed after the follow-up fixes. The provider catalog projection now isolates unreadable provider/model rows across both unified and legacy discovery paths, preserves id-only model rows, and skips provider configs without a readable baseUrl.

CI is green on 9167b9525ce20c5ae48db0a5a279082a24d468a3.

@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 1, 2026
@steipete
steipete force-pushed the fuzz-critical-provider-catalog-pruned-20260530 branch from 9167b95 to 63c0841 Compare June 1, 2026 04:31
@steipete

steipete commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Rebased land-ready verification for 63c08416bc163dfff839fa3e503b6fcb8f5b8fcb:

Local:

  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main clean, no accepted/actionable findings.
  • PATH="$HOME/.local/share/fnm/node-versions/v24.15.0/installation/bin:$PATH" node scripts/run-vitest.mjs src/agents/tools/cron-tool.schema.test.ts src/agents/tools/cron-tool.test.ts src/plugin-sdk/provider-entry.test.ts src/plugins/provider-catalog.test.ts src/plugins/provider-discovery.test.ts --reporter=verbose
  • PATH="$HOME/.local/share/fnm/node-versions/v24.15.0/installation/bin:$PATH" pnpm prompt:snapshots:check
  • ./node_modules/.bin/oxfmt --check src/agents/tools/cron-tool.ts src/agents/tools/cron-tool.schema.test.ts src/agents/tools/cron-tool.test.ts src/plugin-sdk/provider-entry.ts src/plugin-sdk/provider-entry.test.ts src/plugins/provider-catalog-result.ts src/plugins/provider-catalog-unified-text.ts src/plugins/provider-discovery.ts src/plugins/provider-discovery.test.ts src/plugins/provider-catalog.ts src/plugins/provider-catalog.test.ts src/shared/safe-record.ts extensions/matrix/src/matrix/monitor/auto-join.ts
  • OPENCLAW_LOCAL_CHECK=0 NODE_BIN="$HOME/.local/share/fnm/node-versions/v24.15.0/installation/bin" PATH="$HOME/.local/share/fnm/node-versions/v24.15.0/installation/bin:$PATH" node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/matrix/src/matrix/monitor/auto-join.ts
  • git diff --check origin/main...HEAD

The rebase conflict was limited to cron schema tests/helpers already partially present on current main; the resolved raw schema keeps explicit anyOf null-clear validation while provider-normalized schemas remain OpenAPI-compatible.

@steipete
steipete merged commit 296cd8c into main Jun 1, 2026
167 of 169 checks passed
@steipete
steipete deleted the fuzz-critical-provider-catalog-pruned-20260530 branch June 1, 2026 04:35
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 1, 2026
…aw#88767)

* fix(plugin-sdk): isolate provider catalog projection failures

* fix(plugin-sdk): share safe provider catalog projection

* fix(cron): preserve raw null clear schema

* fix(plugin-sdk): copy provider catalog model rows safely

* fix(plugin-sdk): keep id-only catalog models

* fix(plugin-sdk): require readable provider catalog base url

* fix(ci): satisfy cron and matrix lint checks

---------

Co-authored-by: Peter Steinberger <[email protected]>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…aw#88767)

* fix(plugin-sdk): isolate provider catalog projection failures

* fix(plugin-sdk): share safe provider catalog projection

* fix(cron): preserve raw null clear schema

* fix(plugin-sdk): copy provider catalog model rows safely

* fix(plugin-sdk): keep id-only catalog models

* fix(plugin-sdk): require readable provider catalog base url

* fix(ci): satisfy cron and matrix lint checks

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: matrix Channel integration: matrix maintainer Maintainer-authored PR 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: L 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