fix(codex): fence concurrent quota updates

This commit is contained in:
elky
2026-08-14 09:28:07 +08:00
parent f3a12c1008
commit 5b0c763086
65 changed files with 13009 additions and 738 deletions
+15
View File
@@ -662,6 +662,21 @@ impl AppState {
Ok(updated)
}
pub(crate) async fn compare_and_update_provider_catalog_key_admin_state(
&self,
update: &provider_catalog::ProviderCatalogKeyAdminCasUpdate,
) -> Result<bool, GatewayError> {
let updated = self
.data
.compare_and_update_provider_catalog_key_admin_state(update)
.await
.map_err(|err| GatewayError::Internal(err.to_string()))?;
// A conflict means another instance changed credentials. Invalidate on
// both outcomes before the caller reloads or reports the conflict.
self.invalidate_provider_routing_caches();
Ok(updated)
}
pub(crate) async fn update_provider_catalog_keys(
&self,
keys: &[provider_catalog::StoredProviderCatalogKey],
+4 -1
View File
@@ -38,7 +38,10 @@ pub(crate) use self::cache::{
PROVIDER_TRANSPORT_SNAPSHOT_CACHE_STALE_TTL, PROVIDER_TRANSPORT_SNAPSHOT_CACHE_TTL,
};
pub use self::cors::FrontdoorCorsConfig;
pub(crate) use self::oauth::AgentIdentityAuthConfigFence;
pub(crate) use self::oauth::{
provider_transport_context_allows_credential_rotation, AgentIdentityAuthConfigFence,
CodexRuntimeOAuthObservation, ProviderTransportCredentialFence,
};
pub(crate) use self::types::{
AdminWalletMutationOutcome, GatewayAdminPaymentCallbackView, GatewayUserPreferenceView,
GatewayUserSessionView, LocalExecutionRuntimeMissDiagnostic, LocalMutationOutcome,
File diff suppressed because it is too large Load Diff