Skip to content

Context-compaction running toast is not settled on error / abort / replacement reconnect #4854

Description

@liuxiaocs7

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions