Files
codex/codex-rs/app-server-protocol/schema/json/v2/NullableGetAccountTokenUsageParams.json
Felipe Coury f1a1fce26a Show estimated thread usage in /status (#38281)
## What changed

- Extend `account/usage/read` with an optional `threadId` request and a
  backward-compatible `threadUsage` response containing estimated credits,
  optional USD cost, and model, reasoning, speed, and token breakdowns.
- Fetch thread usage for eligible Business and Enterprise plans when `/status`
  is opened, then update the rendered status card asynchronously.
- Preserve terminal scrollback when replacing a visible status-card tail, and
  append a refreshed card when the original tail can no longer be updated.

## Testing

- Add app-server coverage for authentication, canonical thread IDs,
  unavailable billing routes, and malformed IDs.
- Add TUI coverage for usage formatting, stale responses, retries, history
  updates, terminal reflow, and scrollback preservation.

GitOrigin-RevId: 49300914b3fba917c0f08e8595363e04e5ba6d37
2026-08-13 00:30:08 +00:00

26 lines
573 B
JSON
Generated

{
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
{
"$ref": "#/definitions/GetAccountTokenUsageParams"
},
{
"type": "null"
}
],
"definitions": {
"GetAccountTokenUsageParams": {
"properties": {
"threadId": {
"description": "When present, read estimated usage for this thread instead of account-wide token activity.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}
},
"title": "Nullable_GetAccountTokenUsageParams"
}