Context-compaction running toast is not settled on error / abort / replacement reconnect
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 502
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 715
Description
Follow-up split out of #3651, per @Astro-Han's review.
## Problem
The running "Compacting context…" toast (`apps/desktop/src/renderer/app-shell-context-compaction.ts`, opened with `duration: 0`) is only dismissed when a `complete` event carries a `contextCompactionOutcome`. The other supported terminal / recovery paths do not carry that field, so the toast is left permanently visible after the compaction row has ended:
- user stops the compaction → `abort`
- a thrown backend failure → `error`
- a reconnect after a later root replaced this run → `seedStoredTerminal`
## Why this is a follow-up rather than part of #3651
The fix has to settle the toast from the legacy AppShell: the presentation lives in `app-shell-context-compaction.ts`, and its `error` / `abort` wiring would go in the session-event dispatch (`app-shell-session-events.ts` + `app-shell.tsx`). The `check-renderer-architecture --base` monotonic-debt ratchet forbids any `nonTriviaTokens` increase on those `legacyAppShell.files` entries, and the dispatch has no non-legacy seam — so the wiring cannot land in #3651 without growing that debt.
## Proposed approach
Extract the compaction presentation and its event handling out of the legacy AppShell into a feature module, then settle the specific running compaction on `error` and `abort`, and preserve the canonical outcome on replacement recovery (`seedStoredTerminal`). Regression cases to add: `started → error`, `started → abort`, and an old compaction replaced before reconnect.
Contributor guide
Assessment
This issue has not been assessed yet.