feat(grok): add provider pool and transport support

This commit is contained in:
mayrain
2026-05-16 21:15:38 +08:00
parent e5f1f52759
commit cbfe1d378f
20 changed files with 2616 additions and 21 deletions
@@ -9,6 +9,7 @@ use crate::auth::{
};
use crate::claude_code::build_claude_code_passthrough_headers;
use crate::claude_code::local_claude_code_transport_unsupported_reason_with_network;
use crate::grok::{is_grok_provider_transport, resolve_grok_session_auth};
use crate::kiro::{
build_kiro_provider_headers, build_kiro_provider_request_body, is_kiro_provider_transport,
local_kiro_request_transport_unsupported_reason_with_network, KiroAuthConfig,
@@ -351,6 +352,10 @@ pub fn same_format_provider_transport_unsupported_reason(
family: SameFormatProviderFamily,
api_format: &str,
) -> Option<&'static str> {
if is_grok_provider_transport(transport) && matches!(family, SameFormatProviderFamily::Standard)
{
return None;
}
if behavior.is_kiro {
local_kiro_request_transport_unsupported_reason_with_network(transport)
} else if behavior.is_antigravity {
@@ -434,6 +439,10 @@ pub fn resolve_same_format_provider_direct_auth(
transport: &GatewayProviderTransportSnapshot,
family: SameFormatProviderFamily,
) -> Option<(String, String)> {
if is_grok_provider_transport(transport) && matches!(family, SameFormatProviderFamily::Standard)
{
return resolve_grok_session_auth(transport);
}
if behavior.is_vertex {
None
} else {