Files
codex/codex-rs
Joe Savona 5ca2007abe Expose thread costs in statusline state and reject stale usage reads (#61410)
## Why

A replacement chat widget can receive a previous widget's usage result for the same thread. Statusline state also lacks the estimated costs available in the built-in status line.

## What changed

- Add optional `thread.usage.cost.total_cost_usd` and `total_credits` fields, using the built-in status line's plan-specific values. Convert micro-units to ordinary units and omit unavailable or negative values.
- Use UUIDs for thread usage requests and verify that each request is still pending before fetching usage or accepting its result.

## Testing

Add regression coverage for rejecting a previous widget's usage result and assertions for serialized costs across supported enterprise plans.

GitOrigin-RevId: 91c3f7cead0249b673979d17cc108ceae1088df2
2026-11-14 00:07:46 +00:00
..
…
…
…
…