[Meta] Scrollback after compaction breaks via several compounding mechanisms
Meta: scrollback after compaction breaks via several compounding mechanisms
Filing as a triage aid, not a separate bug. The user-visible symptom is one thing ("after a long session compacts at all, I can't see my full transcript") but it has at least five independent causes, and fixing any one of them in isolation usually still leaves scrollback broken because something else downstream is also bottlenecking.
Empirical: @ojura had to land all five (now six with the read-side recovery in #55818) locally before scrollback consistently held in long auto-compacted sessions. Until then each fix produced a frustrating partial improvement. The patchset implementing all of these lives at ojura/claude-patches for reproducibility. The companion skill for operating safely around these bugs while they're unfixed - deduping/archiving forks without orphaning the cross-file scrollback they hold - is ojura/claude-skills (archive-conversation-forks).
The dependency / compounding shape:
| | Issue | What it fixes | Downstream that still bottlenecks if this is the only fix | Patch in ojura/claude-patches |
|---|---|---|---|---|
| 1 | #44772 (filed by @wowitsjack as the rewind-picker symptom; @ojura's #55700 was closed as dup with chat-panel elaboration) | Loader's 5 MB SKIP_PRECOMPACT_THRESHOLD strips content before the compact boundary before anything else sees it | Even with full file loaded, chain walker (#46603) stops at the boundary | H |
| 2 | #46603 (read-side fallback in @ojura's 2026-04-28 comment, write-side root cause in a recent comment) | Chain walker doesn't bridge compact_boundary via logicalParentUuid (read) + compactor writes a phantom lpu (write, compact.ts:598) | Cross-file fork lpus (#48937) still don't resolve; render cap (#55701) still truncates | D (read-side only; the write-side fix can only land upstream) |
| 3 | #48937 | Forks of compacted sessions: write-side metadata + read-side cross-file lpu resolution | Phantom lpus (#55818) still leave seams unresolved | A + J |
| 4 | #55818 | Read-side lost+found recovery for already-corrupted JSONLs whose lpu was always phantom | Render cap (#55701) still truncates the recovered span | K |
| 5 | #55701 | Webview's 500-message render cap silently truncates the chain | (none) | I |
Reading the table top-to-bottom: rows 1–4 each expand what the chain walker can reach; row 5 then caps what the renderer shows from whatever the walker produced. Cap fix without walker fixes shows nothing useful; walker fixes without cap fix only get you to the cap.
Adjacent surface: sidebar/session-list integrity (same load-time pattern, different scope)
The dependency graph above covers transcript content in the chat panel. A parallel cluster disturbs session identity in the sidebar list (titles, post-rename state, fork visibility). The metadata parser used by listSessions is structurally a smaller-scope loader (head-64KB + tail-64KB scan rather than full-JSONL chain walk), with the same compaction-fragility pattern:
- #32150 (filed by @interconnectedMe; @ojura's mechanism walkthrough and empirical reorder-fix confirmation): title resolver runs
customTitle || aiTitle || lastPrompt || summary || firstPrompt(head)against a tail-64KB scan; after enough compaction-driven growth,lastPromptentries crowdcustomTitleout of the window, and the displayed title drifts to "whatever the user most recently typed." Implemented as Patch E inojura/claude-patches. - #53942: sidebar pencil rename flips back to the previous title on the next
broadcastSessionStates(), because thesessionStatesMap is only ever written as a side-effect ofupdate_session_statefrom a panel webview, and sidebar-driven renames don't go through that channel. Not compaction-triggered (any cross-session broadcast event triggers it) and not strictly a loader bug (broadcast-side state staleness), but compounds with #32150: even when you set acustomTitle, this bug can revert the visible title behind your back. Implemented as Patches F + G.
Triage implication: closing any single one of these as "fixed" while the others remain open is correct mechanically but won't move the user-visible needle. They want to be considered together.
---
Meta-issue assembled by Claude Code (Opus 4.7) on @ojura's machine after we landed all six locally and watched scrollback recover stage-by-stage. The dependency-graph framing is the one we converged on while debugging: each fix added without producing visible improvement until the next bottleneck downstream was also cleared.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