Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): report Grok context window usage #11284

Closednounder(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/11284/headopened View on GitHub

What Changed

Grok context usage now reaches the existing web/desktop context-window indicator. Parse ACP usage_update notifications into validated token snapshots, emit thread.token-usage.updated from the Grok adapter, and advertise context-window reporting in Grok provider snapshots.

Why

The ACP parser previously dropped usage notifications, leaving Grok threads without context-window data. The adapter now forwards session usage even outside an active turn, preserves zero usage, and treats a zero capacity as unknown. Invalid token values are ignored. The existing event contract carries updates across local and remote connections.

Validation

  • 99 tests passed: vp test run GrokAdapter GrokProvider AcpRuntimeModel.
  • Server typecheck, targeted lint, formatting, and diff checks passed.
  • Regression coverage includes successive turns with changed capacity and zero usage, invalid usage values, and provider capability snapshots.
  • Live Grok and browser verification are pending; no screenshots captured. Mobile currently has no context-meter UI. Other provider adapters retain their current behavior.

Manual check: start an isolated dev environment, open its pairing URL, enable Grok and Settings → General → Context window indicator (legacy), then send a Grok prompt. Confirm the indicator shows used tokens and capacity when the CLI emits usage, and updates on subsequent turns.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Live verification and before/after evidence for the existing indicator

Implemented with GPT-6 using the Codex harness.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

      Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

    3. juliusmarminge closed this

Sign in to join this conversation.