Skip to content

bug(desktop): context usage remains stale after compaction #5547

Description

@faga295

What happened

After successful context compaction, the Desktop composer's context-usage gauge can continue displaying the token count/percentage from the pre-compaction request. That measurement describes the old prompt, so presenting it as current usage is misleading.Most users are sensitive to context usage. If the displayed usage still reflects the pre-compaction amount, they may think compaction didn’t succeed.

Expected: keep the existing gauge icon and display the localized Usage / 用量 label until a subsequent provider request supplies a fresh measurement. The tooltip should read “Context has been compacted. Usage will update when the next request completes.” (简体中文:上下文已压缩,用量将在下一次请求完成后更新。), with equivalent Traditional Chinese copy. Restore the percentage when a fresh measurement becomes available. A failed-open compaction should retain the valid reading because the raw history was still sent.

How to reproduce

  1. Run a Desktop conversation until a provider request has reported token usage and the composer displays a percentage.
  2. Run /compact successfully.
  3. Before another provider request settles, inspect the context gauge: it can still show the previous percentage.
  4. For mid-turn compaction, the indicator should recover as soon as a post-compaction request settles, without waiting for the entire turn to finish.

Environment

  • Surface: Desktop (conversation composer and WorkHub composer)
  • Source baseline: feb9cf22f
  • Identified from source and regression tests; no specific OS/provider restriction established.

Logs, screenshots, or additional context

Image

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