Skip to content

fix(voyage): keep embedding batch waits within timeout - #111673

Merged
steipete merged 1 commit into
openclaw:mainfrom
ZengWen-DT:fix/voyage-embedding-batch-timeout
Aug 1, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
ZengWen-DT:fix/voyage-embedding-batch-timeout

Conversation

@ZengWen-DT

@ZengWen-DT ZengWen-DT commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users waiting for Voyage embedding batches could exceed the configured total timeout when the next poll delay or status request was longer than the remaining budget.

Why This Change Was Made

The Voyage waiter now carries one deadline through poll sleeps and status requests, using its existing injected clock/sleep seam and an abort signal for the request. Risk note: an incorrect boundary could stop a still-valid batch early, so the tests cover both the remaining-time clamp and the exact deadline before another status request.

User Impact

Voyage remote embedding batches now stop within their configured wait budget instead of overshooting by another polling or request interval.

Evidence

I drove the real exported runVoyageEmbeddingBatches() from the branch. The only replacements were its existing upload/status transport and clock/sleep dependency seams. The same harness against the pre-fix source registered a 1000 ms sleep with only 500 ms remaining; the fixed source registers 500 ms:

$ node --import tsx --no-warnings /tmp/voyage-timeout-proof.mts
before: {"error":"proof stop after first poll wait","sleeps":[1000]}
after:  {"error":"proof stop after first poll wait","sleeps":[500]}

The regression test also advances through the final bounded sleep and verifies that no status request is sent after the deadline.

$ node scripts/run-vitest.mjs extensions/voyage/embedding-batch.test.ts
Test Files  1 passed (1)
Tests  12 passed (12)

$ CI=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 pnpm check:changed --base upstream/main -- extensions/voyage/embedding-batch.ts extensions/voyage/embedding-batch.test.ts
exit 0

AI-assisted: Codex helped implement and review the change; the behavior proof and validation above were run manually.

Maintainer real-transport verification (rebased head 847bc74a7ceb256bd83e3c73518c1e39b494b0b4)

Ran the actual Voyage embedding owner and shared SSRF-guarded HTTP implementation against a real authenticated localhost provider: multipart file upload → batch creation → pending status HTTP socket → deadline abort; no transport, clock, sleep, or HTTP response was mocked. Every request carried an isolated synthetic bearer credential.

configured batch timeout: 120 ms
current main: total 524 ms; status request signal=false; socket remained open until provider replied
exact PR head: total 196 ms including real upload/create; status request signal=true; stalled TCP request aborted and socket closed; cause=TimeoutError
successful batch: multipart upload + create + status + output download -> embedding [1,2,3]
wait=false: existing actionable error preserved; zero status requests

Focused provider and shared-boundary proof: node scripts/run-vitest.mjs extensions/voyage/embedding-batch.test.ts packages/memory-host-sdk/src/host/batch-runner.test.ts packages/memory-host-sdk/src/host/remote-http.test.ts — 21 tests passed. Fresh Codex Sol xhigh structured review: clean (0.98). Exact-head hosted CI 30719607364: success; Workflow Sanity 30719607356: success.

Official provider contract: https://docs.voyageai.com/docs/batch-inference . Detailed reproducible maintainer evidence: #111673 (comment) . Original contributor author/email/July 20 author date and original patch identity are preserved.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. labels Jul 20, 2026
@clawsweeper

clawsweeper Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 5:45 PM ET / 21:45 UTC.

ClawSweeper review

What this changes

The PR carries one deadline through Voyage embedding-batch polling, clamps the final poll sleep, and aborts a status request when the configured wait budget expires.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

The source-proven timeout defect remains on current main, and this PR is a focused repair with no discrete correctness finding. Keep it open, but require real after-fix Voyage behavior proof before merge because the supplied before/after run replaces both transport and time boundaries.

