mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
fix: CLI 模型测试请求添加 x-app: cli 头部
CLI adapter 的 check_endpoint 测试请求缺少 x-app: cli 头部, 导致上游 Aether 节点选择了错误的 adapter 提取 API Key, 返回 401 认证失败。
This commit is contained in:
@@ -156,6 +156,13 @@ class GeminiCliAdapter(CliAdapterBase):
|
||||
"""获取Gemini CLI User-Agent"""
|
||||
return config.internal_user_agent_gemini_cli
|
||||
|
||||
@classmethod
|
||||
def get_cli_extra_headers(cls) -> Dict[str, str]:
|
||||
"""获取Gemini CLI额外请求头,包含 x-app: cli 标识"""
|
||||
headers = super().get_cli_extra_headers()
|
||||
headers["x-app"] = "cli" # 标识 CLI 模式,让上游使用正确的 adapter
|
||||
return headers
|
||||
|
||||
|
||||
def build_gemini_cli_adapter(x_app_header: str = "") -> GeminiCliAdapter:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user