Skip to content

refactor(exa): test response readers through tool execution - #140572

Merged
steipete merged 1 commit into
mainfrom
codex/test-exa-reader-boundary
Sep 7, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-exa-reader-boundary

Conversation

@steipete

@steipete steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Exa's response-reader tests reach private helpers through a production testing export and use a test-only response-size override. That setup misses changes to the actual production size limit and duplicates response fixtures already shared by other tests.

Why This Change Was Made

Move the same five reader-test subjects through the provider tool and mocked fetch boundary. Reuse the shared streaming and cancellation fixtures, remove the private testing export, and remove the size override that production never passes. The default 16 MiB cap and reader implementations remain in place.

User Impact

No intended runtime or public API behavior change. Tests now protect actual request execution, including fatal UTF-8 decoding, exact successful content, the production response cap, early cancellation, and bounded error details. Existing routing, authentication, cache, and cancellation tests remain.

Evidence

  • Baseline and candidate: 17/17 cases with the same case-title inventory.
  • The migrated overflow case fails when the production cap is doubled; the previous overridden-limit case still passed that fault. Disabling fatal UTF-8 decoding also fails the migrated case.
  • Success preserves the exact URL and unwrapped title plus row count. Error cases retain the included prefix, excluded tail, short error, cancellation, and no-response.text() checks.
  • Final independent review through P2 is clean. All 25 configured checks passed on Blacksmith Testbox (run); the one-shot command exited 0 and its lease/snapshot cleanup completed. No authenticated Exa service call is claimed.
  • Production: +2/-11 lines. Tests: +79/-73 lines, including removal of both duplicate response fixtures.

@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 7, 2026 01:19
@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 Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 9:25 PM ET / September 7, 2026, 01:25 UTC.

ClawSweeper review

What this changes

The Exa web-search plugin tests response handling through tool execution and shared streaming fixtures, removing a private testing export and test-only size override.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused cleanup absent from current main. No introduced correctness defect was found, and the maintainer-authored, protected PR should remain in the normal review flow.

Priority: P3
Reviewed head: 1d55eb2afa195d872ec02f59387802de6d26b095

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with stronger production-limit coverage and no actionable finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored cleanup is exempt from external-contributor runtime proof: its tests exercise Exa tool execution with mocked fetch responses, and no authenticated Exa run is claimed or needed for a changed external contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored cleanup is exempt from external-contributor runtime proof: its tests exercise Exa tool execution with mocked fetch responses, and no authenticated Exa run is claimed or needed for a changed external contract.
Evidence reviewed 6 items Introduced production change preserves runtime behavior: The pinned introduction diff removes only the optional reader limit override and private testing export; the existing production caller already supplies only the response. The 16 MiB cap, fatal UTF-8 decoding, and bounded error reader remain.
Behavioral assertions retained at the tool boundary: Read the complete test file and production owner. The five migrated subjects retain malformed JSON, invalid UTF-8, exact successful content, overflow cancellation, and bounded error assertions. Each migrated case disables caching and observes fetch calls; shared fixtures expose real ReadableStream cancellation.
Current main still needs this cleanup: The fetched main revision retains the optional maxBytes parameter and testing export. Its normal request path uses the same default limit, so the PR improves regression coverage without introducing another supported API.
Findings None None.
Security None None.

How this fits together

The Exa plugin turns web-search tool requests into Exa API calls and returns normalized search results. Its response readers enforce body-size limits and report malformed content or bounded upstream errors.

flowchart TD
  A[Search tool request] --> B[Exa plugin]
  B --> C[Guarded API request]
  C --> D{Response status}
  D -->|Success| E[Bounded JSON reader]
  D -->|Error| F[Bounded error reader]
  E --> G[Normalized search results]
  F --> H[Provider error]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -9, Tests +6. Total -3 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 11 -9
Tests 1 79 73 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 81 84 -3

Review metrics

Metric Value Why it matters
Production-limit coverage Overflow test: 4 KiB override replaced by actual 16 MiB cap The migrated test can detect changes to the production limit that the previous override concealed.

Technical review

Best possible solution:

Keep response-reader coverage at the existing tool boundary while preserving production limits, decoding, cancellation, and error behavior.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this refactors existing regression coverage rather than reporting a runtime defect; the private testing seam is directly visible on main.

Is this the best way to solve the issue?

Yes: exercising the existing tool entrypoint removes test-only production surface while retaining the reader invariants and checking the actual production cap.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b38d791b45de.

Labels

Label changes:

  • add P3: This is a focused test-boundary cleanup with no intended user-facing 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: The maintainer-authored cleanup is exempt from external-contributor runtime proof: its tests exercise Exa tool execution with mocked fetch responses, and no authenticated Exa run is claimed or needed for a changed external contract.

Label justifications:

  • P3: This is a focused test-boundary cleanup with no intended user-facing 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: The maintainer-authored cleanup is exempt from external-contributor runtime proof: its tests exercise Exa tool execution with mocked fetch responses, and no authenticated Exa run is claimed or needed for a changed external contract.

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)
  • Dallin Romney: 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 Sep 7, 2026
@steipete
steipete merged commit 4fcdbb3 into main Sep 7, 2026
160 checks passed
@steipete
steipete deleted the codex/test-exa-reader-boundary branch September 7, 2026 01:33
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 7, 2026
…137098

* commit '8a540c252002878f3c3e9d8dfb837b83c8602a78': (2210 commits)
  perf(plugins): keep bundled catalog lookups lightweight (#140597)
  refactor: streamline skills JSON serialization (#140581)
  fix(feishu): expand quoted merged-forward messages (#136231)
  fix(talk): keep opaque realtime routes out of public config (#129144)
  fix(ci): avoid Linux packaging on pull requests (#140589)
  fix(usage): release completed request payloads (#140588)
  fix(tooling): omit Trae machine squash credit (#140562)
  fix(ui): stop catalog paging in hidden tabs (#140583)
  fix(portals): reach IPv6 loopback with IPv4-only localhost records (#140580)
  fix(transcripts): preserve fixed and legacy capture history (#140563)
  fix(ui): prevent Talk E2E audio capture stalls (#138803)
  fix(media): release completed document source buffers (#140561)
  fix(anthropic): preserve resumed CLI caches across Git changes (#140566)
  chore(ui): refresh control ui locales (#140586)
  fix(ui): keep usage exports bound to their session instance (#140573)
  refactor(exa): test response readers through tool execution (#140572)
  fix(macos): omit incompatible worker binaries from app bundles (#140557)
  fix: avoid retaining discarded tool output (#140570)
  refactor(gateway): share placement move matching (#140569)
  fix(gateway): preserve child turns during systemd drain (#140568)
  ...

# Conflicts:
#	.agents/skills/release-openclaw-maintainer/SKILL.md
#	docs/reference/RELEASING.md
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: exa 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: S 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