Priority: P2
Reviewed head: 847bc74a7ceb256bd83e3c73518c1e39b494b0b4

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and source-consistent, but mock-only proof cannot clear the external-PR real-behavior gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The submitted before/after run exercises the real exported function but substitutes its status transport and time seams, so it does not show a real Voyage request being aborted at the configured deadline; add a redacted live terminal transcript or runtime log before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The submitted before/after run exercises the real exported function but substitutes its status transport and time seams, so it does not show a real Voyage request being aborted at the configured deadline; add a redacted live terminal transcript or runtime log before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main defect: Current main checks elapsed time only after processing a nonterminal status, then sleeps for the full poll interval; a 500 ms remainder and a 1000 ms interval can therefore overshoot the configured wait budget.
Focused repair: The PR calculates a deadline, rejects a status fetch after expiry, passes an abort signal into the guarded status request, and sleeps only for the remaining interval.
Dependency contract: The shared remote HTTP wrapper accepts signal and forwards it to the SSRF-guarded fetch, so the PR's status-request signal reaches the network boundary rather than being dropped locally.
Findings None None.
Security None None.

How this fits together

The Voyage provider plugin submits remote embedding batches, then polls their status before downloading output vectors into OpenClaw's memory pipeline. This change sits in that polling loop and determines when a pending remote batch stops waiting or makes its next status request.

flowchart LR
  A[Embedding requests] --> B[Voyage batch submission]
  B --> C[Initial batch status]
  C --> D[Deadline-aware polling loop]
  D --> E{Time remains?}
  E -->|Yes| F[Bounded sleep or status request]
  F --> D
  E -->|No| G[Timeout returned to memory pipeline]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The submitted before/after run exercises the real exported function but substitutes its status transport and time seams, so it does not show a real Voyage request being aborted at the configured deadline; add a redacted live terminal transcript or runtime log before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - The PR changes timeout behavior at the network boundary, but its submitted harness replaces the status transport and clock; it does not yet demonstrate that a real Voyage status request is cancelled and surfaced as the intended timeout.
  • Resolve merge risk (P1) - The branch is behind main and several exact-head checks were still running in the supplied state, so maintainers need a refreshed clean merge result and completed required checks before landing.
  • Complete next step (P2) - No mechanical repair is needed; the contributor must supply real-provider behavior proof, then a maintainer can evaluate the refreshed exact-head checks and merge result.
Agent review details

Security

None.

PR surface

Source +25, Tests +58. Total +83 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 35 10 +25
Tests 1 59 1 +58
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 94 11 +83

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-data-model-change: extensions/voyage/embedding-batch.test.ts, unknown-data-model-change: extensions/voyage/embedding-batch.ts, vector/embedding metadata: extensions/voyage/embedding-batch.test.ts, vector/embedding metadata: extensions/voyage/embedding-batch.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the single-deadline repair, add a redacted after-fix transcript from a real Voyage batch using a deliberately short wait budget that shows the status request ends at the deadline, then refresh the exact-head merge result and required checks.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the single-deadline repair, add a redacted after-fix transcript from a real Voyage batch using a deliberately short wait budget that shows the status request ends at the deadline, then refresh the exact-head merge result and required checks.

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

Yes, from source: on current main, a nonterminal status with less time remaining than pollIntervalMs passes the elapsed check and then sleeps the full interval; the PR's injected-clock test captures this as a 1000 ms sleep with only 500 ms remaining.

Is this the best way to solve the issue?

Yes for the code direction: a deadline shared by the sleep and guarded status request is the narrowest owner-boundary repair, and the shared HTTP wrapper already propagates abort signals. The remaining gap is real-provider proof rather than a competing implementation design.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 99f9c433be67.

Labels

