fix(memory): yield during session indexing#76978
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. at source level: current main has a clear session-start path into session transcript indexing without macrotask yields, and #76890 supplies matching event-loop-delay logs. I did not run a live gateway/TUI reproduction in this read-only review. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the focused memory-core yield fix after redacted real runtime proof or an explicit maintainer override, keeping the scope to responsiveness in session indexing and transcript parsing. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main has a clear session-start path into session transcript indexing without macrotask yields, and #76890 supplies matching event-loop-delay logs. I did not run a live gateway/TUI reproduction in this read-only review. Is this the best way to solve the issue? Yes for the code direction: batched Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b2bc1e9a5661. |
8072468 to
c1168f9
Compare
Thanks. This is addressed on the current head
The earlier dirty-branch finding was for the old head |
c40a3d4 to
7f56002
Compare
4a3e1f2 to
58d60ba
Compare
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
External contributors must show after-fix evidence from a real OpenClaw setup. Unit tests, mocks, lint, typechecks, snapshots, and CI are supplemental only. Screenshots are encouraged even for CLI, console, text, or log changes; terminal screenshots and copied live output count.
upstream/mainso the PR includes the current test-type fixes.check:test-typesshard locally.check:test-typescommand completed without themodel-fallback.test.tsenvtype error after rebasing onto currentupstream/main.setImmediateran, failing withexpected [ false ] to deeply equal [ true ].Root Cause (if applicable)
sessions.listalready has a similar batching/yield pattern, but memory-core session indexing did not.Regression Test Plan (if applicable)
extensions/memory-core/src/memory/manager-sync-yield.test.tssetImmediateruns before later session files continue indexing.syncSessionFiles()loop while mocking transcript parsing and providers out of scope.User-visible / Behavior Changes
Large session corpora should no longer make gateway startup/session-start reindexing starve WebSocket handling for long stretches.
Diagram (if applicable)
N/A
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
setImmediatebefore sync runs.Expected
Actual
Evidence
Before the fix, the new regression failed with
expected [ false ] to deeply equal [ true ]. After the fix, it passes.Human Verification (required)
What you personally verified (not just CI), and how:
check:test-typesshard after rebasing onto currentupstream/main.Review Conversations
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations