Repository navigation
fix(plugin-sdk): isolate provider catalog projection failures - #88767
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 1, 2026, 12:28 AM ET / 04:28 UTC. Summary 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.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest 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 changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +254, Tests +563. Total +817 across 19 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
steipete
left a comment
There was a problem hiding this comment.
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.
d5e3c79 to
1fcab05
Compare
f8bac15 to
18d8038
Compare
18d8038 to
9167b95
Compare
|
Land-ready verification for Local:
CI:
|
steipete
left a comment
There was a problem hiding this comment.
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.
9167b95 to
63c0841
Compare
|
Rebased land-ready verification for Local:
The rebase conflict was limited to cron schema tests/helpers already partially present on current |
…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]>
…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]>
Summary
Verification
node scripts/run-vitest.mjs src/plugin-sdk/provider-entry.test.ts src/plugins/provider-catalog.test.ts --reporter=dotpassed 1 shard / 14 tests after final rebasenode_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.tspassednode 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.tspassedgit diff --check origin/main...HEADpassed after final rebase.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainpassed clean, overall 0.84aws, leasecbx_508d1fb17e4f, runrun_421055b8dbcb, slugharbor-crab, commandpnpm check:changed, selected lanescore,coreTests,extensions,extensionTests, exit 0Real 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 head1fcab057102b.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 Crabboxpnpm 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.