Skip to content

fix(memory): abort batch upload response reads#95111

Merged
vincentkoc merged 2 commits into
mainfrom
qa-sre-sdk-qalab-next-20260619
Jun 19, 2026
Merged

fix(memory): abort batch upload response reads#95111
vincentkoc merged 2 commits into
mainfrom
qa-sre-sdk-qalab-next-20260619

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Summary

  • Add an optional caller abort signal to uploadBatchJsonlFile.
  • Thread the signal through guarded remote fetch, non-OK response snippets, and successful JSON response reads.
  • Cover abort propagation for stalled file-upload error bodies and stalled successful JSON bodies.

Verification

  • node --check --experimental-strip-types packages/memory-host-sdk/src/host/batch-upload.ts
  • node --check --experimental-strip-types packages/memory-host-sdk/src/host/batch-upload.test.ts
  • git diff --check
  • Fresh autoreview: no actionable findings

Proof gaps

  • node scripts/run-vitest.mjs packages/memory-host-sdk/src/host/batch-upload.test.ts is blocked in this Codex worktree because node_modules is absent (OPENCLAW_MISSING_VITEST); dependencies were not installed in the Codex worktree.

@vincentkoc vincentkoc self-assigned this Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 19, 2026, 6:15 PM ET / 22:15 UTC.

Summary
The PR adds an optional abort signal to memory-host SDK batch uploads and tests stalled upload error/success response body cancellation.

PR surface: Source +3, Tests +79. Total +82 across 2 files.

Reproducibility: yes. at the helper level from source inspection: current main has abort-aware response readers, but uploadBatchJsonlFile has no signal parameter and calls them without one. I did not run the PR's Vitest lane in this read-only review.

Review metrics: 1 noteworthy metric.

  • Exported Helper Parameter: 1 optional parameter added. The helper is re-exported through the plugin SDK memory embedding barrel, so maintainers should notice the additive callable surface before merge.

Stored data model
Persistent data-model change detected: unknown-data-model-change: packages/memory-host-sdk/src/host/batch-upload.test.ts, vector/embedding metadata: packages/memory-host-sdk/src/host/batch-upload.test.ts, vector/embedding metadata: packages/memory-host-sdk/src/host/batch-upload.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Run node scripts/run-vitest.mjs packages/memory-host-sdk/src/host/batch-upload.test.ts in a dependency-complete checkout.
  • Confirm whether provider batch callers should pass cancellation signals in this PR or a follow-up.

Risk before merge

  • [P1] uploadBatchJsonlFile is re-exported through the plugin SDK memory embedding barrel; the optional signal parameter is additive, but it is still an exported SDK helper surface that maintainers should explicitly accept.
  • [P2] Current OpenAI and Voyage batch runners do not pass a signal into uploadBatchJsonlFile, so this PR does not by itself prove end-to-end provider batch timeout or cancellation behavior.

Maintainer options:

  1. Accept Additive SDK Helper Surface (recommended)
    Maintainers can merge after confirming the optional signal parameter is an intentional additive plugin SDK helper contract and the focused batch-upload test lane passes.
  2. Wire Provider Cancellation First
    If the bug is intended to cover OpenAI and Voyage batch timeout/cancel flows, thread a signal from the batch execution path into uploadBatchJsonlFile before merge.
  3. Pause Helper API Expansion
    If maintainers do not want this exported helper API to grow, pause the PR and solve cancellation inside the provider-owned batch paths instead.

Next step before merge

  • [P2] The PR is draft and maintainer-labeled; the remaining action is maintainer review, focused test proof, and SDK-surface scope confirmation rather than cleanup close or automated repair.

Security
Cleared: No concrete security or supply-chain concern was found; the diff only threads an abort signal through existing memory-host SDK HTTP/read helpers and tests.

Review details

Best possible solution:

Keep the helper-level abort propagation if that is the intended scope, and wire a real provider batch cancellation signal in this PR or a follow-up if maintainers want end-to-end batch timeout/cancel behavior.

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

Yes at the helper level from source inspection: current main has abort-aware response readers, but uploadBatchJsonlFile has no signal parameter and calls them without one. I did not run the PR's Vitest lane in this read-only review.

Is this the best way to solve the issue?

Yes for the helper-level bug: forwarding the caller signal through guarded fetch and both response readers matches the existing postJson pattern. It is not yet proven as an end-to-end provider batch cancellation fix because current OpenAI and Voyage batch callers do not pass a signal.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a bounded memory-host SDK cancellation fix with limited blast radius but real runtime-memory impact.
  • add merge-risk: 🚨 compatibility: The diff adds an optional parameter to a helper exported through the plugin SDK memory embedding surface, which is an additive compatibility-sensitive API 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 contributor real-behavior-proof gate does not apply to this maintainer-labeled MEMBER PR.

Label justifications:

  • P2: This is a bounded memory-host SDK cancellation fix with limited blast radius but real runtime-memory impact.
  • merge-risk: 🚨 compatibility: The diff adds an optional parameter to a helper exported through the plugin SDK memory embedding surface, which is an additive compatibility-sensitive API 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 contributor real-behavior-proof gate does not apply to this maintainer-labeled MEMBER PR.
Evidence reviewed

PR surface:

Source +3, Tests +79. Total +82 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 1 +3
Tests 1 79 0 +79
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 83 1 +82

Acceptance criteria:

  • [P1] node --check --experimental-strip-types packages/memory-host-sdk/src/host/batch-upload.ts.
  • [P1] node --check --experimental-strip-types packages/memory-host-sdk/src/host/batch-upload.test.ts.
  • [P1] node scripts/run-vitest.mjs packages/memory-host-sdk/src/host/batch-upload.test.ts.
  • [P1] git diff --check.

What I checked:

Likely related people:

  • vincentkoc: Git blame, git log, and shortlog for the memory-host SDK upload/response helper path all point to Vincent Koc's recent commits, including the current helper implementation and adjacent bounded batch error-body work. (role: introduced behavior and recent area contributor; confidence: high; commits: 70a48a680d8f, 5df5aa164052, 2acdbf08d6ff; files: packages/memory-host-sdk/src/host/batch-upload.ts, packages/memory-host-sdk/src/host/response-snippet.ts, packages/memory-host-sdk/src/host/post-json.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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

@clawsweeper clawsweeper Bot added 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 19, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready proof for 02f4ee3c51de6d947b25af8e7d1d36bd7816545b:

  • node --check --experimental-strip-types packages/memory-host-sdk/src/host/batch-upload.ts
  • node --check --experimental-strip-types packages/memory-host-sdk/src/host/batch-upload.test.ts
  • git diff --check
  • Fresh autoreview: no actionable findings
  • Manual exact-head CI release gate 27850705835: success, 127/127 jobs, head SHA 02f4ee3c51de6d947b25af8e7d1d36bd7816545b

The first exact-head gate 27850609123 failed on the new batch-upload abort tests because the original stalled stream fixture completed as an empty body before the abort fired. Commit 02f4ee3c51d fixes that fixture with a deterministic never-resolving reader, and the fresh gate passed the shard that failed before.

Local targeted Vitest was not run in this Codex worktree because node_modules is absent and scripts/run-vitest.mjs exits with OPENCLAW_MISSING_VITEST; dependencies were intentionally not installed in the Codex worktree.

@vincentkoc
vincentkoc marked this pull request as ready for review June 19, 2026 22:22
@vincentkoc
vincentkoc merged commit c4d1f37 into main Jun 19, 2026
226 of 232 checks passed
@vincentkoc
vincentkoc deleted the qa-sre-sdk-qalab-next-20260619 branch June 19, 2026 22:22
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 20, 2026
* fix(memory): abort batch upload response reads

* test(memory): stabilize batch upload abort proof
lzyyzznl pushed a commit to lzyyzznl/openclaw that referenced this pull request Jun 20, 2026
* fix(memory): abort batch upload response reads

* test(memory): stabilize batch upload abort proof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. 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