Skip to content

[BUG]: Context percentage indicator doesn't reflect usable context proportion #28057

@MoodyMarshmallow

Description

@MoodyMarshmallow

Description

The context percentage indicator seems to use the model's raw context limit instead of the usable number of tokens before compaction.

For models with separate input and context limits, I feel that this can make context usage look much lower than it effectively is and lead to compaction when the percentage indicator is quite low.

Consider a model with a 400k context limit, 272k input limit, and 20k tokens reserved for compaction. The indicator may show 126k / 400k = 32%, even though the proportion of actually useable context is 126k / (272k - 20k) = 50%.

Consequently, the model may compact with the context percentage indicator showing 63% instead of close to 100%.

Not sure if this behaviour is intended? I personally find it somewhat misleading.

Plugins

none

OpenCode version

1.15.3

Steps to reproduce

How can we reproduce this issue?

  1. Use a model with separate context and input limits, such as GPT 5.5.
  2. Accumulate enough session context to observe the TUI context percentage.
  3. Compare the displayed percentage against the proportion of non-compaction input tokens used.

Screenshot and/or share link

Operating System

Arch Linux

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions