Repository navigation
fix(memory): harden embedding batch workflows - #103472
Conversation
|
Codex review: needs changes before merge. Reviewed July 11, 2026, 7:39 PM ET / 23:39 UTC. Summary PR surface: Source +62, Tests +472, Generated 0, Other 0. Total +534 across 19 files. Reproducibility: yes. Current main contains the unbounded Google reads, and the current PR head deterministically throws before consuming successful output whenever a completed OpenAI-compatible or Voyage batch includes an error file. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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: Keep the shared bounded HTTP and JSONL readers, but model completion as successful output plus optional per-request error rows, correlate both artifacts by custom_id, preserve valid embeddings, and report only failed or missing requests. Do we have a high-confidence way to reproduce the issue? Yes. Current main contains the unbounded Google reads, and the current PR head deterministically throws before consuming successful output whenever a completed OpenAI-compatible or Voyage batch includes an error file. Is this the best way to solve the issue? No. Consolidating bounded response and JSONL handling is the right ownership direction, but the current all-or-nothing completion helper conflicts with per-request partial results already represented by the provider status and output models. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2776bda1ea63. Label changesLabel justifications:
Evidence reviewedPR surface: Source +62, Tests +472, Generated 0, Other 0. Total +534 across 19 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 (8 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Updated proof: the existing regression tests drive |
|
@clawsweeper re-review The previous test proof was wrong — it used status 200 (success path) which never reached the changed
Both tests call |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
1ee4ace to
2f1f580
Compare
Local HTTP server returns oversized 503 on the upload endpoint. assertOkOrThrowProviderError reads at most 16 KiB and returns a bounded ProviderHttpError — same pattern as the accepted proof in openclaw#103472 for the batch-create sibling path.
2f1f580 to
06c2fcc
Compare
06c2fcc to
6cfc107
Compare
a89c113 to
90bd232
Compare
Co-authored-by: 徐闻涵0668001344 <[email protected]> Co-authored-by: ben.li <[email protected]>
fa0ef1a to
b62ea06
Compare
|
Land-ready maintainer pass complete at exact head What changed:
Proof:
Live proof:
Known gap: no authenticated positive Google batch job was run because contributor/fork source is intentionally isolated from maintainer credentials. The real transport lifecycle and official API envelopes are otherwise covered. |
|
Merged via squash.
|
* fix(memory): harden embedding batch workflows Co-authored-by: 徐闻涵0668001344 <[email protected]> Co-authored-by: ben.li <[email protected]> * test(memory): align batch redaction expectation * test(memory): tighten batch dependency types * refactor(google): clarify batch state control flow * test(google): make batch stage fallback lint-safe * build(plugin-sdk): refresh memory batch surface budget --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: ben.li <[email protected]>
What Problem This Solves
Embedding batch providers had several separate failure and output paths with inconsistent bounds, diagnostics, and terminal-state handling. Google-compatible endpoints could expose unbounded or ambiguous response handling, OpenAI and Voyage could inspect success output before completed error output, and memory-core had no typed way to disable a provider whose batch API is unavailable.
This supersedes the narrower fixes in #103306 and #98692.
Why This Change Was Made
ProviderHttpErrorhandling.file_namerequest field.EmbeddingBatchUnavailableErrorso memory-core can disable batch mode immediately after a Google batch-create 404.User Impact
Evidence
Exact-head validation
git diff --checknode scripts/plugin-sdk-surface-report.mjs --check: 10,562 public exports and 5,255 callable exports, exactly matching the pinned budgets.run_c0ec373344aa: remote-childpnpm check:changedon exact headb62ea06741f3c1cf37002326fbb082f7e0ed1329; format, four type lanes, core lint, and extension lint passed. Its only failure was the unrelated Docker-E2E import boundary inscripts/e2e/sqlite-sessions-transcripts-flip-proof.ts, reproduced unchanged on clean current mainff6dc43b8b8563f8bcc054c1430c980ecca66ae1.run_8225acae277c: 81 shared reader/error/status, SDK surface/baseline, and Google/OpenAI/Voyage batch assertions passed on the same exact head.run_ea1b83281790: memory-core's immediate typed-unavailable fallback assertion passed on the same exact head.29172170389: 78 relevant checks passed, zero failed or pending; QA Smoke, lint, production/test types, security, and real-behavior checks were green.Real behavior proof
file_name, one credential across all four requests, and the returned embedding.Authenticated positive-job execution was not run: contributor/fork source is intentionally isolated from maintainer credentials. The real network lifecycle is covered against loopback, and the public Gemini contract was checked against the official Batch API guide and REST reference.
Release note context
Harden embedding batch output and error handling across Google, OpenAI, and Voyage; improve Google Batch API compatibility and immediate fallback when batch creation is unavailable. Thanks @ZOOWH and @ly85206559 for the original reports and fixes.