You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
github copilot: Gemini 3.0 invalid body request #4468
I see the same thing in opencode 0.15.31 (I see a lot of bugs constantly fixed in 1.x so thought I'd wait a little). No MCP or LSP servers here.
And as mentioned on your X post, Gemini 3 in Zen is also throwing that Generative AI API key error.
Oh, noone mentioned this detail yet: the agent always performs one tool call successfully, and then shows the error. I tell it to continue and it repeats:
> opencode auth list
┌ Credentials ~/.local/share/opencode/auth.json
│
● GitHub Copilot oauth
│
● OpenRouter api
│
└ 2 credentials
> opencode run hello --print-logs --model opencode/gemini-3-pro
INFO 2025-11-18T23:52:23 +202ms service=default version=0.15.31 args=["run","hello","--print-logs","--model","opencode/gemini-3-pro"] opencode
INFO 2025-11-18T23:52:23 +1ms service=project directory=/home/ralph/gemtest fromDirectory
INFO 2025-11-18T23:52:23 +22ms service=config path=/home/ralph/.config/opencode/config.json loading
INFO 2025-11-18T23:52:23 +1ms service=config path=/home/ralph/.config/opencode/opencode.json loading
INFO 2025-11-18T23:52:23 +26ms service=config path=/home/ralph/.config/opencode/opencode.jsonc loading
INFO 2025-11-18T23:52:23 +6ms service=bun cmd=["/home/ralph/.local/lib64/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","@opencode-ai/plugin@0.15.31","--exact"] cwd=/home/ralph/.config/opencode running
INFO 2025-11-18T23:52:23 +8ms service=bun code=0 stdout=bun add v1.3.0 (b0a6feca)
installed @opencode-ai/plugin@0.15.31
[2.00ms] done
stderr=Saved lockfile
done
INFO 2025-11-18T23:52:23 +1ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin
INFO 2025-11-18T23:52:23 +1ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
INFO 2025-11-18T23:52:23 +23ms service=bus type=* subscribing
INFO 2025-11-18T23:52:23 +0ms service=bus type=session.updated subscribing
INFO 2025-11-18T23:52:23 +0ms service=bus type=message.updated subscribing
INFO 2025-11-18T23:52:23 +0ms service=bus type=message.part.updated subscribing
INFO 2025-11-18T23:52:23 +0ms service=format init
INFO 2025-11-18T23:52:23 +0ms service=bus type=file.edited subscribing
INFO 2025-11-18T23:52:23 +1ms service=lsp serverIds=deno, typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, astro, jdtls, lua-ls enabled LSP servers
INFO 2025-11-18T23:52:23 +3ms service=session id=ses_5669dc3c1ffeNm69AFXcV8UC9z version=0.15.31 projectID=global directory=/home/ralph/gemtest title=New session - 2025-11-18T23:52:23.358Z time={"created":1763509943358,"updated":1763509943358} created
INFO 2025-11-18T23:52:23 +1ms service=bus type=session.created publishing
INFO 2025-11-18T23:52:23 +0ms service=bus type=session.updated publishing
INFO 2025-11-18T23:52:23 +2ms service=bus type=message.part.updated subscribing
INFO 2025-11-18T23:52:23 +0ms service=bus type=session.error subscribing
INFO 2025-11-18T23:52:23 +0ms service=bus type=permission.updated subscribing
INFO 2025-11-18T23:52:23 +1ms service=session.prompt session=ses_5669dc3c1ffeNm69AFXcV8UC9z prompt
INFO 2025-11-18T23:52:23 +7ms service=bus type=message.updated publishing
INFO 2025-11-18T23:52:23 +7ms service=bus type=message.part.updated publishing
INFO 2025-11-18T23:52:23 +2ms service=bus type=session.updated publishing
INFO 2025-11-18T23:52:23 +3ms service=models.dev file={} refreshing
INFO 2025-11-18T23:52:23 +3ms service=provider init
INFO 2025-11-18T23:52:23 +9ms service=provider providerID=openrouter found
INFO 2025-11-18T23:52:23 +0ms service=provider providerID=opencode found
INFO 2025-11-18T23:52:23 +0ms service=provider providerID=github-copilot found
INFO 2025-11-18T23:52:23 +0ms service=provider providerID=copilot-api found
INFO 2025-11-18T23:52:23 +1ms service=provider providerID=opencode modelID=gemini-3-pro getModel
INFO 2025-11-18T23:52:23 +0ms service=provider status=started providerID=opencode getSDK
INFO 2025-11-18T23:52:23 +78ms service=provider status=completed duration=78 providerID=opencode getSDK
INFO 2025-11-18T23:52:23 +1ms service=provider providerID=opencode modelID=gemini-3-pro found
INFO 2025-11-18T23:52:23 +0ms service=session.lock sessionID=ses_5669dc3c1ffeNm69AFXcV8UC9z locked
INFO 2025-11-18T23:52:23 +0ms service=session.prompt session=ses_5669dc3c1ffeNm69AFXcV8UC9z sessionID=ses_5669dc3c1ffeNm69AFXcV8UC9z locking
INFO 2025-11-18T23:52:23 +19ms service=bus type=message.updated publishing
INFO 2025-11-18T23:52:23 +14ms service=session.prompt session=ses_5669dc3c1ffeNm69AFXcV8UC9z process
INFO 2025-11-18T23:52:23 +1ms service=provider providerID=opencode modelID=gpt-5-nano getModel
INFO 2025-11-18T23:52:23 +0ms service=provider status=started providerID=opencode getSDK
INFO 2025-11-18T23:52:23 +4ms service=session.prompt session=ses_5669dc3c1ffeNm69AFXcV8UC9z type=start part
ERROR 2025-11-18T23:52:23 +6ms service=session.prompt session=ses_5669dc3c1ffeNm69AFXcV8UC9z error={"error":{"name":"AI_LoadAPIKeyError"}} stream error
INFO 2025-11-18T23:52:23 +1ms service=session.prompt session=ses_5669dc3c1ffeNm69AFXcV8UC9z type=error part
ERROR 2025-11-18T23:52:23 +0ms service=session.prompt session=ses_5669dc3c1ffeNm69AFXcV8UC9z error=Google Generative AI API key is missing. Pass it using the 'apiKey' parameter or the GOOGLE_GENERATIVE_AI_API_KEY environment variable. process
INFO 2025-11-18T23:52:23 +1ms service=bus type=session.error publishing
Error: Google Generative AI API key is missing. Pass it using the 'apiKey' parameter or the GOOGLE_GENERATIVE_AI_API_KEY environment variable.
INFO 2025-11-18T23:52:23 +8ms service=provider status=completed duration=20 providerID=opencode getSDK
INFO 2025-11-18T23:52:23 +0ms service=provider providerID=opencode modelID=gpt-5-nano found
ERROR 2025-11-18T23:52:23 +12ms service=session.prompt session=ses_5669dc3c1ffeNm69AFXcV8UC9z error=OpenAI API key is missing. Pass it using the 'apiKey' parameter or the OPENAI_API_KEY environment variable. model=gpt-5-nano failed to generate title
INFO 2025-11-18T23:52:23 +1ms service=bus type=message.updated publishing
INFO 2025-11-18T23:52:23 +1ms service=bus type=message.updated publishing
INFO 2025-11-18T23:52:23 +0ms service=session.compaction pruning
INFO 2025-11-18T23:52:23 +1ms service=session.lock sessionID=ses_5669dc3c1ffeNm69AFXcV8UC9z unlocked
INFO 2025-11-18T23:52:23 +0ms service=session.prompt session=ses_5669dc3c1ffeNm69AFXcV8UC9z sessionID=ses_5669dc3c1ffeNm69AFXcV8UC9z unlocking
I see a model=gpt-5-nano failed to generate title API error in there, but the titles do generate just fine when not using opencode/gemini-3-pro, so I guess it's because the whole session is errored.
Anyway it's about time I upgraded to opencode 1.x unless you want me to continue testing with 0.15 for any reason.
It mysteriously seems to work for me now, even though it doesn't seem there have been any changes on OpenCode side that could have fixed it. Might just be that Copilot loosened their APIs a little although that still doesn't make much sense (as how else are they getting the thought signatures to give Google?). I'll look into it some more but we can probably close this issue now.
okay it works on my clone where I'm very sure it wasn't working previously so definitely a change on the Copilot API side. I'm still curious about how they have this implemented but, oh well, it works :)
@rekram1-node would you prefer I still make a PR just to implement thinking blocks for Copilot models?
@aadishv well let's talk through it, is it a huge change? what do u need to set to get reasoning to come back?
Yeah that's the biggest thing that is making me unsure. it requires basically cloning the entire openai compatible /chat/completions implementation, like we've already done for /responses. the modifications for thinking are very minimal its basically +1-1
Do other methods in Copilot have reasoning? I use Sonnet 4.5 most of the time. And thinking toggle does nothing (at least it used to). Can Copilot models even use reasoning? I'm not sure which models are reasoning and which are not.
Do other methods in Copilot have reasoning? I use Sonnet 4.5 most of the time. And thinking toggle does nothing (at least it used to). Can Copilot models even use reasoning? I'm not sure which models are reasoning and which are not.
I'm pretty sure that Sonnet and Opus are ran without thinking, Gemini 3 Pro is with auto reasoning, and GPT-5.1 family is with medium. Codex models also think (afaik) but I'm not sure if their traces are accessible via the responses API
Activity
rekram1-node commentedon Nov 18, 2025
@furkan-bayram132 did you enable it in your copilot settings? Also note that some of their api is down and could be causing issues too
[-]Gemini 3.0 Invalid[/-][+]Gemini 3.0 invalid body request[/+]furkan-bayram132 commentedon Nov 18, 2025
@rekram1-node yes i enabled it
rekram1-node commentedon Nov 18, 2025
Do u have any mcp servers? Their api may be erroring due tot hat
joskfg commentedon Nov 18, 2025
I'm having the same issue and it is failing when I ask to contact the context7 MCP server.
furkan-bayram132 commentedon Nov 18, 2025
i don't have any mcp servers
rversteegen commentedon Nov 18, 2025
I see the same thing in opencode 0.15.31 (I see a lot of bugs constantly fixed in 1.x so thought I'd wait a little). No MCP or LSP servers here.
And as mentioned on your X post, Gemini 3 in Zen is also throwing that Generative AI API key error.
rekram1-node commentedon Nov 18, 2025
@rversteegen can u show me
opencode auth listand then try:
opencode run hello --print-logs --model opencode/gemini-3-prorversteegen commentedon Nov 18, 2025
Oh, noone mentioned this detail yet: the agent always performs one tool call successfully, and then shows the error. I tell it to continue and it repeats:
rversteegen commentedon Nov 19, 2025
I see a
model=gpt-5-nano failed to generate titleAPI error in there, but the titles do generate just fine when not usingopencode/gemini-3-pro, so I guess it's because the whole session is errored.Anyway it's about time I upgraded to opencode 1.x unless you want me to continue testing with 0.15 for any reason.
nerdeveloper commentedon Nov 19, 2025
i am having this same error, using the latest version of opencode
22 remaining items
dkEwenSELLITTO commentedon Dec 3, 2025
Same error on
❯ opencode --version
1.0.128
MacOS 26.1
but I don't see any error with this command :
opencode run hello --print-logs --model github-copilot/gemini-3-pro-previewI just get errors after a tool use
rekram1-node commentedon Dec 3, 2025
yep known issue
aadishv commentedon Dec 10, 2025
It mysteriously seems to work for me now, even though it doesn't seem there have been any changes on OpenCode side that could have fixed it. Might just be that Copilot loosened their APIs a little although that still doesn't make much sense (as how else are they getting the thought signatures to give Google?). I'll look into it some more but we can probably close this issue now.
[screenshot from OC 1.0.142]
rekram1-node commentedon Dec 10, 2025
Yeah idk either but it does work
aadishv commentedon Dec 10, 2025
okay it works on my clone where I'm very sure it wasn't working previously so definitely a change on the Copilot API side. I'm still curious about how they have this implemented but, oh well, it works :)
@rekram1-node would you prefer I still make a PR just to implement thinking blocks for Copilot models?
rekram1-node commentedon Dec 10, 2025
@aadishv well let's talk through it, is it a huge change? what do u need to set to get reasoning to come back?
aadishv commentedon Dec 10, 2025
Yeah that's the biggest thing that is making me unsure. it requires basically cloning the entire openai compatible /chat/completions implementation, like we've already done for /responses. the modifications for thinking are very minimal its basically +1-1
rekram1-node commentedon Dec 10, 2025
What's the change tho? What did you need to set?
aadishv commentedon Dec 10, 2025
requires adding this to the chunk schema:
and this to the doStream function (I haven't updated doGenerate yet):
aadishv commentedon Dec 10, 2025
Okay just added it to doGenerate as well, it's very similar changes to the relevant schemas and methods
rekram1-node commentedon Dec 10, 2025
Hm ig guess u can pr it, kinda annoying we need a whole fork of compatible provider too.
aadishv commentedon Dec 10, 2025
yeah definitely, i'll make a pr, you can choose whether to merge or not :)
jcubic commentedon Dec 10, 2025
Do other methods in Copilot have reasoning? I use Sonnet 4.5 most of the time. And thinking toggle does nothing (at least it used to). Can Copilot models even use reasoning? I'm not sure which models are reasoning and which are not.
aadishv commentedon Dec 10, 2025
I'm pretty sure that Sonnet and Opus are ran without thinking, Gemini 3 Pro is with auto reasoning, and GPT-5.1 family is with medium. Codex models also think (afaik) but I'm not sure if their traces are accessible via the responses API