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.
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 withduration: 0) is only dismissed when acompleteevent carries acontextCompactionOutcome. The other supported terminal / recovery paths do not carry that field, so the toast is left permanently visible after the compaction row has ended:aborterrorseedStoredTerminalWhy 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 itserror/abortwiring would go in the session-event dispatch (app-shell-session-events.ts+app-shell.tsx). Thecheck-renderer-architecture --basemonotonic-debt ratchet forbids anynonTriviaTokensincrease on thoselegacyAppShell.filesentries, 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
errorandabort, and preserve the canonical outcome on replacement recovery (seedStoredTerminal). Regression cases to add:started → error,started → abort, and an old compaction replaced before reconnect.