Add Antigravity v1internal gateway adapter

This commit is contained in:
MMEXA
2026-05-25 06:58:15 +08:00
parent 505d9fd8bc
commit 28c3a5dbe4
15 changed files with 978 additions and 33 deletions
@@ -69,6 +69,14 @@ pub fn resolve_execution_runtime_stream_plan_kind(
));
}
if route_family == Some("antigravity")
&& route_kind == Some("stream_generate_content")
&& *method == Method::POST
&& path == "/v1internal:streamGenerateContent"
{
return Some(GEMINI_CLI_STREAM_PLAN_KIND);
}
if route_family == Some("openai")
&& is_openai_responses_route_kind(route_kind)
&& *method == Method::POST
@@ -679,6 +687,32 @@ mod tests {
);
}
#[test]
fn resolves_antigravity_v1internal_stream_plan_kind_as_gemini_cli_stream() {
assert_eq!(
resolve_execution_runtime_stream_plan_kind(
Some("ai_public"),
Some("antigravity"),
Some("stream_generate_content"),
Some("bearer_like"),
&Method::POST,
"/v1internal:streamGenerateContent",
),
Some(GEMINI_CLI_STREAM_PLAN_KIND)
);
assert_eq!(
resolve_execution_runtime_sync_plan_kind(
Some("ai_public"),
Some("antigravity"),
Some("stream_generate_content"),
Some("bearer_like"),
&Method::POST,
"/v1internal:streamGenerateContent",
),
None
);
}
#[test]
fn stream_path_detection_handles_gemini_method_paths_with_query() {
assert!(request_path_implies_stream_request(