Skip to content

feat: display actual auto-compaction context threshold per CLI/provider (Antigravity, Claude Code, Codex, etc.) #40188

Closed as not planned

Description

@cswjl

Problem

Currently, T3 Code displays the model's nominal/theoretical context window (e.g., 1M tokens) in the context usage indicator.

However, underlying agent CLIs and harnesses trigger auto-compaction well before reaching the model's nominal limit:

  • Antigravity (agy): Auto-compacts around 512k even though T3 Code displays 1M (~50% usage looks safe, then compaction suddenly triggers).
  • Claude Code: Reserves an auto-compact buffer and triggers compaction before hitting 100% of the nominal context window.
  • Codex (and other CLIs): Also have their own effective compaction thresholds distinct from the raw model window (related: [Bug]: Codex context meter omits the configured auto-compaction threshold #31546).

Because the UI only reflects the nominal window, users are misled into thinking they still have plenty of headroom and get caught off guard by unexpected compaction mid-task.

Proposed Solution

Reflect the effective auto-compaction threshold of the active CLI/provider in the context indicator, rather than only the model's nominal max context:

  1. Primary display or tooltip breakdown:
    • Option A: Use the effective compaction threshold as the primary denominator, with a tooltip showing the nominal model limit (e.g., 420k / 512k (compaction limit) · Model max: 1M).
    • Option B: Keep the nominal window on the meter, but render a clear compaction threshold marker (e.g., at 512k) and base warning colors/percentages on proximity to compaction.
  2. Data source:
    • Read the effective compaction threshold dynamically from the CLI/provider/ACP session metadata when reported.
    • Fall back to provider-aware defaults (for Antigravity, Claude Code, Codex, etc.) when the CLI does not expose it explicitly.

Why This Matters

  • Gives users an accurate view of actual remaining context before lossy compaction occurs.
  • Lets users proactively summarize, save state, or start a fresh thread before hitting auto-compaction.

Activity

  1. juliusmarminge commented on Nov 21, 2026

    @juliusmarminge
    Member

    Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.

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

Metadata

Metadata

Assignees

No one assigned

    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