fix(firecrawl): reject malformed 2xx response envelopes#111210
Conversation
|
Codex review: needs changes before merge. Reviewed July 19, 2026, 11:38 PM ET / July 20, 2026, 03:38 UTC. Summary PR surface: Source 0, Tests +69. Total +69 across 2 files. Reproducibility: yes. from source: current main’s generic reader accepts parsed Review metrics: none identified. 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:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Extend the shared object-envelope reader with the same optional byte-limit argument as the generic reader, forward it unchanged, and retain Firecrawl’s 64 MiB Scrape limit while rejecting non-object successful envelopes. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main’s generic reader accepts parsed Is this the best way to solve the issue? No, not as written: using the shared object reader is the best boundary, but it must preserve the caller’s existing byte-limit option rather than call an incompatible two-argument API. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 200653bd60c8. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source 0, Tests +69. Total +69 across 2 files. View PR surface stats
Acceptance criteria:
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 (5 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
7884d71 to
d9d653f
Compare
c71727a to
66afbea
Compare
|
Merged via squash.
|
) * fix(firecrawl): reject malformed JSON envelopes * test(firecrawl): use canonical plugin config fixture Co-authored-by: Alix-007 <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where Firecrawl Search and Scrape could receive a successful HTTP response with a
nullor array JSON body, then either return an invalid empty result or throw a rawTypeErrorinstead of a stable provider error.Why This Change Was Made
The shared Firecrawl response reader now uses
readProviderJsonObjectResponse, which enforces the top-level object envelope already required by Firecrawl v2. The existing bounded body reader, endpoint guards, error labels, cache behavior, and valid payload handling remain unchanged.User Impact
Malformed upstream responses fail with the existing provider-owned
malformed JSON responseboundary. Valid Firecrawl responses continue through the same Search and Scrape paths.Evidence
mainat5e51c4bbcca3c3af767ebf1d74e2fcfd0c398195.e48d9f1247446226a5b96d5396b338f4d0ded99f.node scripts/run-vitest.mjs extensions/firecrawl/src/firecrawl-tools.test.ts extensions/firecrawl/src/firecrawl-client.test.ts --run-> 2 files, 101/101 tests passed.oxfmtandgit diff --checkpassed.nullfor/v2/searchand HTTP 200 with[]for/v2/scrape; the realrunFirecrawlSearchandrunFirecrawlScrapeentry paths produced these exact redacted outputs:MALFORMED_SHAPElines.runFirecrawlScrapeentry againsthttps://api.firecrawl.dev/v2/scrapewith no API key and returned an object result withextractor=firecrawl,extractMode=markdown,textLength=304, and the expected Example Domain content.LIVE_API status=200 topLevel=object successType=boolean dataType=object; the successful production entry emitted:LIVE_PRODUCTION resultType=object extractor=firecrawl extractMode=markdown textLength=304 exampleDomain=true.successand objectdata;nulland arrays are outside that contract.