qwen-code/docs/design/auto-memory
Zqc abfdcc112b
fix(core): prevent OOM in auto-memory extraction during /quit (#5147) (#5181)
The auto-memory extraction background task caused FATAL ERROR: Reached
heap limit after /quit because buildTranscriptMessages() ran
.replace() over every history message synchronously, but the resulting
text was never consumed downstream.

Changes:
- extract.ts: delete buildTranscriptMessages/loadUnprocessedTranscriptSlice.
  Replace with a zero-stringify cursor scan on the unprocessed slice only.
- manager.ts: add isUnderMemoryPressure() using existing MemoryPressureMonitor.
  Gates in runExtract(), scheduleDream(), and scheduleSkillReview().
- client.ts: add shutdownRequested flag + requestShutdown().
- AppContainer.tsx: call requestShutdown() in /quit callback.
- Tests: 46 passed (11 extract + 34 manager + 2 client).
- Docs: update memory-system.md flowchart to cursor-first flow.

Co-authored-by: 俊良 <zzj542558@alibaba-inc.com>
2026-06-19 08:17:45 +08:00
..
memory-system.md fix(core): prevent OOM in auto-memory extraction during /quit (#5147) (#5181) 2026-06-19 08:17:45 +08:00