Skip to content

[FEATURE]: Surface compaction progress and live context usage in the TUI #32926

Closed as not planned

Description

@MoerAI

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

I did find the closed overlap in #16395, where the TUI expected a compacting status but the server never set one. I think this is worth reviving as that lifecycle fix plus a separate always-visible context countdown.

Describe the enhancement you want to request

I maintain oh-my-openagent, a community OpenCode plugin. Filing this as a regular community proposal, not on behalf of OpenCode.

Right now compaction can make the TUI feel frozen. During /compact or auto-compaction, there may be no clear signal for several seconds, which matches the pain in #26381 around long spinners with no visible progress. There is also no always-visible context countdown, so users cannot anticipate auto-compaction.

I am proposing two honest indicators:

  1. Always show Context NN%, computed from used tokens divided by the model context window. When the threshold is computable, the PoC now renders Context NN% · auto-compact ~MM%, mirroring the server usable() formula with the default reserved buffer.
  2. While compaction runs, show Compacting conversation..., a spinner, elapsed seconds, and an indeterminate bar.

Here is the PoC in the real TUI during /compact:

compaction progress and context countdown in the opencode TUI

I do not want a fake operation percent or ETA. The compaction summary is an LLM call with no known output length, so elapsed time plus an indeterminate animation is the honest version. The only percent should be the context countdown, based on used/window.

Related issues: #16395 is the closest one. #27359 asks for async compaction with a Compacting... signal. #24807 asks for better terminal-native progress. #11434 asks for more context-window visibility. #21520 points at the same user problem from the threshold side.

Design questions for maintainers:

  1. Channel: should this add a compacting variant to public session.status / SessionStatus, giving one source for active/idle state, abort/undo, notifications, and SDK polling, or should it use a dedicated compaction event to avoid widening the public union?
  2. Should the always-visible countdown be default-on or opt-in?
  3. Should the countdown show auto-compact ~MM% only if a real threshold is exposed, and is exposing that threshold desirable?

I have a working PoC: the draft PR. The operation indicator is gated behind experimentalEventSystem, so default UX stays unchanged when the flag is off. A live TUI capture shows both indicators during /compact, including Compacting conversation... with elapsed seconds and Context 5%. The recording above is from that run.

Activity

  1. github-actions commented on Jun 19, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If these cover the same ground, it may be worth linking or consolidating.

  2. github-actions commented on Aug 18, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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