Files
codex/codex-rs/models-manager/src/originator.rs
T
Ben Romano 52ff3d1a35 Support Orbit originators in model catalog partitioning (#61384)
## What changed

Recognize `orbit_cca`, `orbit_cca_web`, `orbit_cca_desktop`, and
`orbit_cca_mobile` as separate model catalog originators, giving each its
own manager and disk cache.

## Testing

Extend catalog isolation coverage to the Orbit originators, including cache
reuse after manager recreation and avoiding redundant refreshes when the
catalog ETag is unchanged.

GitOrigin-RevId: 9507daae5c418212c9fed1be76df9aaa43c9d73f
2026-11-13 21:52:54 +00:00

46 lines
1.4 KiB
Rust

//! Bounded catalog partitions for callers migrated to CCA. Other callers keep the default catalog.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum ModelCatalogOriginator {
Work,
WorkWeb,
WorkDesktop,
WorkMobile,
Chat,
Orbit,
OrbitWeb,
OrbitDesktop,
OrbitMobile,
}
impl ModelCatalogOriginator {
pub fn from_originator(originator: &str) -> Option<Self> {
match originator {
"codex_work_cca" => Some(Self::Work),
"codex_work_web" => Some(Self::WorkWeb),
"codex_work_desktop" => Some(Self::WorkDesktop),
"codex_work_mobile" => Some(Self::WorkMobile),
"chatgpt_cca" => Some(Self::Chat),
"orbit_cca" => Some(Self::Orbit),
"orbit_cca_web" => Some(Self::OrbitWeb),
"orbit_cca_desktop" => Some(Self::OrbitDesktop),
"orbit_cca_mobile" => Some(Self::OrbitMobile),
_ => None,
}
}
pub fn as_str(self) -> &'static str {
match self {
Self::Work => "codex_work_cca",
Self::WorkWeb => "codex_work_web",
Self::WorkDesktop => "codex_work_desktop",
Self::WorkMobile => "codex_work_mobile",
Self::Chat => "chatgpt_cca",
Self::Orbit => "orbit_cca",
Self::OrbitWeb => "orbit_cca_web",
Self::OrbitDesktop => "orbit_cca_desktop",
Self::OrbitMobile => "orbit_cca_mobile",
}
}
}