mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-26 18:05:48 +03:00
[GH-ISSUE #73] 配置 Gemini CLI 后无法在 Roo Code 中调用成功 #63
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AIClient-2-API-justlovemaki#63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @manzhu on GitHub (Nov 13, 2025).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/73
错误: Gemini 生成上下文流错误:Incomplete JSON segment at the end
请问用 docker 部署的话,“OAuth凭据文件路径” 通过 base64 提供的话,是不是就是将 oauth_creds.json的全部内容转为 base64 后贴到 web console 里?
目前是将所有oauth_creds.json的内容转成 base64 后贴到 “OAuth凭据 (Base64)”
也生成了新的 project ID 填入:项目ID
Roo Code 里:
但是测试失败:
刚开始接触不知道哪里可以看到比较详细的配置教程?谢谢指教
@justlovemaki commented on GitHub (Nov 13, 2025):
是没有先生成授权文件吗?有启动程序的命令行里的日志吗?
@manzhu commented on GitHub (Nov 14, 2025):
下面是详细的步骤,如果有错误的地方多谢指教:
{
"REQUIRED_API_KEY": "123456",
"SERVER_PORT": 3000,
"HOST": "0.0.0.0",
"MODEL_PROVIDER": "gemini-cli-oauth",
"OPENAI_API_KEY": "xxx",
"OPENAI_BASE_URL": "https://openai/v1",
"CLAUDE_API_KEY": "xxx",
"CLAUDE_BASE_URL": "https://anthropic/v1",
"PROJECT_ID": null,
"GEMINI_OAUTH_CREDS_BASE64": null,
"GEMINI_OAUTH_CREDS_FILE_PATH": "/opt/oauth_creds.json",
"KIRO_OAUTH_CREDS_BASE64": null,
"KIRO_OAUTH_CREDS_FILE_PATH": null,
"QWEN_OAUTH_CREDS_FILE_PATH": null,
"SYSTEM_PROMPT_FILE_PATH": "input_system_prompt.txt",
"SYSTEM_PROMPT_MODE": "overwrite",
"PROMPT_LOG_BASE_NAME": "prompt_log",
"PROMPT_LOG_MODE": "none",
"REQUEST_MAX_RETRIES": 3,
"REQUEST_BASE_DELAY": 1000,
"CRON_NEAR_MINUTES": 1,
"CRON_REFRESH_TOKEN": false,
"PROVIDER_POOLS_FILE_PATH": "provider_pools.json"
}
$ docker run -d -p 3000:3000 -v /xxxx/AIClient-2-API/config/config.json:/app/config.json -v /xxx/.gemini/:/opt --name aiclient2api aiclient2api
$ docker exec -it aiclient2api /bin/sh
/app # ls -al /opt
total 20
drwxr-xr-x 8 root root 256 Nov 14 02:01 .
drwxr-xr-x 1 root root 4096 Nov 14 02:59 ..
drwxr-xr-x 2 root root 64 Nov 14 02:01 data
-rw-r--r-- 1 root root 52 Nov 13 12:12 google_accounts.json
-rw-r--r-- 1 root root 36 Nov 13 12:12 installation_id
-rw------- 1 root root 1764 Nov 14 02:12 oauth_creds.json
-rw-r--r-- 1 root root 156 Nov 14 02:21 settings.json
drwxr-xr-x 5 root root 160 Nov 14 02:12 tmp
@manzhu commented on GitHub (Nov 14, 2025):
另外不知道为什么 docker 镜像显示为 unhealthy... ,感觉是不是配置问题?
3bdc382fbd4f aiclient2api "docker-entrypoint.s…" 28 minutes ago Up 28 minutes (unhealthy) 0.0.0.0:3000->3000/tcp aiclient2api
@justlovemaki commented on GitHub (Nov 14, 2025):
[Auth] Unauthorized request denied. Bearer: "N/A", Query Key: "null", x-goog-api-key: "xxxxxx", x-api-key: "undefined"
Roo Code 里面传key的header还不一样?
@manzhu commented on GitHub (Nov 14, 2025):
是不是和 Roo Code 插件有关?我上面截图里 Roo Code 如果选择 Gemini 类型的话没有什么需要配置的地方,也就指定 本地 URL, 一个 API Key, 加上模型。我可以试试看 Cline 怎么样。
大佬有知道 Cline 或者 Roo 使用成功的例子吗?
@justlovemaki commented on GitHub (Nov 14, 2025):
我刚试了,可以用啊。 API Key 你在确定一下和REQUIRED_API_KEY是否一致
/health,是有点问题,已经修复了
@manzhu commented on GitHub (Nov 14, 2025):
我刚试了 CLINE,可以用。虽然日志里还能看到:Unauthorized request denied
11/14/2025, 7:18:57 AM
[Server] Received request: GET http://localhost:3000/health
[Config] Ignoring invalid MODEL_PROVIDER in path segment: health
[Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined
[Auth] Unauthorized request denied. Bearer: "N/A", Query Key: "null", x-goog-api-key: "undefined", x-api-key: "undefined"
11/14/2025, 7:19:27 AM
[Server] Received request: GET http://localhost:3000/health
[Config] Ignoring invalid MODEL_PROVIDER in path segment: health
[Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined
[Auth] Unauthorized request denied. Bearer: "N/A", Query Key: "null", x-goog-api-key: "undefined", x-api-key: "undefined"
11/14/2025, 7:19:51 AM
[Server] Received request: POST http://localhost:3000/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse
[Config] Ignoring invalid MODEL_PROVIDER in path segment: v1beta
[Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined
[Request Convert] Request format matches backend provider. No conversion needed.
[Content Generation] Model: gemini-2.5-pro, Stream: true
[Auth Token] Time until expiry: 00h 53m 55s
但是不知道为什么 Roo Code 就是一直不行,奇怪。。。
@justlovemaki commented on GitHub (Nov 14, 2025):
API Key 你在确定一下和REQUIRED_API_KEY是否一致?? 我测了在Roo Code也行
Unauthorized request denied是health接口的,最新代码已经修复了
@manzhu commented on GitHub (Nov 14, 2025):
感谢大佬,我重新安装了 Roo Code 插件,现在已经可以正常运行了!非常感谢!!