Repository navigation
fix(memory-core): ignore managed dreaming blocks during daily ingestion - #61720
vincentkoc merged 7 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18f13a9141
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR prevents recursive dreaming bloat by stripping managed Confidence Score: 5/5Safe to merge; fix is correct and well-targeted. No P0/P1 findings. The strip regex matches the exact block format emitted by replaceManagedMarkdownBlock, newline-preservation is correct, and the regression test covers the key invariant. One P2 concern about a time-sensitive test date does not block merge. extensions/memory-core/src/dreaming-phases.test.ts — the new regression test uses real Date.now() with a hardcoded lookback window that will expire 2026-04-07. Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/memory-core/src/dreaming-phases.test.ts
Line: 94-113
Comment:
**Time-sensitive lookback window**
The `beforeAgentReply` handler calls `runLightDreaming` without an explicit `nowMs`, so it uses real `Date.now()`. Combined with `lookbackDays: 2` and a hardcoded `memory/2026-04-05.md` file, the 2-day lookback window will exclude this file after 2026-04-07 — at which point the loop produces `[0, 0, 0]` instead of `[1, 1, 1]` and the test fails silently. Consider freezing time with `vi.setSystemTime` or wiring a fixed `nowMs` through `runPhaseIfTriggered` so the test stays green regardless of when CI runs it.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "memory-core: harden dreaming block strip..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a25f91aed8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20ffcd2bf9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e7acabc to
b19958f
Compare
|
Landed via temp rebase onto latest Scoped verification:
Repo-wide note:
Thanks @MonkeyLeeT! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b19958f9f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
## Light Sleepand## REM Sleepblocks out ofmemory/YYYY-MM-DD.mdWhy
Light/REM phase output can be written inline into the same dated daily note that
ingestDailyMemorySignals()re-scans on the next run. That let Dreaming ingest its own generatedCandidate:/status:lines and recursively bloat both the recall candidates and the managed block itself.Root Cause
collectDailyIngestionBatches()chunked raw daily note contents without excluding managed Dreaming sections, whilewriteDailyDreamingPhaseBlock()writes those sections back intomemory/YYYY-MM-DD.mdin inline mode.Fix
Before chunking a dated daily note for ingestion, blank out the managed Light/REM Dreaming blocks identified by their heading + marker pairs. The replacement preserves newline structure so subsequent line references in the same note do not drift.
Validation
pnpm test extensions/memory-core/src/dreaming-phases.test.tspnpm test extensions/memory-core/src/dreaming-markdown.test.tspnpm exec oxlint extensions/memory-core/src/dreaming-phases.ts extensions/memory-core/src/dreaming-phases.test.tsNotes
pnpm checkcurrently fails on untouchedorigin/mainTypeScript errors undersrc/auto-reply/reply/*, so I used the repo's fast-commit path after running the focused Dreaming checks above.