fix(web,mobile): fold context compaction under settled turn folds - #9623
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused presentation bug fix that folds context-compaction rows into existing settled-turn folds while preserving standalone rows and expansion behavior. It affects only web/mobile timeline rendering and introduces no API, data, provider-execution, security, or infrastructure changes. You can add or adjust custom eligibility rules. Learn more. |
Note
Written by
muse-spark-1.3-contributor-freeon behalf of MariaA settled "Worked for ..." fold left its "Compacted context ..." row visible underneath. Compaction rows now fold with the rest of their turn on web and mobile, and reappear when the fold is expanded. A lone compaction with no other folded work stays visible as before.
Verified with the timeline unit suites on both clients plus typecheck, and with before/after renders of the real timeline component on the same fixture.
Before — compaction leaks out below the collapsed fold:
After — the fold hides the compaction row:
Made with opencode/muse-spark-1.3-contributor-free.
Note
Low Risk
Presentation-only timeline folding logic in shared patterns on web and mobile; no auth, data, or API changes.
Overview
Fixes “Compacted context …” rows staying visible below a collapsed “Worked for …” turn fold on web and mobile.
Context compaction is no longer exempt from turn-fold hiding (mobile stops skipping compaction groups when building turn groups; web stops treating compaction like agent-spawn rows that never fold). Compaction entries can be included in
hiddenEntryIdsand collapse with the rest of the turn when the fold is collapsed, and show again when expanded.A turn fold is only created when it would hide non-compaction work (
hidesNonCompactionWork). If the only hidden entries would be compaction, no fold is emitted so a lone compaction row stays visible, matching prior behavior for compaction-only turns.On web, post-terminal folding rules still skip trailing work after the terminal assistant message, except compaction rows, which may still fold with the turn.
Reviewed by Cursor Bugbot for commit 14fd213. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fold context-compaction entries under settled turn folds in web and mobile
deriveThreadFeedTurnFolds(mobile) andderiveTurnFolds(web), so compaction rows can fold alongside other hidden work in the same turnMacroscope summarized 14fd213.