Label justifications:

  • P2: The defect affects the optional Voyage embedding-batch wait path and has a narrow, source-proven repair, without evidence of broader runtime unavailability.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The submitted before/after run exercises the real exported function but substitutes its status transport and time seams, so it does not show a real Voyage request being aborted at the configured deadline; add a redacted live terminal transcript or runtime log before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main defect: Current main checks elapsed time only after processing a nonterminal status, then sleeps for the full poll interval; a 500 ms remainder and a 1000 ms interval can therefore overshoot the configured wait budget. (extensions/voyage/embedding-batch.ts:234, 99f9c433be67)
  • Focused repair: The PR calculates a deadline, rejects a status fetch after expiry, passes an abort signal into the guarded status request, and sleeps only for the remaining interval. (extensions/voyage/embedding-batch.ts:205, 847bc74a7ceb)
  • Dependency contract: The shared remote HTTP wrapper accepts signal and forwards it to the SSRF-guarded fetch, so the PR's status-request signal reaches the network boundary rather than being dropped locally. (packages/memory-host-sdk/src/host/remote-http.ts:19, 99f9c433be67)
  • Existing regression coverage: The branch adds tests for clamping the final wait and for not starting another status request once the injected deadline has expired; current main has neither assertion. (extensions/voyage/embedding-batch.test.ts:79, 847bc74a7ceb)
  • Feature provenance: The related polling-boundary work appears to date to 33c44626d2117a017f484fd42ca5644b69c2cdfa and the current Voyage batch module was most recently restored on main by e9b959aaaa4a8ae74371723f654bafe2d5b0bbb5. (extensions/voyage/embedding-batch.ts:193, e9b959aaaa4a)
  • Submitted proof limitation: The PR body shows the exported function running, but explicitly replaces its upload/status transport and clock/sleep seams; it proves the deterministic polling calculation but not a real Voyage request being aborted at the deadline. (847bc74a7ceb)

Likely related people:

  • Peter Steinberger: Introduced the earlier embedding-batch poll-interval boundary work and most recently restored the current Voyage batch module on main. (role: recent area contributor; confidence: high; commits: 33c44626d211, e9b959aaaa4a; files: extensions/voyage/embedding-batch.ts, extensions/voyage/embedding-batch.test.ts)
  • Alix-007: Authored the Voyage status/error/non-OK response-bounding work adjacent to the status request path changed here. (role: response-boundary contributor; confidence: high; commits: d3620da3e031; files: extensions/voyage/embedding-batch.ts)
  • solodmd: Authored the latest focused Voyage batch output-stream lifecycle repair, which shares the batch polling and output-read surface. (role: recent adjacent contributor; confidence: medium; commits: 1ec42c9acc8d; files: extensions/voyage/embedding-batch.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted real Voyage after-fix evidence showing a pending status request stops within a deliberately short configured wait budget.
  • Refresh the clean merge result and required checks on head 847bc74a7ceb256bd83e3c73518c1e39b494b0b4; after proof is added, updating the PR body should trigger review, or a maintainer can comment @clawsweeper re-review.

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-07-20T05:34:20.354Z sha d49560afcace6f8372bcc2ee00b54d6988988e71 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-31T09:17:19.832Z sha d49560afcace6f8372bcc2ee00b54d6988988e71 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the fix/voyage-embedding-batch-timeout branch from d49560a to 847bc74 Compare August 1, 2026 21:39
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 1, 2026
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Maintainer verification on exact rebased head 847bc74a7ceb256bd83e3c73518c1e39b494b0b4 (original @ZengWen-DT author/email/date and contributor patch preserved):

  • Drove the actual Voyage provider owner, real SSRF-guarded authenticated localhost HTTP, multipart upload, batch creation, status polling and output download. Configured 120 ms: current main held the real status socket for 524 ms without an abort signal; this head finishes in 196 ms including upload/create, aborts and closes the stalled socket, and preserves TimeoutError as the cause. Successful embedding [1,2,3] and wait: false/no status request remain unchanged.
  • Focused provider plus SDK sibling proof: OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/private/tmp/openclaw-vitest-s02-111673-voyage node scripts/run-vitest.mjs extensions/voyage/embedding-batch.test.ts packages/memory-host-sdk/src/host/batch-runner.test.ts packages/memory-host-sdk/src/host/remote-http.test.ts — 21 passed.
  • Fresh structured review: .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --engine codex --thinking xhigh — Sol xhigh clean, confidence 0.98.
  • Provider contract checked against https://docs.voyageai.com/docs/batch-inference ; exact-head full CI 30719607364 and Workflow Sanity 30719607356.

No production fallback, dependency, config, or unrelated changes.

@steipete
steipete merged commit 9a3db65 into openclaw:main Aug 1, 2026
98 of 106 checks passed
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants