mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Show native dollar thread usage for ENT26 plans (#57251)
## Why ENT26 plans are billed directly in dollars, so credit estimates and credit-weighted breakdowns do not describe their thread usage. ## What changed - Expose optional `nativeUsageUsdMicros` in app-server `ThreadUsage` responses and generated schemas and SDK types. Missing native usage means unknown, not zero. - Enable ENT26 usage fetching and display native dollar amounts in `/status`, the status line, terminal titles, and the agents overview. Hide credits and omit credit-weighted `/status` breakdowns for these plans. - Use native dollar amounts when tracking post-turn usage settlement for ENT26 plans. ## Testing Add coverage for native usage forwarding, ENT26 billing displays, and settlement polling with stale, missing, or zero dollar amounts. GitOrigin-RevId: ca8ea98141a66bdf0a27feb9f58f67822b821f5f
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
//! Thread billing amounts, keeping native dollars separate from credit estimates.
|
||||
|
||||
use crate::JsonSchema;
|
||||
use crate::TS;
|
||||
use serde::Deserialize;
|
||||
@@ -10,6 +12,9 @@ pub struct ThreadUsage {
|
||||
pub thread_id: String,
|
||||
pub estimated_usage_credits_micros: i64,
|
||||
pub estimated_usage_usd_micros: Option<i64>,
|
||||
/// Native dollar usage, independent of credit estimates. None means unknown, not zero.
|
||||
#[ts(optional, as = "Option<Option<i64>>")]
|
||||
pub native_usage_usd_micros: Option<i64>,
|
||||
pub groups: Vec<ThreadUsageBreakdownGroup>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user