Skip to content

refactor: use the shared Tavily response reader directly - #134255

Merged
steipete merged 1 commit into
mainfrom
codex/test-audit-tavily-reader
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-audit-tavily-reader

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 31, 2026 16:09
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:16 PM ET / 16:16 UTC.

ClawSweeper review

What this changes

The PR removes Tavily’s unused JSON-response forwarding wrapper and calls the shared bounded provider JSON parser directly.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep 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
Reviewed head: c8da45dc0aaa4538872eb3cd58b26beca2c5b34d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, focused cleanup with source-backed equivalence and existing coverage for the retained parser behavior.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored refactor preserves the same guarded transport and shared parser inputs; no separate external-contributor real-behavior-proof gate applies.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored refactor preserves the same guarded transport and shared parser inputs; no separate external-contributor real-behavior-proof gate applies.
Evidence reviewed 6 items Introduced behavior: The PR directly invokes the shared parser with the unchanged Tavily error label and response byte cap, removing only the forwarding wrapper.
Transport ownership: The shared transport awaits its response parser after successful HTTP handling, preserving completion and cleanup ordering.
Shared-reader contract: The shared parser applies the byte cap before JSON decoding and keeps the caller-provided malformed-JSON label.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed because the reviewed patch has no concrete defect; it should proceed through ordinary exact-head validation.
Agent review details

Security

None.

PR surface

Source -9. Total -9 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 1 10 -9
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 10 -9

Review metrics

Metric Value Why it matters
Production versus test delta production -9 net; tests 0 The change removes a private forwarding path without altering configuration, API, or response-limit behavior.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a low-risk internal cleanup with no intended user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored refactor preserves the same guarded transport and shared parser inputs; no separate external-contributor real-behavior-proof gate applies.

Label justifications:

  • P3: This is a low-risk internal cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored refactor preserves the same guarded transport and shared parser inputs; no separate external-contributor real-behavior-proof gate applies.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete steipete self-assigned this Aug 31, 2026
@steipete
steipete merged commit 10564e2 into main Aug 31, 2026
162 of 170 checks passed
@steipete
steipete deleted the codex/test-audit-tavily-reader branch August 31, 2026 20:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: tavily maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant