fix(plugins): wrap self-hosted discovery JSON parse in try/catch#99892
fix(plugins): wrap self-hosted discovery JSON parse in try/catch#99892cxbAsDev wants to merge 4 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 12:06 PM ET / 16:06 UTC. Summary PR surface: Source +4, Tests +35, Other +43. Total +82 across 3 files. Reproducibility: yes. from source: current main decodes the bounded discovery body and passes malformed bytes directly to Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land the narrow shared-helper diagnostic after normal maintainer review, preserving bounded reads and fail-soft discovery behavior. Do we have a high-confidence way to reproduce the issue? Yes from source: current main decodes the bounded discovery body and passes malformed bytes directly to Is this the best way to solve the issue? Yes. Wrapping AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 286d0b9fb340. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +4, Tests +35, Other +43. Total +82 across 3 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
Review history (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
e31ab7f to
e5e4145
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
c0542b6 to
b6850ff
Compare
Malformed JSON from a self-hosted provider discovery endpoint would throw an uncaught SyntaxError, crashing the provider setup flow. Wrap in try/catch and rethrow with a descriptive error message. Co-Authored-By: Claude <[email protected]>
…y JSON Co-Authored-By: Claude <[email protected]>
b6850ff to
425683e
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Source: #99892 Co-authored-by: 陈宪彪0668000387 <[email protected]>
* fix(agents): harden LSP process failures Source: #100450 Co-authored-by: morluto <[email protected]> * fix(sandbox): report effective workspace layout Sources: #100435, #100439 Co-authored-by: Aniruddha Adak <[email protected]> Co-authored-by: ZengWen-DT <[email protected]> * fix(security): fail install checks on stream errors Source: #100413 Co-authored-by: 陈宪彪0668000387 <[email protected]> * fix(android): normalize all-day calendar events Source: #100032 Co-authored-by: NianJiuZst <[email protected]> * fix(ios): serialize push-to-talk lifecycle Source: #99942 Co-authored-by: NianJiuZst <[email protected]> * fix(talk): reject inherited provider names Source: #99849 Co-authored-by: zenglingbiao <[email protected]> * fix(android): stop voice capture in background Source: #99840 Co-authored-by: xialonglee <[email protected]> * fix(cron): preserve fallback result classification Source: #99913 Co-authored-by: jincheng-xydt <[email protected]> * fix(google): bound Vertex response decompression Source: #99812 Co-authored-by: 黄剑雄0668001315 <[email protected]> * fix(plugins): report malformed discovery JSON Source: #99892 Co-authored-by: 陈宪彪0668000387 <[email protected]> * test(sandbox): configure non-default workspace fixture * test: fix small-fix batch validation --------- Co-authored-by: morluto <[email protected]> Co-authored-by: ZengWen-DT <[email protected]> Co-authored-by: 陈宪彪0668000387 <[email protected]> Co-authored-by: NianJiuZst <[email protected]> Co-authored-by: zenglingbiao <[email protected]> Co-authored-by: xialonglee <[email protected]> Co-authored-by: jincheng-xydt <[email protected]> Co-authored-by: 黄剑雄0668001315 <[email protected]>
|
Thanks @cxbAsDev — your malformed discovery-response fix was incorporated into #100483, landed as aaf5ab9. The landed version preserves both the self-hosted provider label and the original parse cause, with logger-level regression coverage. Contributor credit is preserved. Closing this superseded PR. |
* fix(agents): harden LSP process failures Source: openclaw#100450 Co-authored-by: morluto <[email protected]> * fix(sandbox): report effective workspace layout Sources: openclaw#100435, openclaw#100439 Co-authored-by: Aniruddha Adak <[email protected]> Co-authored-by: ZengWen-DT <[email protected]> * fix(security): fail install checks on stream errors Source: openclaw#100413 Co-authored-by: 陈宪彪0668000387 <[email protected]> * fix(android): normalize all-day calendar events Source: openclaw#100032 Co-authored-by: NianJiuZst <[email protected]> * fix(ios): serialize push-to-talk lifecycle Source: openclaw#99942 Co-authored-by: NianJiuZst <[email protected]> * fix(talk): reject inherited provider names Source: openclaw#99849 Co-authored-by: zenglingbiao <[email protected]> * fix(android): stop voice capture in background Source: openclaw#99840 Co-authored-by: xialonglee <[email protected]> * fix(cron): preserve fallback result classification Source: openclaw#99913 Co-authored-by: jincheng-xydt <[email protected]> * fix(google): bound Vertex response decompression Source: openclaw#99812 Co-authored-by: 黄剑雄0668001315 <[email protected]> * fix(plugins): report malformed discovery JSON Source: openclaw#99892 Co-authored-by: 陈宪彪0668000387 <[email protected]> * test(sandbox): configure non-default workspace fixture * test: fix small-fix batch validation --------- Co-authored-by: morluto <[email protected]> Co-authored-by: ZengWen-DT <[email protected]> Co-authored-by: 陈宪彪0668000387 <[email protected]> Co-authored-by: NianJiuZst <[email protected]> Co-authored-by: zenglingbiao <[email protected]> Co-authored-by: xialonglee <[email protected]> Co-authored-by: jincheng-xydt <[email protected]> Co-authored-by: 黄剑雄0668001315 <[email protected]>
What Problem This Solves
Fixes an issue where a self-hosted provider discovery endpoint returning malformed JSON would produce a raw
SyntaxErrorwithout identifying which endpoint failed. This made it hard for operators and developers to diagnose which local or self-hosted provider returned bad data during setup or model discovery.Why This Change Was Made
Wrapped
JSON.parseinsidereadSelfHostedDiscoveryJsonwith atry/catchthat rethrows anErrorcarrying the endpoint label (e.g.ollama discovery response is not valid JSON) and the original parse failure ascause. The change is scoped to the shared discovery helper so both/modelsand llama.cpp/propsdiscovery benefit from the same diagnostic.User Impact
When a self-hosted provider returns non-JSON or malformed JSON during discovery, the resulting warning/error now names the provider endpoint instead of surfacing only a bare
SyntaxError, speeding up diagnosis.Evidence
Real environment tested: Linux, Node 22, branch
fix/provider-self-hosted-setup-json-parseProof command:
Proof output:
Regression test:
The regression test "wraps malformed discovery JSON with a descriptive error" asserts that the logged warning contains
malformed-test discovery response is not valid JSON.🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]