Skip to content

fix(session-ui): restore compaction summaries - #44311

Merged
Hona merged 4 commits into
anomalyco:v2from
Hona:compaction-notice
Aug 23, 2026
Merged

fix(session-ui): restore compaction summaries#44311
Hona merged 4 commits into
anomalyco:v2from
Hona:compaction-notice

Conversation

@Hona

@Hona Hona commented Aug 23, 2026

Copy link
Copy Markdown
Member

Summary

  • restore the production Session compacted divider for current compaction messages instead of rendering them as generic notices
  • stream the compaction summary through the normal assistant Markdown presentation
  • preserve production failure behavior with normalized error cards and quiet cancellation
  • add Storybook coverage for running, completed, failed, and cancelled compactions

Testing

  • pre-push full workspace typecheck
  • session-ui typecheck and 95 tests
  • app and E2E typechecks
  • focused compaction E2E regression tests: 2 passed
  • full session timeline Notice regression file: 10 passed
  • production Storybook build

Performance

  • attempted the focused production streaming-timeline benchmark before and after the change
  • both runs failed before the scenario because the fixture session title never appeared, so the harness produced no comparable metrics

Copilot AI lite review requested due to automatic review settings August 23, 2026 04:55
@Hona
Hona requested a review from Brendonovich as a code owner August 23, 2026 04:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference, author can ignore or act on any point.

Nice, focused restoration. The two regression tests exercise the full event lifecycle (started → delta → ended / failed / aborted) through the real reducer, including replacement of streamed text by the final summary and hiding of cancellation detail — good coverage. Removing the compaction branch from the notice-describe function is also the right call: otherwise these rows would render both the old one-line notice and the new full component.

A few points to consider:

  1. packages/session-ui/src/message/message-content.tsx (SessionCompactionMessage, content()): for a failed, non-aborted compaction you render props.message.error.message verbatim through PacedMarkdown. Provider error strings are arbitrary text; sequences like _underscores_, backticks, or HTML-ish tags will render oddly (or be interpreted) instead of shown literally. Consider plain-text styling for failure details and reserving markdown rendering for real summaries.

  2. Same file: with streaming={props.message.status === "running"}, a long-running compaction that never emits a delta shows only the divider — fine — but if the stream stalls mid-delta there's no visual distinction between "still streaming" and "hung". Not blocking; just something the failed/cancelled states don't cover.

  3. packages/ui/src/i18n/en.ts: the three new keys are English-only. ~56 sibling locales fall back to en today, so users of those locales will see mixed-language dividers ("Compaction failed") until translations land. If there's a translation-sync process, worth flagging the keys there.

  4. packages/app/e2e/regression/session-timeline-notices.spec.ts: the subagent test swapped toolPart("call_subagent", "subagent", "streaming", {}) for an inline literal with input: "". If that was forced by a type change, consider updating the shared toolPart fixture signature instead — otherwise the next test needing a streaming tool part hits the same mismatch and copies the inline workaround.

  5. Minor: the aria-label assertion reformat in the same test file looks like Prettier fall-out; unrelated to the fix but harmless.

@Hona
Hona force-pushed the compaction-notice branch from 8003848 to aa38ba2 Compare August 23, 2026 07:42
@Hona
Hona merged commit 0a5349c into anomalyco:v2 Aug 23, 2026
7 checks passed
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.

3 participants