mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
## What changed Select an originator-specific models manager before resolving thread model metadata. Supported originators send their own `originator` header and use separate in-memory catalogs and disk caches, so each thread receives the corresponding model instructions and tools. Reuse managers for repeated originators and share the API-key model discovery setting across them. Unsupported originators retain the default manager and catalog. ## Testing Add coverage for originator headers, concurrent catalog isolation, cache reuse across restarts, shared discovery policy, and the instructions and tools sent in actual turns. GitOrigin-RevId: ae4aa51c8df2813a72fc8aed8978fd630e467069
34 lines
1006 B
Rust
34 lines
1006 B
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,
|
|
}
|
|
|
|
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),
|
|
_ => 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",
|
|
}
|
|
}
|
|
}
|