Keep recaps visible at all detail levels; add --no-recaps (#179)#209
Conversation
Recaps (away_summary) are themselves a high-level summary of activity, so they should stay visible at every detail level rather than being dropped at LOW and below (an oversight from #141). Change AwaySummaryMessage's detail_visibility from HIGH to USER_ONLY so recaps survive full → user-only, and add a --no-recaps flag to suppress them at any level (including FULL). - models.py: AwaySummaryMessage.detail_visibility = USER_ONLY. - renderer.py: Renderer.no_recaps attr; generate_template_messages + _ghost_template_by_detail gain no_recaps (recaps ghosted when set); run the ghost pass when no_recaps is set even at FULL; get_renderer wires it. - converter.py / cli.py: thread no_recaps through (mirrors no_timestamps); new --no-recaps CLI flag. - Resulting matrix: minimal → user+agent+recaps; minimal --no-recaps → user+agent; user-only → user+recaps; user-only --no-recaps → user only. Tests: rewrite the away_summary detail-level tests (visible at every level + --no-recaps suppresses everywhere), add an end-to-end matrix test, and allow the recap "system" type in the minimal real-projects assertion. dev-docs (messages.md, application_model.md) updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address review on #179: - Finding #1: --no-recaps was a silent no-op for --format json. The JSON renderer honors --detail (it runs the ghost pass via generate_template_messages) but didn't forward no_recaps, so recaps stayed in the JSON tree. Thread no_recaps=self.no_recaps into the json/renderer.py generate() call, matching html/markdown. - Add TestNoRecapsAllFormats exercising --no-recaps across html/md/json via the real get_renderer path (the existing matrix tests were HTML-only, which is why the JSON gap slipped). - N1: tighten the minimal real-projects assertion — assert every surviving system-typed message is specifically a recap (AwaySummaryMessage), guarding against a future system subclass leaking in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a ChangesRecap Visibility and Suppression
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
claude_code_log/converter.py (1)
1309-1310:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift
--no-recapsis not part of variant/cache identity, so cached runs can ignore the flag.Line 1571 (and the same suffix pattern at Lines 1309, 1985, 2232, 2398) builds variant keys without
no_recaps. Since stale checks and fast-path skips are keyed by those suffixes, switching--no-recapscan still hit “up to date” and return recap-inclusive output.Suggested fix direction
- suffix = _variant_suffix(detail, compact, format, no_timestamps) + suffix = _variant_suffix(detail, compact, format, no_timestamps) + if no_recaps: + suffix = f"{suffix}.no-recaps" if suffix else ".no-recaps"Apply the same suffix decoration everywhere variant/suffix is computed for:
- combined output path selection
- page cache keys
- per-session filenames
- project index variant enumeration inputs
Also applies to: 1571-1571, 1985-1985, 2232-2232, 2398-2400
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@claude_code_log/converter.py` around lines 1309 - 1310, The suffix used to build variant/cache keys (produced via calls to _variant_suffix and assigned to the local variable suffix) currently omits the no_recaps flag, causing cached/stale checks to ignore --no-recaps; update all places that compute variant suffixes (every call/assignment of suffix/_variant_suffix at the shown sites and the similar patterns used for combined output path selection, page cache keys, per-session filenames, and project index variant enumeration inputs) to include the no_recaps state (e.g., incorporate the boolean or its name into the variant key generation), ensuring the variant identity reflects the --no-recaps option so cached fast-paths and stale checks respect it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@claude_code_log/converter.py`:
- Around line 1309-1310: The suffix used to build variant/cache keys (produced
via calls to _variant_suffix and assigned to the local variable suffix)
currently omits the no_recaps flag, causing cached/stale checks to ignore
--no-recaps; update all places that compute variant suffixes (every
call/assignment of suffix/_variant_suffix at the shown sites and the similar
patterns used for combined output path selection, page cache keys, per-session
filenames, and project index variant enumeration inputs) to include the
no_recaps state (e.g., incorporate the boolean or its name into the variant key
generation), ensuring the variant identity reflects the --no-recaps option so
cached fast-paths and stale checks respect it.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7776841e-758a-438d-9e04-e209b8de1ba2
📒 Files selected for processing (11)
claude_code_log/cli.pyclaude_code_log/converter.pyclaude_code_log/html/renderer.pyclaude_code_log/json/renderer.pyclaude_code_log/markdown/renderer.pyclaude_code_log/models.pyclaude_code_log/renderer.pydev-docs/application_model.mddev-docs/messages.mdtest/test_away_summary.pytest/test_detail_levels.py
Address review on #209: --no-recaps was missing from variant_suffix(), so a --no-recaps export collided with the plain one on both the output filename and the cache/path-existence key — the second invocation would be served the stale prior variant (same class as the #165 no-timestamps fix). Add no_recaps to variant_suffix() and thread it through every call site (converter combined/paginated/individual/single-session/hierarchy, and the html/markdown/json renderers). Unlike compact/no-timestamps (Markdown-only formatting), --no-recaps filters messages, so it earns a suffix slot for ALL formats, not just markdown. VARIANT_ENTRY_RE already matches the new segment. Tests: variant_suffix no_recaps matrix (html/md/json + composition) and an end-to-end test that the plain and --no-recaps exports land on distinct files. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
(Claude) Good catch on the variant/cache identity — confirmed and fixed in a0ef294.
Rather than decorating the suffix string at each call site, I added Tests added: a |
Closes #179.
Background
Recaps (
※ recap/away_summarymessages) are a high-level summary of theactivity that just happened. They were classified
detail_visibility = HIGH,so they were dropped at
--detail lowand below (an oversight from #141) —exactly the levels where a one-line "user said this, agent did that" summary is
most useful.
What this does
Keep recaps visible at every detail level, and add
--no-recapstosuppress them when you don't want them.
AwaySummaryMessage.detail_visibility:HIGH→USER_ONLY(theleast-verbose threshold), so recaps survive
full→user-only.--no-recapsflag, threaded through the renderers and converter. Itsuppresses recaps at any level, including
full(so--detail full --no-recapsworks). Honored by the HTML, Markdown, and JSON renderers.Resulting matrix:
--detail minimal(and above)--detail minimal --no-recaps--detail user-only--detail user-only --no-recapsTests
--no-recapssuppresses at all five.--no-recapshonored by html / markdown / json.now-surviving recap.
dev-docs/messages.mdandapplication_model.mdupdated.Deferred follow-up
The issue lists a
--detail session → (nothing)row marked "(maybe?)". Thatwould be a new detail level below
user-onlythat renders no messages — aseparate feature (new
DetailLevelvalue + "render nothing" semantics),deliberately not included here. Tracked as a follow-up.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
--no-recapsoption to suppress recap/away-summary messages in exports.Changes
--no-recapsbehavior is applied consistently across HTML, Markdown, and JSON outputs and reflected in variant filenames.Tests
Documentation