[Bug]: Grok threads show no context-window usage: ACP adapter ignores _meta.totalTokens #29296
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
- Install Grok CLI 1.0.70 and sign in with a browser.
- Start a Grok thread in T3 Code 0.1.6 and send a prompt.
- Look for the context-window meter beside the composer.
Expected behavior#
The meter shows used and max context for Grok threads, as after #8382.
Actual behavior#
The meter never appears. The provider turn records turnTokenUsage.usageStatus: "unavailable", and the provider thread's contextUsage stays null.
Grok 1.0.70 never sends sessionUpdate: "usage_update", and its session/prompt result has no top-level usage. It reports usage only in _meta. The ACP adapter reads context usage only from usage_update or an idle state_update with usage, and per-turn usage only from the result's top-level usage, so nothing is recorded. #8382 fixed this by reading _meta.totalTokens, but that code is not on main (47f2c8d).
Impact#
Minor bug or occasional failure
Version or commit#
0.1.6 (also checked main @ 47f2c8d)
Environment#
Linux x86_64, Grok CLI 1.0.70, model grok-4.7
Logs or stack traces#
# Direct `grok agent stdio` session, two prompts
session/update (agent_message_chunk) params._meta.totalTokens = 1339
session/update (available_commands_update) params._meta.totalTokens = 15939
session/prompt result stopReason = end_turn, usage = (absent)
_meta.totalTokens = 15939, _meta.usage.inputTokens = 15903
second prompt result _meta.totalTokens = 15984
session/new models[grok-4.7]._meta.totalContextTokens = 256000
sessionUpdate "usage_update" seen: never
Screenshots, recordings, or supporting files#
No response
Workaround#
No response
tanstack-source added labelsbug
Fixed by #42568, now on main: Grok threads now populate contextUsage from ACP notification _meta.totalTokens and the selected model's totalContextTokens, so sending a prompt with grok-4.7 selected shows used/max context instead of leaving the meter absent.
juliusmarminge closed this
Sign in to join this conversation.
This is a killer for me too, as Grok 4.7 is my primary driver, as I use my Grok Super Heavy sub within T3.
You also cannot switch into /plan mode with Grok either.