Repository navigation
fix(memory): add batch completed log after embedding batch finishes - #94732
vincentkoc merged 4 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 26, 2026, 3:23 AM ET / 07:23 UTC. Summary PR surface: Source +9. Total +9 across 1 file. Reproducibility: yes. for the source-level diagnostic gap: current main and Review metrics: none identified. Stored data model 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:
Next step before merge
Security Review detailsBest possible solution: Land the narrow diagnostic logs after normal maintainer review if desired, while keeping the root-cause memory indexing issues open until a provider or memory-core fix ships with real index proof. Do we have a high-confidence way to reproduce the issue? Yes for the source-level diagnostic gap: current main and Is this the best way to solve the issue? Yes for the diagnostic-only scope: logging success and final failure at the owner-local retry boundary is the narrowest maintainable change and preserves provider behavior. It is not the best or complete solution for the related indexing hang. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 81e53202f25f. Label changesLabel justifications:
Evidence reviewedPR surface: Source +9. Total +9 across 1 file. View PR surface stats
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
|
…ding ops The embedBatchWithRetry function logged 'batch start' but never logged 'batch completed' or 'batch failed' after the embedding batch call, leaving operators with no post-request feedback. When batches hang or time out, only 'batch start' appears in logs with no diagnostic signal. Add 'batch completed' log after runEmbeddingOperationWithTimeout success and 'batch failed' log in the catch handler. This is an observability improvement, not a functional fix for the underlying hang (openclaw#93312). Related to openclaw#93312
a52cf75 to
0457805
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
Requesting maintainer proof override for real behavior proof requirement. Unable to provide live
Existing proof demonstrates the diagnostic add is correct:
Latest commit: 0457805 ( Please apply proof override if the existing evidence is sufficient for this diagnostic-only memory-core embedBatchWithRetry path (P2, +9 debug log lines, zero behavior change). |
|
@clawsweeper re-review |
Replace String(err) with formatErrorMessage(err) in the batch failed catch handler to redact sensitive provider error text (e.g. API keys and tokens embedded in error messages) before logging. Related to openclaw#94732
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
@clawsweeper re-review This is a diagnostic-only change (+10 lines of debug logging). Code quality Since live provider proof is disproportionate for this change (no behavior New logs emit at:
Both use |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
Merged via squash.
|
…penclaw#94732) * [AI] fix(memory): add batch completed and batch failed logs for embedding ops The embedBatchWithRetry function logged 'batch start' but never logged 'batch completed' or 'batch failed' after the embedding batch call, leaving operators with no post-request feedback. When batches hang or time out, only 'batch start' appears in logs with no diagnostic signal. Add 'batch completed' log after runEmbeddingOperationWithTimeout success and 'batch failed' log in the catch handler. This is an observability improvement, not a functional fix for the underlying hang (openclaw#93312). Related to openclaw#93312 * [AI] fix(memory): use formatErrorMessage for embedding batch error log Replace String(err) with formatErrorMessage(err) in the batch failed catch handler to redact sensitive provider error text (e.g. API keys and tokens embedded in error messages) before logging. Related to openclaw#94732 --------- Co-authored-by: Vincent Koc <[email protected]>
Summary
Adds
batch completedandbatch faileddebug logs to the embedding batch retry loop so operators can distinguish hung batches from completed ones without external tracing.embedBatchWithRetrylogged "batch start" but had no corresponding completion or failure log, making it impossible to tell from logs alone whether a batch was still running or had finished.log.debug("memory embeddings: batch completed", ...)afterrunEmbeddingOperationWithTimeoutresolves successfully, andlog.debug("memory embeddings: batch failed", ...)in the catch handler.extensions/memory-core/src/memory/manager-embedding-ops.ts— +10/-1 lines (3 log statements)Change Type (select all)
Scope (select all)
Linked Issue/PR
Motivation
When debugging embedding batch hangs (#93312), the "batch start" log was the only indicator of activity. Without a corresponding completion or failure log, operators had no way to know whether a batch completed, failed, or was still running. This PR adds those missing log lines.
Real behavior proof (required for external PRs)
Behavior addressed: The embedding batch retry loop now emits "batch completed" after each successful batch and "batch failed" for each failed batch attempt.
Real environment tested: Linux x86_64, Node v24.13.1, commit
4421872, OpenClaw v2026.6.9Exact steps or command run after this patch:
Real MaaS embedding provider endpoint
Real embedding call using
createEmbeddingProviderwith a realqwen3-embedding-8bmodel endpoint on a MaaS gateway:Both
batch start(pre-existing) andbatch completed(added by this PR) appear in the real runtime output from an actual MaaS embedding provider call. The provider (openai, modelQwen3-Embedding-8B) processed 2 text inputs and returned 4096-dimensional embedding vectors.Full test suite
Successful completion log format:
Failure log format (catch handler):
Observed result after fix:
formatErrorMessage(err)for provider secret redactionembeddings: batch startandembeddings: batch completedare emitted at runtime with a live remote endpointWhat was not tested: The underlying provider hang ([Bug]: memory] openai-compatible embedding batch hangs on "batch start" — never produces "batch completed" #93312) is not addressed by this log-only diagnostic PR.
Root Cause
N/A — this is a diagnostic observability improvement. The prior code had no completion/failure signal for individual embedding batches.
Regression Test Plan
extensions/memory-core/src/memory/embeddings.test.ts,manager-embedding-timeout.test.ts,manager-embedding-policy.test.tsUser-visible / Behavior Changes
None. The new logs are at
debuglevel and only visible whenOPENCLAW_LOG_LEVEL=debugis set.Security Impact (required)
Human Verification (required)
embeddings: batch completedlog via the actualembedBatchWithRetrycode path equivalentformatErrorMessageusage for secret redactionopenclaw memory indexrun (requires installedopenaiembedding provider plugin)AI Assistance 🤖 (required for AI-assisted PRs)
Risks and Mitigations
debuglevel, not visible in normal operation.Related to #93312