Skip to content

[Bug]: Codex context meter omits the configured auto-compaction threshold #31546

Open

Description

@harschware

[Bug]: Codex context meter omits the configured auto-compaction threshold

Before submitting

  • I searched existing issues and did not find a matching Codex report.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web; apps/server — native Codex adapter

Steps to reproduce

  1. Configure Codex with the following top-level setting in the configuration used by the T3 Codex provider instance:

    model_auto_compact_token_limit = 256000
  2. Start a Codex thread using that configuration and send several messages.

  3. Open the context meter in the thread's project/environment menu.

  4. Compare the displayed limit with the configured compaction threshold.

  5. Continue the thread until automatic compaction occurs. Compaction was observed at the configured compaction point, despite the meter showing the larger context capacity as its limit.

Expected behavior

The primary meter should show progress toward the effective auto-compaction threshold when it is known and below the usable context capacity. Label it clearly as progress toward compaction, and retain the model's context capacity as secondary information.

For the observed example, a useful display would be:

  • Context used: approximately 64k tokens.
  • Auto-compaction: approximately 256k tokens; approximately 25% used.
  • Model-reported context capacity: 828k tokens, shown separately.

The threshold should come from the resolved configuration for the active Codex instance/profile/thread, including launch-argument overrides. If the effective threshold is unavailable, the UI should say so and retain the capacity display as a fallback.

Actual behavior

The screenshot shows Context 64k / 828k, even though the Codex configuration specifies model_auto_compact_token_limit = 256000. The primary meter does not communicate the configured compaction point, so it suggests substantially more headroom before compaction than the configuration requests.

Automatic compaction was observed at the configured compaction point. Codex is honoring the compaction setting, but T3's meter continues to use the larger model-reported context capacity. The problem is the display of progress toward compaction.

Source evidence

Checked against main at 337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17 on 2026-11-05:

  • codexProviderTurnTokenUsage sets maxTokens from tokenUsage.modelContextWindow and does not include autoCompactThreshold.
  • contextWindow.ts calculates percentage using usedTokens / maxTokens, while carrying autoCompactThreshold separately.
  • ContextWindowMeter.tsx displays maxTokens as the denominator and can display a separate compaction-threshold message.

Related: #18307 and #18332 addressed missing threshold reporting for Claude. This report concerns native Codex and making progress toward a known compaction point visible in the primary meter.

Impact

Minor UI/reporting bug: users cannot judge how close a thread is to configured auto-compaction from the primary meter.

Version or commit

T3 Code Beta 0.1.6; source paths checked against the main commit above.

Environment

macOS 26.5.1, native Codex provider, Codex CLI 0.164.0, model gpt-6.1-sol.

Workaround

Compare the displayed used-token count with the configured compaction threshold manually.

Activity

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