Repository navigation
fix(plugin-sdk): contextualize malformed provider catalogs - #109754
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:38 AM ET / 09:38 UTC. ClawSweeper reviewWhat this changesThe branch routes live provider catalog parsing through the shared bounded JSON reader so malformed responses identify the catalog operation and do not retain credential-bearing parser causes. Merge readinessKeep open: current main still exposes raw catalog parser failures, while this focused patch centralizes bounded parsing, context, and credential-safe error handling without a concrete introduced regression. Priority: P2 Review scores
Verification
How this fits togetherLive provider discovery fetches and paginates model catalogs before provider plugins project those models into runtime configuration. The changed reader is the boundary between guarded HTTP responses and catalog parsing. flowchart LR
A[Provider catalog endpoint] --> B[Guarded HTTP fetch]
B --> C[Bounded JSON reader]
C --> D[Catalog parsing]
D --> E[Pagination]
E --> F[Runtime model configuration]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +158. Total +162 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused shared-reader reuse after exact-head checks pass, retaining the anonymous upstream catalog’s parser cause, explicit eight-megabyte ceiling, and existing static fallbacks. Do we have a high-confidence way to reproduce the issue? Yes: the supplied local-TCP guarded-fetch scenario reaches the real discovery owner through pagination and asserts the post-fix error behavior; this read-only review did not execute it. Is this the best way to solve the issue? Yes: reusing the existing bounded provider JSON reader removes duplicate parsing while retaining limits, fatal decoding, release behavior, and provider static fallbacks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8b7d685b2a92. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
Co-authored-by: krissding <[email protected]>
91d22d3 to
8825ac6
Compare
|
@clawsweeper re-review Reviewed head: Before-merge and rank-up dispositions from the August 27 review:
Validation: 82 focused provider/catalog tests, 2 anonymous-401 tests, and 1108 plugin contract tests passed. Plugin SDK surface, boundary, deadcode, lint, format, and max-lines checks are clean. Production delta is +18/-14 (net +4). Structured autoreview and independent verification found no issues. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper current-head dispositions for
|
|
Merged via squash.
|
…109754) Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: krissding <[email protected]>
What Problem This Solves
Fixes an issue where operators using live provider model discovery could receive a raw JSON parser error when a provider returned a malformed successful response. The error did not identify the provider operation, and reflected request credentials could appear in the parser cause.
Why This Change Was Made
Live model catalog responses now use the canonical bounded provider JSON reader. Ordinary discovery errors include the provider ID, redact reflected request headers from parser causes, and retain the existing 4 MiB limit. The anonymous shared upstream catalog keeps its useful
SyntaxErrorcause and separate 8 MiB limit. Existing fatal UTF-8/BOM handling, stall diagnostics, response release, pagination, anonymous 401 retry, and static fallback behavior remain unchanged.The original proposal also changed Google prompt-cache parsing. Those unrelated edits were removed from this PR. Invalid Google cache creation degrading to uncached streaming remains a separate follow-up.
User Impact
Malformed provider catalog responses now produce actionable errors such as
provider model discovery: malformed JSON responsewithout exposing reflected credentials. Shared anonymous catalog failures identifyupstream-provider-catalogwhile retaining the parser cause for diagnosis.Evidence
SyntaxError; custom JSON overflow callbacks were ignored.8825ac6fafa16361d677c442a56aa7a857343447.The full local build completed runtime, packages, external plugins, CLI bootstrap, postbuild, and all 148 public Plugin SDK export checks. UI loading and core-test typechecking were blocked by unrelated shared
node_modulesdrift (pako1.0.11 installed versus 3.0.1 required); dependencies were intentionally not reconciled in the isolated worktree. Hosted exact-head CI and Testbox are the authoritative clean-environment gates.The final commit preserves @krissding's authorship with:
Co-authored-by: krissding <[email protected]>