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.8-flash intermittently fails with "does not support Responses API" #53712
When an agent's markdown frontmatter sets model: provider/model#variant, the variant is dropped when that agent runs as a subagent. The request goes out as the plain model, so models that need a variant fail. In this case, GitHub Copilot gemini-3.8-flash fails with does not support Responses API.
Active plugins: @dietrichgebert/ponytail, @slkiser/opencode-quota
Reproduction
Create ~/.config/opencode/agents/developer.md:
---description: Writes code.mode: subagentmodel: github-copilot/gemini-3.8-flash#medium---
You are a developer.
From a primary agent, invoke the developer subagent with any prompt.
Compare this with running the CLI directly:
opencode run -m github-copilot/gemini-3.8-flash#medium "reply OK" → works
opencode run -m github-copilot/gemini-3.8-flash "reply OK" → Error: model gemini-3.8-flash does not support Responses API.
Expected Behavior
The subagent uses gemini-3.8-flash with the medium variant, as documented in the V2 Agents docs (model uses provider/model with an optional #variant). The request should succeed like the -m ...#medium CLI call does.
Actual Behavior
The subagent fails every time with the same error as the no-variant CLI call:
AI.Error: model gemini-3.8-flash does not support Responses API.
Server log: level=ERROR message="Failed to drain Session" cause="AI.Error: model gemini-3.8-flash does not support Responses API."
Additional Context
Reproduces consistently. It started after we upgraded to 2.x and switched the agent from claude-sonnet-5.5 (no variant), which worked.
Possibly related: opencode run --standalone --agent developer "Reply with just OK" ran on exo-free instead of the agent's configured model.
Workaround: set a model that doesn't need a variant in the agent file.
Thanks for the detailed report. I tried to reproduce this on 2.0.24 with a simulated provider: I made a model with a medium variant and an agent file that has only description, mode: subagent and model: <provider>/<model>#medium, then called it from a primary agent with the subagent tool. The subagent's request went to the configured model with the medium variant applied, so the variant was not dropped there.
I couldn't test GitHub Copilot itself. Reading the code, the Copilot API used (Responses vs chat completions) comes from the model's supported endpoints, not from the variant, so something specific to your setup may be involved. Could you share:
Which model and variant the child session actually shows (e.g. in the TUI footer when you open the subagent session), or the model stored for that child session.
Whether it still fails with your plugins (@dietrichgebert/ponytail, @slkiser/opencode-quota) disabled.
Whether the parent session uses the same github-copilot/gemini-3.8-flash model, and whether the parent works.
A bit more of the server log around the error. It should show which model and variant the failing request used.
You can either reply here with the details, or edit the issue and then leave a comment saying you've updated it.
Plugins disabled: not tested yet (see below, the failure is intermittent, so a single run wouldn't be conclusive).
Parent session:github-copilot/claude-opus-5.5, works fine.
Server log: the error line doesn't include the model or variant:
level=ERROR message="Failed to drain Session" cause="AI.Error: model gemini-3.8-flash does not support Responses API.\n at ej (/$bunfs/root/chunk-ka490d6x.js:6:3619)\n at yD (/$bunfs/root/chunk-8easrj4b.js:30:8160) ...
New finding: it's intermittent and not variant-related. After an opencode service restart:
opencode run -m github-copilot/gemini-3.8-flash#medium --format json "reply OK" failed once with the same error (session stored with variant: medium, outcome failed, provider.invalid-request event).
Right after that, 4/4 runs with#medium and 4/4 runs without a variant succeeded, as did a --agent developer run.
My earlier "with variant works / without fails" comparison was just two single runs and is coincidence. Before the restart, every subagent call failed (3/3).
So the real question is why the Copilot request is sometimes routed to the Responses API for gemini-3.8-flash. Possibly the model's supported-endpoints metadata is stale or inconsistent between refreshes, or Copilot itself is flaky. Happy to retitle the issue or close it if you think it's Copilot-side. Is there a debug flag that logs which endpoint is chosen per request?
changed the title [-]agents: model #variant in agent frontmatter is dropped when invoked as subagent[/-][+]github-copilot: gemini-3.8-flash intermittently fails with "does not support Responses API"[/+]on Oct 7, 2026
Thanks for following up and correcting the diagnosis. That helps a lot. I agree the variant isn't being dropped: in my test on 2.0.24 the subagent's request also kept its variant, and your child sessions store variant: "medium".
The remaining problem is that some GitHub Copilot requests for gemini-3.8-flash fail with "does not support Responses API", whether or not a variant is set, and it seemed to clear up after an opencode service restart. That text doesn't come from OpenCode's own code, so it is most likely the error Copilot's API returned. In 2.0.24, OpenCode picks the Copilot endpoint (Responses vs chat completions) from the supported-endpoints list Copilot reports for each model when it fetches the model list. If Copilot sometimes lists /responses for this model, or an old model list stays in use until the service restarts, that could explain the intermittent failures.
I can't check this here: it needs a real GitHub Copilot account and the live model data. A maintainer with Copilot access will need to look into it. Your observation that a service restart cleared the repeated failures is a useful clue for them. I don't know of a flag that logs the chosen endpoint for each request.
Thanks for the detailed update. The report has useful reproduction steps and environment details, but the Bug Report template requires a Description field. Please rename ## Summary to ## Description so the required field is present.
The GitHub Copilot language hook in 2.0.24 uses options.endpoint when it's set. That value comes from the live Copilot /modelssupported_endpoints. When endpoint is missing, the hook falls back to a name heuristic that routes gemini-* to the Responses API:
Copilot's /models returns "supported_endpoints": ["/chat/completions"] for gemini-3.8-flash (checked 6 times, consistent). So whenever the live endpoint isn't applied to the model, the request goes to /responses and Copilot rejects it with does not support Responses API. The models.dev catalog entry has no endpoint, so it can't fill the gap.
This explains the intermittency. Failures line up with times the live metadata likely wasn't applied: a long-running service before restart, and the first request from a new directory right after a provider.updated reload.
Suggested fix: don't route gemini-* to /responses in the fallback (or default to chat when supported_endpoints is unknown), and/or make sure the live supported_endpoints is always applied before the first request.
Honestly, I have no clue why this was going wrong. I reverted my developer agent model to sonnet 5 (also copilot) and now again switched back to gemini 3.8 flash with medium effort and somehow now everything works flawlessly.
Activity
opencode-agent commentedon Oct 7, 2026
Thanks for the detailed report. I tried to reproduce this on 2.0.24 with a simulated provider: I made a model with a
mediumvariant and an agent file that has onlydescription,mode: subagentandmodel: <provider>/<model>#medium, then called it from a primary agent with the subagent tool. The subagent's request went to the configured model with themediumvariant applied, so the variant was not dropped there.I couldn't test GitHub Copilot itself. Reading the code, the Copilot API used (Responses vs chat completions) comes from the model's supported endpoints, not from the variant, so something specific to your setup may be involved. Could you share:
modelstored for that child session.@dietrichgebert/ponytail,@slkiser/opencode-quota) disabled.github-copilot/gemini-3.8-flashmodel, and whether the parent works.You can either reply here with the details, or edit the issue and then leave a comment saying you've updated it.
mtheunissen82 commentedon Oct 7, 2026
Thanks for looking into this. My original diagnosis was wrong: the variant is not dropped.
github-copilot/claude-opus-5.5, works fine.New finding: it's intermittent and not variant-related. After an
opencode service restart:opencode run -m github-copilot/gemini-3.8-flash#medium --format json "reply OK"failed once with the same error (session stored withvariant: medium, outcomefailed,provider.invalid-requestevent).#mediumand 4/4 runs without a variant succeeded, as did a--agent developerrun.My earlier "with variant works / without fails" comparison was just two single runs and is coincidence. Before the restart, every subagent call failed (3/3).
So the real question is why the Copilot request is sometimes routed to the Responses API for
gemini-3.8-flash. Possibly the model's supported-endpoints metadata is stale or inconsistent between refreshes, or Copilot itself is flaky. Happy to retitle the issue or close it if you think it's Copilot-side. Is there a debug flag that logs which endpoint is chosen per request?[-]agents: model #variant in agent frontmatter is dropped when invoked as subagent[/-][+]github-copilot: gemini-3.8-flash intermittently fails with "does not support Responses API"[/+]opencode-agent commentedon Oct 7, 2026
Thanks for following up and correcting the diagnosis. That helps a lot. I agree the variant isn't being dropped: in my test on 2.0.24 the subagent's request also kept its variant, and your child sessions store
variant: "medium".The remaining problem is that some GitHub Copilot requests for
gemini-3.8-flashfail with "does not support Responses API", whether or not a variant is set, and it seemed to clear up after anopencode service restart. That text doesn't come from OpenCode's own code, so it is most likely the error Copilot's API returned. In 2.0.24, OpenCode picks the Copilot endpoint (Responses vs chat completions) from the supported-endpoints list Copilot reports for each model when it fetches the model list. If Copilot sometimes lists/responsesfor this model, or an old model list stays in use until the service restarts, that could explain the intermittent failures.I can't check this here: it needs a real GitHub Copilot account and the live model data. A maintainer with Copilot access will need to look into it. Your observation that a service restart cleared the repeated failures is a useful clue for them. I don't know of a flag that logs the chosen endpoint for each request.
github-actions commentedon Oct 7, 2026
Thanks for the detailed update. The report has useful reproduction steps and environment details, but the Bug Report template requires a
Descriptionfield. Please rename## Summaryto## Descriptionso the required field is present.mtheunissen82 commentedon Oct 7, 2026
Found the likely root cause.
The GitHub Copilot
languagehook in 2.0.24 usesoptions.endpointwhen it's set. That value comes from the live Copilot/modelssupported_endpoints. Whenendpointis missing, the hook falls back to a name heuristic that routesgemini-*to the Responses API:Copilot's
/modelsreturns"supported_endpoints": ["/chat/completions"]forgemini-3.8-flash(checked 6 times, consistent). So whenever the live endpoint isn't applied to the model, the request goes to/responsesand Copilot rejects it withdoes not support Responses API. The models.dev catalog entry has no endpoint, so it can't fill the gap.This explains the intermittency. Failures line up with times the live metadata likely wasn't applied: a long-running service before restart, and the first request from a new directory right after a
provider.updatedreload.Suggested fix: don't route
gemini-*to/responsesin the fallback (or default to chat whensupported_endpointsis unknown), and/or make sure the livesupported_endpointsis always applied before the first request.github-actions commentedon Oct 7, 2026
Thanks for updating the issue with the new findings, reproduction context, and system details.
mtheunissen82 commentedon Oct 7, 2026
Honestly, I have no clue why this was going wrong. I reverted my developer agent model to sonnet 5 (also copilot) and now again switched back to gemini 3.8 flash with medium effort and somehow now everything works flawlessly.