Skip to content

fix: SessionStart no longer prints a "nothing to do" size note (#434) - #435

Merged
fdaviddpt merged 1 commit into
mainfrom
fix/434
Sep 23, 2026
Merged

fdaviddpt merged 1 commit into
mainfrom
fix/434

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

The size-watch note in scripts/session-start-hook.sh fired on every session whose hooks.log sat between jit-misses.sh's 10MB watch threshold (#248) and a well-formed, non-zero JIT_CONTEXT_LOG_MAX_BYTES (#406's automatic rotation, 20MB default). The message said itself there was nothing to do -- rotation had already run, or would at the next SessionStart -- and still cost every such session a line of context, teaching readers to skip JIT : lines.

Drops the *) case arm in the case "$JIT_CONTEXT_LOG_MAX_BYTES" block that printed it. The two arms that still carry an action are unchanged: JIT_CONTEXT_LOG_MAX_BYTES=0 ("Automatic rotation is off ... delete or rotate it yourself") and a malformed value ("... did NOT rotate this session ... delete or rotate it yourself"). The comment above the case is rewritten to describe the new silent-by-default behavior.

Both affected test files are updated by inverting an existing assertion (not just adding a new one), each against an unchanged positive control proving the note mechanism still fires for the two states that carry an action:

  • tests/test-session-start-bound-248.sh section B: now asserts no size note at all for a well-formed rotation-on config; B2 (unchanged) still asserts the =0 branch fires on the identical stub.
  • tests/test-log-rotation-406.sh C5: now asserts no size note / empty JSON for a well-formed value; C4 and C6 (unchanged) still assert the malformed-value and =0 branches fire on the identical fixture.

Red (old hook code, new test assertions, via git stash push -- scripts/session-start-hook.sh): both suites failed with the size note absent from the new assertions. Green (git stash pop): both suites pass (test-session-start-bound-248.sh: 14 passed, 0 failed; test-log-rotation-406.sh: exit 0).

Docs: .oss.json docs_targets is README.md; grepped and found it never documented this note's wording (no-change-needed). Also checked docs/configuration.md and scripts/jit-doctor.sh by grep -- neither references this note's wording either.

Closes #434

🤖 Generated with Claude Code

[AI-generated]

The size-watch note in scripts/session-start-hook.sh fired on every
session whose hooks.log sat between jit-misses.sh's 10MB watch
threshold and a well-formed, non-zero JIT_CONTEXT_LOG_MAX_BYTES --
rotation was already automatic in that band (#406), so the line said
so and then said there was nothing to do, teaching readers to skip
JIT lines. Drop the case arm carrying no action; keep the two that do
(rotation off, or a refused JIT_CONTEXT_LOG_MAX_BYTES value).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fdaviddpt
fdaviddpt merged commit 5f24989 into main Sep 23, 2026
13 checks passed
@fdaviddpt
fdaviddpt deleted the fix/434 branch September 23, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SessionStart prints a hooks.log size note with nothing to act on, on every session between 10 MB and the rotation size

1 participant