MCPcopy Create free account
hub / github.com/ccusage/ccusage / codex_log_model_fallback

Function codex_log_model_fallback

rust/crates/ccusage/src/adapter/codex/parser.rs:516–529  ·  view source on GitHub ↗
(model: &str, timestamp: &str)

Source from the content-addressed store, hash-verified

514}
515
516fn codex_log_model_fallback(model: &str, timestamp: &str) -> Option<&'static str> {
517 if model != CODEX_AUTO_REVIEW_MODEL {
518 return None;
519 }
520 let Some(date) = codex_timestamp_date(timestamp) else {
521 return Some("gpt-5");
522 };
523 Some(
524 codex_auto_review_fallback_models()
525 .iter()
526 .find_map(|fallback| (date >= fallback.released_on).then_some(fallback.model))
527 .unwrap_or("gpt-5"),
528 )
529}
530
531fn codex_auto_review_fallback_models() -> &'static [CodexAutoReviewFallback<'static>] {
532 CODEX_AUTO_REVIEW_FALLBACK_MODELS.as_slice()

Callers 1

Calls 2

codex_timestamp_dateFunction · 0.85

Tested by

no test coverage detected