mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
## What changed - Track app-server turn lifecycle events for OpenAI API-key sessions when OTLP telemetry export is enabled. - Query the turn-cost endpoint after completed or aborted turns and emit `codex.turn_cost` with the estimated USD cost, interruption state, model, speed, and reasoning effort. - Preserve provider organization and project headers, wait for all observed responses to be priced, and retry pending or transiently failed queries with bounded tracking. - Re-probe availability after authentication changes and shut the worker down with other app-server background tasks. ## Testing - Cover late API-key login, transient probe failures, telemetry after thread removal, and turns with multiple responses. - Verify turn-cost requests use API-key authentication and provider scope headers and deserialize priced response data. GitOrigin-RevId: a303162a54798b554fcb2e9e2b372e1cf9f49f39
37 lines
1.3 KiB
Rust
37 lines
1.3 KiB
Rust
mod client;
|
|
pub(crate) mod types;
|
|
|
|
pub use client::AddCreditsNudgeCreditType;
|
|
pub use client::Client;
|
|
pub use client::RequestError;
|
|
pub use client::ThreadUsage;
|
|
pub use client::ThreadUsageBreakdownGroup;
|
|
pub use client::turn_usage::ApiKeyResponseCost;
|
|
pub use client::turn_usage::ApiKeyTurnCost;
|
|
pub use client::turn_usage::ApiKeyTurnCostStatus;
|
|
pub use types::AccountEntry;
|
|
pub use types::AccountsCheckResponse;
|
|
pub use types::CodeTaskDetailsResponse;
|
|
pub use types::CodeTaskDetailsResponseExt;
|
|
pub use types::CodexUserSettingsResponse;
|
|
pub use types::CodexWorkspaceMessage;
|
|
pub use types::CodexWorkspaceMessageType;
|
|
pub use types::CodexWorkspaceMessagesResponse;
|
|
pub use types::ConfigBundleResponse;
|
|
pub use types::ConsumeRateLimitResetCreditCode;
|
|
pub use types::ConsumeRateLimitResetCreditResponse;
|
|
pub use types::DeliveredConfigToml;
|
|
pub use types::DeliveredManagedLayers;
|
|
pub use types::DeliveredRequirementsToml;
|
|
pub use types::DeliveredTomlFragment;
|
|
pub use types::PaginatedListTaskListItem;
|
|
pub use types::RateLimitResetCreditDetails;
|
|
pub use types::RateLimitResetCreditsDetails;
|
|
pub use types::RateLimitResetCreditsSummary;
|
|
pub use types::RateLimitsWithResetCredits;
|
|
pub use types::TaskListItem;
|
|
pub use types::TokenUsageProfile;
|
|
pub use types::TokenUsageProfileDailyBucket;
|
|
pub use types::TokenUsageProfileStats;
|
|
pub use types::TurnAttemptsSiblingTurnsResponse;
|