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
The root cause appears to be related to request body transformation when using Gemini models with Copilot authentication. Issues #5161 and #4816 are particularly similar to your case.
Feel free to ignore if none of these address your specific case.
I found configuration causing the problem. I updated the description.
In my case it was the Docker Gateway MCP with the Linear plugin enabled. It might be the Linear MCP by itself. It works fine with the other plugins I have in the Docker MCP toolkit. But removing the Linear plugin fixed the issue on my end.
Gemini models require nullable types to use OpenAPI 3.0 nullable keyword instead of JSON Schema union types
(from vscode copilot extension)
Had the same issue with chrome_devtools and this ended up being the reason. --no-category-emulation disables emulate which is the only tool with nullable types
I'm not sure when this was fixed, but the issue no longer seems to occur in the current version 1.2.27. How about everyone else? I don't think Notion MCP was suddenly patched or anything...
To me it was working really good last week but not it does not work anymore, just a Bad Request for any Gemini model on Copilot. All Gemini models are enabled in https://github.com/settings/copilot/features and I've "unlimited" budget for now (this an enterprise account).
Last week usage from opencode stats:
Logs:
$ opencode --version
1.16.2
INFO 2026-06-09T11:16:51 +0ms service=bus type=session.status publishing
INFO 2026-06-09T11:16:51 +1ms service=llm providerID=github-copilot modelID=gemini-3-flash-preview session.id=ses_153e68fa7ffet8Tfjdff8dTyMa small=false agent=build mode=primary stream
INFO 2026-06-09T11:16:51 +0ms service=provider status=started providerID=github-copilot getSDK
INFO 2026-06-09T11:16:51 +0ms service=provider status=completed duration=0 providerID=github-copilot getSDK
INFO 2026-06-09T11:16:51 +6ms service=default llm.runtime=ai-sdk llm.provider=github-copilot llm.model=gemini-3-flash-preview llm runtime selected
INFO 2026-06-09T11:16:52 +592ms service=bus type=session.updated publishing
ERROR 2026-06-09T11:16:52 +93ms service=llm providerID=github-copilot modelID=gemini-3-flash-preview session.id=ses_153e68fa7ffet8Tfjdff8dTyMa small=false agent=build mode=primary error={"error":{"name":"AI_APICallError","url":"https://api.githubcopilot.com/chat/completions","requestBodyValues":{"model":"gemini-3-flash-preview","max_tokens":32000,"temperature":1,"top_p":0.95,"messages":[...],"tool_choice":"auto","stream":true},"statusCode":400,"responseHeaders":{"cache-control":"no-cache","content-security-policy":"default-src 'none'; sandbox","content-type":"text/plain; charset=utf-8","date":"Tue, 09 Jun 2026 11:16:52 GMT","strict-transport-security":"max-age=31536000","transfer-encoding":"chunked","x-content-type-options":"nosniff","x-copilot-api-exp-assignment-context":"5133j383:1109202;c_a15ch289:1165001;","x-copilot-service-request-id":"dbb73113-bccc-4129-ab84-c746ae27e505","x-github-backend":"Kubernetes","x-github-request-id":"F0DE:1AC31E:426470B:46D8DA6:6A27F622","x-request-id":"00000-745affe7-5b90-4fc5-9375-a0d6a42c329c"},"responseBody":"Bad Request\n","isRetryable":false}} stream error
ERROR 2026-06-09T11:16:52 +6ms service=session.processor session.id=ses_153e68fa7ffet8Tfjdff8dTyMa messageID=msg_eac19734c0014A3U1O5hjV8CuC error=Bad Request stack=AI_APICallError: Bad Request
at <anonymous> (/$bunfs/root/chunk-w4xmcxp8.js:6:14766)
at async <anonymous> (/$bunfs/root/chunk-w4xmcxp8.js:6:12790)
at processTicksAndRejections (native:7:39) process
INFO 2026-06-09T11:16:52 +0ms service=bus type=session.error publishing
INFO 2026-06-09T11:16:52 +0ms service=bus type=session.status publishing
INFO 2026-06-09T11:16:52 +0ms service=bus type=session.idle publishing
INFO 2026-06-09T11:16:52 +2ms service=bus type=message.updated publishing
INFO 2026-06-09T11:16:52 +1ms service=bus type=session.status publishing
INFO 2026-06-09T11:16:52 +0ms service=bus type=session.idle publishing
Error: Bad Request: Bad Request
UPDATE
Removing the Github MCP seems to solve the problem:
Gemini models started to working. I just tried Gemini 3.1. pro and it worked. I wanted to let you know. Since my last message i didn't change anything.
Activity
github-actions commentedon Jan 14, 2026
This issue might be a duplicate of existing issues. Please check:
The root cause appears to be related to request body transformation when using Gemini models with Copilot authentication. Issues #5161 and #4816 are particularly similar to your case.
Feel free to ignore if none of these address your specific case.
ngt-sg commentedon Jan 14, 2026
I found configuration causing the problem. I updated the description.
In my case it was the Docker Gateway MCP with the Linear plugin enabled. It might be the Linear MCP by itself. It works fine with the other plugins I have in the Docker MCP toolkit. But removing the Linear plugin fixed the issue on my end.
smerrill commentedon Jan 29, 2026
I have the same issue with
chrome-devtools-mcp@latest.smerrill commentedon Jan 29, 2026
Although interestingly starting that MCP with
--no-category-emulationlets it work with GitHub-hosted Gemini 3 models. Very odd.NateSmyth commentedon Jan 29, 2026
@smerrill
(from vscode copilot extension)
Had the same issue with chrome_devtools and this ended up being the reason.
--no-category-emulationdisables emulate which is the only tool with nullable typesfujunchao commentedon Jan 31, 2026
I'm having the same problem with Chrome DevTools,After configuring the same parameters, the problem is solved with --no-category-emulation。
rekram1-node commentedon Jan 31, 2026
ah yeah ig we need to sanitize the tools more aggressively for gemini
smerrill commentedon Jan 31, 2026
The strange thing is that this is only a problem for Copilot Gemini 3, not directly via the gemini-auth plugin.
dinhphieu commentedon Feb 2, 2026
Yup, can confirm. Running from a directory without MCP configs (no chrome-devtools-mcp especially) allowed Copilot Gemini to work
mattleong commentedon Feb 2, 2026
Yup, I can confirm that the sentry mcp server is also causing this issue for me.
alvinometric commentedon Feb 3, 2026
Same here, with the Linear MCP
It looks like there is an attempted fix here: #11968
rekram1-node commentedon Feb 3, 2026
I believe this should be fixed in next release
2 remaining items
MPThLee commentedon Feb 23, 2026
These seem to be also related to #14509 in recent conditions.
I have no Chrome DevTools MCP, but I am still getting a Bad Request too.
lightrao commentedon Feb 23, 2026
add '--no-category-emulation' for chrome-devtools mcp:
raymelon commentedon Feb 23, 2026
instagit mcp also introduces the same issue
Levyrii commentedon Mar 6, 2026
I have the same issue with zereight/mcp-gitlab
Tetrahedrite commentedon Mar 11, 2026
I got same issue with Notion official remote MCP server.
{ "$schema": "https://opencode.ai/config.json", "mcp": { "notion": { "type": "remote", "url": "https://mcp.notion.com/mcp", "enabled": true } } }kvn1351 commentedon Mar 13, 2026
Still an issue on Opencode 1.2.25. Chrome devtools mcp breaks both Gemini flash 3.0 (copilot) and GLM5 (nanogpt).
Tetrahedrite commentedon Mar 19, 2026
I'm not sure when this was fixed, but the issue no longer seems to occur in the current version 1.2.27. How about everyone else? I don't think Notion MCP was suddenly patched or anything...
iamniels commentedon Apr 1, 2026
I still have this issue with the Jetbrains built-in MCP server on Opencode 1.3.13
jetbrains_opencode_mcp_bad_request.webm
ricardo-markiewicz-cs commentedon Jun 9, 2026
To me it was working really good last week but not it does not work anymore, just a Bad Request for any Gemini model on Copilot. All Gemini models are enabled in https://github.com/settings/copilot/features and I've "unlimited" budget for now (this an enterprise account).
Last week usage from
opencode stats:Logs:
UPDATE
Removing the Github MCP seems to solve the problem:
This is the github MCP I was using
Kjaer commentedon Jun 9, 2026
hmm, I am using 2 MCP, engram and public-browser. I disabled them and error still occurs.
I installed copilot enhanced plugin and now error is more visible rather than 400-Bad request
Kjaer commentedon Jun 11, 2026
I just tried using Gemini models with Crush(https://github.com/charmbracelet/crush) and it's working there.
Can we say, something broken in opencode?
I am using 2 MCP: public-browser, engram
Kjaer commentedon Jun 16, 2026
Gemini models started to working. I just tried Gemini 3.1. pro and it worked. I wanted to let you know. Since my last message i didn't change anything.
github-actions commentedon Aug 16, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.