Conversation
The panel shows files; the cap counted mutation evidence records, so every repeat `write`/`edit` of a file already on screen spent one of the 256 slots. A long session hit `Session change capture limit reached` while tracking a handful of files, and from then on nothing updated: a later edit to a file the panel was already showing was dropped too, so its entry sat at the last admitted state (Gentleman-Programming#1043). `MAX_RECORDS` becomes `MAX_FILES` and is checked against the number of distinct paths held, and only for a path that is not held yet. An edit to a file already on screen is always admitted, because refusing it bounded nothing: the entry it would have updated is already in memory. What a long session can accumulate is bounded by the 4 MiB snapshot budget, which is unchanged and now reports separately. The two bounds also stop sharing one sentence. They have different remedies, and "additional changes are not displayed" told an operator neither which one filled up nor that the session itself was fine. Five cells: many edits to few files never reach the cap and still leave room for a new file, a tracked file keeps updating after the cap fires, the notice names which bound fired, and a no-op edit to an unseen path does not spend a slot. The existing 257-unique-path cell is unchanged and still passes, since the bound is the same number for that shape. Six mutations, all killed. One is worth naming: advancing the counter per record rather than per new file passes every other assertion and only shows up as a new file being refused after 256 repeat edits, which is the original defect moved one line over.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughSession change capture now limits distinct tracked files instead of mutation records. Repeated updates to tracked files remain admissible. File-count and byte-budget limits emit separate notices, with regression tests covering both limits and no-op edits. ChangesSession capture limits
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The updated file-limit behavior is covered without a remaining actionable defect. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #1043
The problem
The Changes panel shows files. The cap counted mutation evidence records:
seenholds onetoolCallIdper admittedwrite/edit, so every repeat edit of a file already on screen spent one of the 256 slots. A long SDD session that touches a handful of files over and over reaches the warning while the panel lists maybe five entries, which is what the report describes.The second half is what made it look frozen rather than merely capped. Once the bound fired, a later edit to a file the panel was already showing was dropped too, so that entry sat at its last admitted state. Refusing it bounded nothing: the
FileStateit would have updated is already held infiles.The fix
MAX_RECORDSbecomesMAX_FILES, checked against the number of distinct paths held, and only for a path that is not held yet:An edit to a tracked file is now always admitted. What a long session can accumulate is still bounded, by the 4 MiB snapshot budget, which is unchanged.
The two bounds also stop sharing one sentence. The report asks for this and it is right: they have different remedies, and "additional changes are not displayed" told an operator neither which one filled up nor that the session itself was fine.
Tests
tests/session-changes.test.ts, five cells added, and the existing 257-unique-path cell is untouched and still passes, since the bound is the same number for that shape.before === afterbeing charged for a file it never trackedMutation results, 6 of 6 caught:
The fourth is worth naming. Advancing the counter per record rather than per new file passes every other assertion in the file, and only surfaces as a new file being refused after 256 repeat edits, which is the original defect moved one line over. The first version of my own test did not catch it; the extra assertion in the many-edits cell is there because the mutation run said so.
pnpm run typecheck: 200 recorded diagnostics, no regressions.tests/session-changes.test.tsandtests/session-changes-shell.test.ts: 17 pass.What this does not change
The cap is still 256 and still hard. A session that genuinely touches more than 256 distinct files gets the same refusal, now with a notice that says so and does not imply the run failed. Coalescing without any bound was the other option in the report; I did not take it, because the panel's memory would then follow the session's file count with nothing holding it.
Summary by CodeRabbit
Bug Fixes
Tests