Repository navigation
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: the useful Google batch output streaming work is superseded by the open, proof-positive canonical PR that covers the same completed-output read plus upload/create error-body bounds and output record budgeting. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Use #98692 as the canonical Google embedding-batch response-boundary landing path and tune its caps there if needed. So I’m closing this here and keeping the remaining discussion on #98692. Review detailsBest possible solution: Use #98692 as the canonical Google embedding-batch response-boundary landing path and tune its caps there if needed. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main still uses raw res.text() for completed Gemini batch output, and this PR supplies loopback HTTP after-fix proof for large valid JSONL output plus oversized-line rejection. Is this the best way to solve the issue? No for this branch as the landing path: the streaming line cap is useful, but the broader open PR is the better canonical fix because it also bounds upload/create error bodies and output record count. Security review: Security review cleared: The diff hardens provider response handling and does not change dependencies, workflows, secrets, permissions, packaging, or other supply-chain surfaces. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 5b06eba9fe9e. |
|
PR body refreshed to the full contributor template with the streaming proof and cap tradeoff made explicit. The body now clarifies that this is a 16 MiB per-JSONL-record guard, not a whole-output-file cap: valid total output above 16 MiB streams successfully, while one oversized record fails closed. Fresh validation:
No live Gemini credential is available in this environment; that proof limitation is now stated directly in the body. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Cleaned up the PR body metadata: changed the linked context from closing syntax to a non-closing reference so this PR will not accidentally close an unrelated item if merged. @clawsweeper re-review |
|
@clawsweeper re-review |
3 similar comments
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
9d637c4 to
dceca6a
Compare
edf803b to
e620916
Compare
e620916 to
64cd2c6
Compare
64cd2c6 to
a81297c
Compare
Replace bare res.text() in fetchGeminiFileContent with readProviderTextResponse (16 MiB cap, fail-closed). Gemini batch output files can hold up to 50 000 embedding vectors (JSONL), which makes unbounded res.text() a potential OOM vector. The fix applies the same guard already present on the JSON paths (file-upload, batch-create, batch-status) to the text-content path. Tests added in embedding-batch.test.ts: - Real node:http server streams 20 MiB without Content-Length → rejects with label gemini.batch-file-content - Mutation: raw res.text() resolves on 17 MiB body (pre-fix behaviour), readProviderTextResponse rejects (post-fix), proving the fix is load-bearing
…test Wrap the two implicit-return arrow-function Promise executors in block bodies so server.listen() / server.close() return values are discarded, satisfying the no-promise-executor-return oxlint rule.
a81297c to
bee7d91
Compare
|
ClawSweeper applied the proposed close for this PR.
|
Summary
res.text()buffering.Linked context
Related context: #97687.
Related: provider response hardening series for successful provider/control-plane reads.
Maintainer request: not directly requested by a maintainer.
Real behavior proof (required for external PRs)
Behavior or issue addressed: Gemini embedding batch output files were previously read with unbounded whole-body text parsing, which can OOM for large JSONL output files.
Real environment tested: local OpenClaw checkout on Node 22 using
runGeminiEmbeddingBatchesagainst a realnode:httpserver bound to127.0.0.1; no fetch mock on the streaming proof cases.Exact steps or command run after this patch:
PNPM_CONFIG_MODULES_DIR=/media/vdc/0668001470/workSpace/claw-campaign/openclaw/node_modules node scripts/run-vitest.mjs extensions/google/embedding-batch.test.ts -- --run -t "file-content streaming"Evidence after fix: Live terminal output from real node:http loopback server (no fetch mock):
All 6 scenarios passed against a real node:http server: upload/create/status JSON caps fire, small responses parse correctly, valid large JSONL output streams, and an oversized JSONL record is rejected.
Observed result after fix: a valid local JSONL output file with 16,500 embedding records and total size above 16 MiB streams successfully; a single oversized JSONL record rejects with
gemini.batch-file-content: JSONL line exceeds 16777216 bytes.What was not tested: a live Gemini batch run with real Google credentials.
Proof limitations or environment constraints: no live Gemini API key is available in this environment. The proof exercises the production batch runner and real HTTP transport locally, including upload/create/download routing.
Before evidence: source on
maindownloaded the successful output file as one full text body before parsing JSONL.Tests and validation
PNPM_CONFIG_MODULES_DIR=/media/vdc/0668001470/workSpace/claw-campaign/openclaw/node_modules node scripts/run-vitest.mjs extensions/google/embedding-batch.test.ts -- --run -t "file-content streaming"Risk checklist
Did user-visible behavior change? (
Yes/No) Yes. A single JSONL output record above 16 MiB now fails closed.Did config, environment, or migration behavior change? (
Yes/No) No.Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No) Yes, provider response streaming/size enforcement changed.What is the highest-risk area? A provider-valid single embedding record above 16 MiB would now fail.
How is that risk mitigated? Normal embedding records are far below 16 MiB, and large total batch output remains supported by streaming line-by-line instead of capping the whole file.
Current review state
Next action: ClawSweeper/maintainer re-review after this template/proof refresh.
Waiting on: maintainer acceptance of the 16 MiB per-JSONL-record guard or request for a different record cap.
Bot/reviewer comments addressed: the body now states that the cap is per line, not whole file, and documents the missing live Gemini proof as an environment limitation.
AI-assisted; implementation and validation reviewed before pushing.