From 09f5f280174cf4db56ce2953245b6ed5dce1de5d Mon Sep 17 00:00:00 2001 From: timkjr Date: Wed, 5 Aug 2026 08:59:32 -0500 Subject: [PATCH] docs(test): correct an overclaiming comment in the tail-fallback regression test The comment implied the fallback could be "silently skipped" by the stale hardcoded threshold, which isn't actually true -- the old smaller numbers were always more eager to trigger the fallback, never less (same correction as the commit this test belongs to). What the test actually protects against is the fallback logic itself breaking (e.g. a copy-paste slip dropping the check entirely), not the exact threshold value. Reworded to say that. Co-Authored-By: Claude Sonnet 5 --- test/routes/session-routes.test.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/routes/session-routes.test.ts b/test/routes/session-routes.test.ts index 31734a5a..4d85cf86 100644 --- a/test/routes/session-routes.test.ts +++ b/test/routes/session-routes.test.ts @@ -1470,13 +1470,15 @@ describe('session-routes', () => { it('still falls back to the tail read when bookkeeping alone exceeds the new 128KB head window', async () => { // Raising the head buffer to 128KB helps most restart-heavy sessions, but an - // even more extreme case (many more restarts) can still exceed it. The - // existing tail-read fallback must stay correctly wired to the new - // threshold (headBuf.length, not the old hardcoded 65536) rather than being - // silently skipped because the size comparison no longer means what it used - // to. The real message here sits near the end of the file, well inside the - // 32KB tail window, so a working fallback finds it; a broken one leaves the - // row blank exactly like the bug this whole fix addresses. + // even more extreme case (many more restarts) can still exceed it. This + // proves the tail-read fallback itself is intact after the threshold + // rewrite (`fileStat.size > headBuf.length` replacing the old hardcoded + // 16384/65536) — the fallback's own logic, not the exact threshold value, + // is what could have silently broken (e.g. a copy-paste slip that dropped + // the `> headBuf.length` check entirely). The real message sits near the + // end of the file, well inside the 32KB tail window, so a working fallback + // finds it; a broken one leaves the row blank exactly like the bug this + // whole fix addresses. const home = process.env.HOME as string; const projPath = join(home, '.claude', 'projects', 'proj-tail-fallback-test'); await mkdir(projPath, { recursive: true });