mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
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
This commit is contained in:
1 parent
27a98dde4d
commit
f1a1fce26a
55 files changed
+2903
-60
No files matched your search
+10
@@ -0,0 +1,10 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests/status_command_tests.rs
|
||||
expression: thread_usage
|
||||
---
|
||||
│ Thread usage: 50 credits · ~$1.82 │
|
||||
│ Models: GPT-5.4 80%, GPT-5 Mini 20% │
|
||||
│ Reasoning: Medium 20%, High 80% │
|
||||
│ Speed: Fast mode 80%, Standard 20% │
|
||||
│ Billed tokens: 120 input (25 cached) + 50 output │
|
||||
╰──────────────────────────────────────────────────────────────────────╯
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests/status_command_tests.rs
|
||||
expression: thread_usage
|
||||
---
|
||||
│ Thread usage: 50 credits │
|
||||
│ Models: GPT-5.4 100% │
|
||||
│ Reasoning: High 100% │
|
||||
│ Speed: Fast mode 100% │
|
||||
│ Billed tokens: 100 input (20 cached) + 40 output │
|
||||
╰──────────────────────────────────────────────────────────────────────╯
|
||||
Reference in new issue
Block a user