Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/analyzers/codex_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::analyzer::{Analyzer, DataSource};
use crate::contribution_cache::ContributionStrategy;
use crate::models::calculate_total_cost;
use crate::types::{Application, ConversationMessage, MessageRole, Stats};
use crate::utils::{deserialize_utc_timestamp, hash_text, warn_once};
use crate::utils::{deserialize_utc_timestamp, hash_text, warn_once, warn_once_yellow};

const DEFAULT_FALLBACK_MODEL: &str = "gpt-5";

Expand Down Expand Up @@ -188,6 +188,15 @@ struct SessionModel {

impl SessionModel {
fn explicit(name: String) -> Self {
// Warn users who may have uploaded gpt-5.2-codex data before pricing was added
if name == "gpt-5.2-codex" {
warn_once_yellow(
"gpt-5.2-codex pricing was added recently. Any data uploaded to \
Splitrail Cloud with this model will show costs as $0. To fix: go to \
Settings on splitrail.dev, delete your Codex CLI data, then re-upload."
.to_string(),
);
}
Self { name }
}

Expand Down
11 changes: 11 additions & 0 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,16 @@ static MODEL_INDEX: phf::Map<&'static str, ModelInfo> = phf_map! {
caching: CachingSupport::None,
is_estimated: false,
},
"gpt-5.2-codex" => ModelInfo {
pricing: PricingStructure::Flat {
input_per_1m: 1.75,
output_per_1m: 14.0,
},
caching: CachingSupport::OpenAI {
cached_input_per_1m: 0.175,
},
is_estimated: false,
},
"gpt-5-pro" => ModelInfo {
pricing: PricingStructure::Flat {
input_per_1m: 15.0,
Expand Down Expand Up @@ -700,6 +710,7 @@ static MODEL_ALIASES: phf::Map<&'static str, &'static str> = phf_map! {
"gpt-5.1-codex-max" => "gpt-5.1-codex-max",
"gpt-5.2" => "gpt-5.2",
"gpt-5.2-pro" => "gpt-5.2-pro",
"gpt-5.2-codex" => "gpt-5.2-codex",
"gpt-5-pro" => "gpt-5-pro",

// Anthropic aliases
Expand Down
11 changes: 11 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ pub fn warn_once(message: impl Into<String>) {
}
}

/// Like warn_once, but prints in yellow with a warning emoji
pub fn warn_once_yellow(message: impl Into<String>) {
let message = message.into();
let cache = WARNED_MESSAGES.get_or_init(|| Mutex::new(HashSet::new()));

if cache.lock().insert(message.clone()) {
// ANSI escape codes: \x1b[33m = yellow, \x1b[0m = reset
eprintln!("\x1b[33m⚠️ {message}\x1b[0m");
}
}

#[derive(Clone)]
pub struct NumberFormatOptions {
pub use_comma: bool,
Expand Down