mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 02:17:46 +08:00
fix(codex): confine codex profile api to ai_serving root seams
This commit is contained in:
@@ -19,6 +19,8 @@ use sha2::{Digest, Sha256};
|
||||
use tokio::sync::{Mutex, Semaphore};
|
||||
use tracing::{debug, info, warn};
|
||||
|
||||
use crate::ai_serving::api::codex_client_version;
|
||||
|
||||
const CODEX_CATALOG_SCHEMA_VERSION: u32 = 2;
|
||||
const CODEX_CATALOG_CREDENTIAL_SCOPE_DOMAIN: &str = "aether-codex-catalog-credential-v2";
|
||||
const CODEX_CLIENT_VERSION_MAX_LEN: usize = 64;
|
||||
@@ -99,7 +101,7 @@ pub(crate) fn normalize_codex_client_version(raw: Option<&str>) -> NormalizedCod
|
||||
used_fallback: false,
|
||||
},
|
||||
None => NormalizedCodexClientVersion {
|
||||
value: aether_ai_formats::codex_client_version(),
|
||||
value: codex_client_version(),
|
||||
used_fallback: true,
|
||||
},
|
||||
}
|
||||
@@ -1521,7 +1523,7 @@ where
|
||||
.await?;
|
||||
let scope = target.credential_scope()?;
|
||||
let state = runtime.codex_catalog_runtime_state();
|
||||
let mut version = Version::parse(&aether_ai_formats::codex_client_version()).ok()?;
|
||||
let mut version = Version::parse(&codex_client_version()).ok()?;
|
||||
if let Some(recent) =
|
||||
read_recent_codex_catalog_client_version(state, provider_id, key_id, scope).await
|
||||
{
|
||||
@@ -2461,10 +2463,7 @@ mod tests {
|
||||
let initial = read_codex_management_catalog(&runtime, TEST_PROVIDER_ID, TEST_KEY_ID)
|
||||
.await
|
||||
.expect("management context");
|
||||
assert_eq!(
|
||||
initial.client_version,
|
||||
aether_ai_formats::codex_client_version()
|
||||
);
|
||||
assert_eq!(initial.client_version, codex_client_version());
|
||||
assert!(initial.models.is_none());
|
||||
|
||||
seed_catalog(&runtime, &version("0.200.0")).await;
|
||||
@@ -2498,10 +2497,7 @@ mod tests {
|
||||
let rebound = read_codex_management_catalog(&runtime, TEST_PROVIDER_ID, TEST_KEY_ID)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
rebound.client_version,
|
||||
aether_ai_formats::codex_client_version()
|
||||
);
|
||||
assert_eq!(rebound.client_version, codex_client_version());
|
||||
assert!(rebound.models.is_none());
|
||||
}
|
||||
|
||||
@@ -2557,10 +2553,7 @@ mod tests {
|
||||
format!("1.2.3-{}", "x".repeat(CODEX_CLIENT_VERSION_MAX_LEN)),
|
||||
] {
|
||||
let normalized = normalize_codex_client_version(Some(&raw));
|
||||
assert_eq!(
|
||||
normalized.as_str(),
|
||||
aether_ai_formats::codex_client_version()
|
||||
);
|
||||
assert_eq!(normalized.as_str(), codex_client_version());
|
||||
assert!(normalized.used_fallback());
|
||||
assert!(!catalog_lkg_key(&target(), normalized.as_str()).contains(&raw));
|
||||
}
|
||||
@@ -3756,11 +3749,7 @@ mod tests {
|
||||
.await
|
||||
.expect("seed legacy cache");
|
||||
|
||||
let load = load_one(
|
||||
&runtime,
|
||||
&version(&aether_ai_formats::codex_client_version()),
|
||||
)
|
||||
.await;
|
||||
let load = load_one(&runtime, &version(&codex_client_version())).await;
|
||||
assert!(load.snapshot(TEST_PROVIDER_ID, TEST_KEY_ID).is_none());
|
||||
assert_eq!(runtime.execution_count(), 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user