Skip to content

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

Closed
nounder wants to merge 1 commit into
pingdotgg:mainfrom
nounder:fix/grok-context-window
Closed

nounder wants to merge 1 commit into
pingdotgg:mainfrom
nounder:fix/grok-context-window

Conversation

@nounder

@nounder nounder commented Sep 11, 2026

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 11, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

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.

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants