Repository navigation
refactor: use the shared Tavily response reader directly - #134255
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:16 PM ET / 16:16 UTC. ClawSweeper reviewWhat this changesThe PR removes Tavily’s unused JSON-response forwarding wrapper and calls the shared bounded provider JSON parser directly. Merge readinessKeep open. The direct call is a behavior-preserving cleanup with no actionable defect found, and current main still retains the private wrapper; this member-authored, maintainer-labeled PR should follow normal merge review. Priority: P3 Review scores
Verification
How this fits togetherThe Tavily plugin sends search and extraction requests through a guarded web transport, then parses the provider response before returning bounded results to Tavily tools. The shared parser owns JSON decoding, byte limits, and malformed-response errors. flowchart LR
A[Tavily search or extract] --> B[Tavily client]
B --> C[Guarded web transport]
C --> D[Shared bounded JSON parser]
D --> E[Bounded Tavily result]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -9. Total -9 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Merge the direct shared-parser use once the exact-head normal review and CI gates are satisfied. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a behavior-preserving refactor, and its parser/transport behavior is covered by existing focused tests. Is this the best way to solve the issue? Yes. Direct use of the existing shared parser removes an unused private layer while retaining the same transport callback, label, result type, and byte-cap inputs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9cc05cca83e2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Tavily's private response-reader wrapper immediately forwards to the shared bounded JSON parser. Its property on the testing object has no consumer, so the wrapper and property add an unnecessary path between transport and parsing.
Why This Change Was Made
Call the existing shared parser directly from the same async transport callback. Keep the same response, error label, generic result type and maxBytes option. The transport still awaits parsing before cleanup. Keep testing.resolveEndpoint and its reverse-proxy and fallback cases.
User Impact
No intended behavior change. The one-file diff is +1/-10: eight net runtime lines and one unused test-support property removed. Search and extract retain their separate response caps, cancellation and cleanup boundaries, errors, request construction, cache behavior and configuration. No new export or test is added.
Evidence
Read the full client, transport/parser owners and tests, callers, sibling tools/configuration/cache tests, public barrels, manifest, documentation and raw-parent history. All 32 source references still match the previously tested candidate. No caller uses the removed testing property.
The exact change passed 46 cases before and after with identical names and order. These include the client and canonical parser suites plus two temporary synthetic transport probes: valid 17 MiB JSON exercises distinct search/extract caps, and an 80 MiB extract stream exercises overflow and cancellation of unread data. The temporary probes were removed and the original test restored. The remaining 29 tool, configuration and cache cases also pass.
All 24 required changed-file checks and fresh scoped Codex review pass. This is synthetic parser/transport proof, not live Tavily API, latency, exact microtask-count or bundled-release proof.