Skip to content

fix(context): use input window for usage percent#33665

Open
lin-hongkuan wants to merge 1 commit into
anomalyco:devfrom
lin-hongkuan:context-input-limit
Open

fix(context): use input window for usage percent#33665
lin-hongkuan wants to merge 1 commit into
anomalyco:devfrom
lin-hongkuan:context-input-limit

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Issue for this PR

Closes #32119

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Context usage displays were dividing by model.limit.context. For split-window models, limit.context includes both input and output windows, while prompt-fill pressure should use the input window when model.limit.input is present.

This PR adds a TUI helper that prefers a positive limit.input and falls back to limit.context, then uses it in the prompt footer, sidebar context plugin, and subagent footer. It also makes the direct opencode run footer limit map use the same effective context limit.

How did you verify your code works?

  • bun test test/util/model.test.ts from packages/tui
  • bun test test/cli/run/runtime.boot.test.ts from packages/opencode
  • bun run typecheck from packages/tui
  • bun run typecheck from packages/opencode
  • git diff --check from the repo root

Screenshots / recordings

Not included; this is display denominator logic covered by unit tests.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

context % under-reports for split-window models (divides by limit.context instead of limit.input)

1 participant