Repository navigation
fix(memory): restore indexing after embedding row-cap errors - #138391
Conversation
Treat DashScope-style "batch size is invalid, it should not be larger than N" 400s as splittable so memory-core bisects oversized embedding requests instead of aborting the whole sync. Closes openclaw#137864
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 12:49 AM ET / 04:49 UTC. ClawSweeper reviewWhat this changesRecognize numeric embedding batch-size errors so memory indexing splits rejected requests into smaller batches, with regression coverage for recovery and unchanged successful requests. Merge readiness✅ Ready for maintainer review This remains a useful, necessary fix with no blocking findings. The new real-HTTP before/after evidence satisfies the previous proof request. Priority: P2 Review scores
Verification
How this fits togetherMemory Core turns memory files and session text into embeddings for semantic search. Its batching layer sends text to the configured provider and returns ordered vectors to the index writer. flowchart TD
A[Memory files and session text] --> B[Build embedding batches]
B --> C[Provider HTTP request]
C --> D{Numeric row-cap rejection?}
D -->|Yes| E[Split batch in half]
E --> C
D -->|Successful response| F[Collect vectors in input order]
F --> G[Update memory search index]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +28. Total +28 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep recovery in the existing shared classifier and ordered splitter, without introducing fixed provider caps or another configuration setting. Do we have a high-confidence way to reproduce the issue? Yes, from source: an oversized request returning the reported numeric row-cap error bypasses splitting on current main. The contributor supplies matching before/after HTTP traces; this review did not execute the runtime. Is this the best way to solve the issue? Yes. Extending the established classifier repairs the shared recovery boundary; a global 10-row cap or new setting would impose unnecessary policy on unaffected providers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d5992278b3b8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Use the existing ordered splitter for explicit numeric batch-size limits. Cover text and structured inputs, exact-cap requests, and terminal errors. Co-authored-by: saladinyao-cyber <[email protected]>
|
Thanks @teddytennant for the original repair, @saladinyao-cyber for the additional negative cases, and @ylcn91 for the related transport evidence. Landed in 36d4827. Bug: an explicit numeric embedding row cap aborted a full memory rebuild and left semantic search with an empty or stale index. Fix: the existing ordered splitter now handles that rejection without a fixed global cap or new configuration.
Independent validation passed eight product scenarios, including terminal errors, service and connection-reset retries, and native-batch fallback. Memory-plugin CI passed 2,255 tests, including the text/structured recovery cases. Exact-head CI and final review passed. |
Closes #137864
What Problem This Solves
Fixes an issue where a full memory rebuild fails when an OpenAI-compatible embedding endpoint rejects a request with
batch size is invalid, it should not be larger than 10. The failed rebuild leaves memory search with an empty or stale index.Why This Change Was Made
Recognize the explicit numeric row-limit error in the existing shared classifier. The existing ordered splitter then divides the rejected batch until the provider accepts it. Text and structured inputs keep the same recovery policy. No fixed row cap, provider-specific setting, or storage change is added.
User Impact
Affected memory rebuilds can finish and semantic search can use the complete index. Ambiguous errors and rejected single-item requests remain terminal; service retries and native-batch fallback retain their existing behavior.
Evidence
9c56ee41de73: the shippedmemory index --forcecommand sends 33 chunks, receives the numeric HTTP 400, and fails. Status reports zero chunks and a dirty index; search returns no results with a stale-index warning.0e5b59012a61: the same loopback-provider scenario completes the rebuild. Requests split as33 → 17 → 9/8 → 16 → 8/8; all 33 stored vectors match their original chunks. Status reports a complete, clean index.1and text score0.Original repair and ancestry: @teddytennant. Additional negative-case coverage: @saladinyao-cyber (#138992). Transport coverage from @ylcn91 (#139541) informed the full-index proof; that PR addresses a separate error wording.