merge(main): sync latest main into security branch

This commit is contained in:
elky
2026-09-05 00:30:16 +08:00
40 changed files with 2513 additions and 119 deletions
+3 -2
View File
@@ -21,8 +21,9 @@ pub use logic::{
upstream_metadata_namespace_updates, ModelFetchRunSummary, ModelsFetchPage, ModelsFetchSuccess,
};
pub use strategy::{
fetch_models_from_transports, fetch_models_from_transports_for_client_version,
ModelFetchStrategy, ModelFetchStrategyKind, ModelsFetchOutcome, SelectedModelFetchStrategy,
antigravity_model_id_is_routable, fetch_models_from_transports,
fetch_models_from_transports_for_client_version, ModelFetchStrategy, ModelFetchStrategyKind,
ModelsFetchOutcome, SelectedModelFetchStrategy,
};
pub use transport::{
build_antigravity_fetch_available_models_plan, build_antigravity_load_code_assist_plan,
+9 -1
View File
@@ -1346,7 +1346,7 @@ fn parse_antigravity_models_response(body: &Value) -> Result<(Vec<Value>, Option
let mut quota_by_model = serde_json::Map::new();
for (model_id, model_data) in models_object {
let model_id = model_id.trim();
if model_id.is_empty() || ANTIGRAVITY_BLOCKED_MODELS.contains(&model_id) {
if !antigravity_model_id_is_routable(model_id) {
continue;
}
let model_object = model_data.as_object().cloned().unwrap_or_default();
@@ -1382,6 +1382,14 @@ fn parse_antigravity_models_response(body: &Value) -> Result<(Vec<Value>, Option
Ok((models, upstream_metadata))
}
pub fn antigravity_model_id_is_routable(model_id: &str) -> bool {
let model_id = model_id.trim();
!model_id.is_empty()
&& !ANTIGRAVITY_BLOCKED_MODELS
.iter()
.any(|blocked| blocked.eq_ignore_ascii_case(model_id))
}
fn parse_kiro_available_models_response(
body: &Value,
) -> Result<(Vec<Value>, Option<Value>), String> {