Repository navigation
SWF(perf): format today's date once per memory snapshot file - #1952
Merged
Merged
Conversation
Contributor
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Fei2411
commented
Nov 21, 2026
Fei2411
left a comment
Owner
Author
There was a problem hiding this comment.
Code Reaper review — pass (comments only; reviewed head abcb8a3)
- Change is correct:
shownEntrieshoiststoday()out of the per-entryisExpiredfilter, so each file in a snapshot is checked against one day. Same pattern as #1949 (merged); no other caller changes. - Test
a memory snapshot checks every entry in a file against the same dayasserts the expired entry stays out and the date is formatted once per shown file (calls === 2). Minor, non-blocking: the exact count ties the test to how many files a snapshot reads today; adding a file to the snapshot will need this number bumped. - Local:
test/memory.test.js147/147 pass;npm run lintno findings in changed files. CI green. - PR body has the
Agent: Devin (Cognition)line. - Overlaps: no other open PR touches
ds-bot/src/host/memory.jsortest/memory.test.js.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The memory snapshot now formats today's date once per
MEMORY.mdfile instead of once per entry, which saves about 30% of a snapshot build at 4,800 entries with the same output.Agent: Devin (Cognition)
Issue
Fixes # (none — Code Reaper's follow-up note on #1949)
What changed / 改了什么
shownEntriesfiltered out expired entries by callingtoday()(anIntl.DateTimeFormatformat) for every entry in aMEMORY.md. It now computesday = today()once per call, the same change #1949 made for auto recall. One file's entries are now always checked against the same day, even across midnight.shownEntriesruns when a personal/team memory snapshot (bot-memorysection) or a group memory snapshot is built: on a new Session, or when the snapshot is missing from history (for example after condensation). Ordinary turns reuse the frozen snapshot and don't run it, so this speeds up snapshot builds, not every turn. Auto recall andbot_recallare unchanged.Changelog
none
How I checked it / 怎么验证的
Benchmark: full snapshot build. It uses the real runtime and test helpers. Personal = fresh
bot-memorysection render, own + team files, snapshot persisted. Group = memory pre-step emitting a group snapshot. 20% of entries expired. Each variant, size and path got 40 warmups + 240 measured calls, with before/after order alternating. Machine: macOS arm64 Apple M4 Pro VM, Node v24.22.3. Times are ms.Same output: the SHA-256 of the rendered snapshot matched before/after for every path and size, in every run (e.g. Personal 4,800
eb677be2…5c3d9, Group 4,800ddbfe646…259a).Regression test:
a memory snapshot checks every entry in a file against the same daystubs the day formatter so the second call returns the next day. It asserts that both entries expiring that day are shown, that the expired one is not, and that the date is formatted once per file. On olddevit fails (The input did not match ... /Release checklist beta/); with this change it passes.npm testnot run (memory test files only)node scripts/build-client.mjs --check: no client changenpm run lintexits 0, with no findings in the changed filesTry it:
cd ds-bot && node --import ./test/harness-resolve.mjs --test test/memory.test.jsChecklist / 检查
src/client/changed →npm run buildran andclient.jsis committed. / 不适用Co-authored-by.Implemented in session Format today's date once in auto recall
Review with Devin · Open in Devin Desktop