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
[Bug]: Default model config for Commit & push doesn't work with opencode #10776
Commit & push (git.runStackedAction → generateCommitMessage) has no fallback. If generation throws, the whole commit/push is aborted.
Likely cause
Chat already talks to OpenCode with session.promptAsync. Commit/PR/title/branch generation still uses blocking session.prompt on a throw-on-error SDK client (@opencode-ai/sdk@1.15.13 in 0.0.40). Newer OpenCode (1.17+ / v2) changed that prompt endpoint so it no longer returns a completed message body. A parse/schema/HTTP throw then gets rewritten to this generic toast, hiding the real cause. Official OpenCode 2 support is still open (#8207).
Workaround
Type a commit message in the git dialog before Commit & push — a non-empty custom message skips generation.
Ask
Please add:
opencode --version (and whether this is OpenCode 1 or 2)
Whether OpenCode chat still works in the same setup
The matching server log line around the failure (the SDK cause is stored but not shown in the toast)
Next
Treat as accepted. Fix belongs in apps/server/src/textGeneration/OpenCodeTextGeneration.ts: align with the chat adapter’s promptAsync + wait path, and surface the SDK/HTTP error in the toast.
Regular chat works with github-copilot/gpt-5.6-sol or similar
created ... title="T3 Code generateCommitMessage"
ERROR ... ProviderModelNotFoundError:
Model not found: openai/gpt-5.
Did you mean: gpt-5, gpt-5.4, gpt-5.6?
I do not have an openai subscription on this system (or ever had)
Settings show Haiku to be configured, but I don't remember doing that or it was ages ago. Guess this might be a different setting anyway.
@razzeee do you use opencode go or zen, i have seen a similar error when the model is disabled?
The model definition openai/gpt-5 would definitely point to an opanai key/sub of some sort typically.
The "Text generation model" I think is what was used for generating thread titles and commit messages depending on how it's configured at the bottom of the "Source Control" settings page, which by default falls back to the global text generation model.
I’ll take this. I’ll keep it scoped to OpenCodeTextGeneration: align commit-message generation with the existing promptAsync + wait flow and improve error propagation, with focused regression coverage.
Some findings that may change the fix direction here.
The failure in the follow-up is ProviderModelNotFoundError: openai/gpt-5, and it went away after picking a writer model. openai/gpt-5 is the OpenCode default text-generation model (DEFAULT_TEXT_GENERATION_MODEL_BY_PROVIDER in packages/contracts/src/model.ts). Commit & push fails for any OpenCode user who has no OpenAI provider connected and hasn't set a writer model.
Surfacing the SDK error alone wouldn't name that cause. I ran OpenCode 1.18.29 (the reporter's version) and called session.prompt through @opencode-ai/sdk 1.15.13 with throwOnError: true, as OpenCodeTextGeneration does, using openai/gpt-5 with no OpenAI provider configured. The server answers 500 with:
{ "name": "UnknownError", "data": { "message": "Unexpected server error. Check server logs for details." } }
The toast would only change from "session.prompt request failed" to "Unexpected server error". Both OpenCode text-generation paths also deliberately use fixed error text.
Two small options, both product calls:
Name the model in the failure, e.g. "OpenCode couldn't generate with openai/gpt-5. Choose a writer model in Settings → Source Control." That's enough for the user to fix it.
Don't default OpenCode text generation to a model from a provider the user hasn't connected.
changed the title [-][Bug]: Commit & push doesn't work with opencode[/-][+][Bug]: Default model config for Commit & push doesn't work with opencode[/+]on Oct 15, 2026
Thanks for the report. One part of this is fixed on main in #19386. Please test on the nightly built from main on 2026-10-21, or on the next stable release. One part is still open: Other OpenCode-only setups can still fall back to openai/gpt-5 and show a generic generation error. If that part still matters to you, please open a new issue for that part only.
Activity
juliusmarminge commentedon Sep 8, 2026
Thanks for the report — this looks like a real OpenCode commit-message generation failure, not a web-button bug.
What we know
The toast text is produced only in
OpenCodeTextGenerationwhen the SDKsession.promptcall throws after a successfulsession.create:Text generation failed in generateCommitMessage: OpenCode session.prompt request failed.That is a different failure than:
OpenCode returned no structured output) — fixed in fix(server): handle OpenCode text response format in commit message g… #2202Commit & push (
git.runStackedAction→generateCommitMessage) has no fallback. If generation throws, the whole commit/push is aborted.Likely cause
Chat already talks to OpenCode with
session.promptAsync. Commit/PR/title/branch generation still uses blockingsession.prompton a throw-on-error SDK client (@opencode-ai/sdk@1.15.13in 0.0.40). Newer OpenCode (1.17+ / v2) changed that prompt endpoint so it no longer returns a completed message body. A parse/schema/HTTP throw then gets rewritten to this generic toast, hiding the real cause. Official OpenCode 2 support is still open (#8207).Workaround
Type a commit message in the git dialog before Commit & push — a non-empty custom message skips generation.
Ask
Please add:
opencode --version(and whether this is OpenCode 1 or 2)Next
Treat as accepted. Fix belongs in
apps/server/src/textGeneration/OpenCodeTextGeneration.ts: align with the chat adapter’spromptAsync+ wait path, and surface the SDK/HTTP error in the toast.razzeee commentedon Sep 8, 2026
I do not have an openai subscription on this system (or ever had)
Settings show Haiku to be configured, but I don't remember doing that or it was ages ago. Guess this might be a different setting anyway.
Destreyf commentedon Sep 8, 2026
@razzeee do you use opencode go or zen, i have seen a similar error when the model is disabled?
The model definition
openai/gpt-5would definitely point to an opanai key/sub of some sort typically.The "Text generation model" I think is what was used for generating thread titles and commit messages depending on how it's configured at the bottom of the "Source Control" settings page, which by default falls back to the global text generation model.
razzeee commentedon Sep 8, 2026
I don't use go or zen.
Destreyf commentedon Sep 8, 2026
If you modify the source control writer model do you get the same error?
razzeee commentedon Sep 8, 2026
Works with that enabled
ciphrnotfound commentedon Sep 8, 2026
I’ll take this. I’ll keep it scoped to OpenCodeTextGeneration: align commit-message generation with the existing promptAsync + wait flow and improve error propagation, with focused regression coverage.
josephv123 commentedon Oct 6, 2026
Some findings that may change the fix direction here.
The failure in the follow-up is
ProviderModelNotFoundError: openai/gpt-5, and it went away after picking a writer model.openai/gpt-5is the OpenCode default text-generation model (DEFAULT_TEXT_GENERATION_MODEL_BY_PROVIDERinpackages/contracts/src/model.ts). Commit & push fails for any OpenCode user who has no OpenAI provider connected and hasn't set a writer model.Surfacing the SDK error alone wouldn't name that cause. I ran OpenCode 1.18.29 (the reporter's version) and called
session.promptthrough@opencode-ai/sdk1.15.13 withthrowOnError: true, asOpenCodeTextGenerationdoes, usingopenai/gpt-5with no OpenAI provider configured. The server answers500with:{ "name": "UnknownError", "data": { "message": "Unexpected server error. Check server logs for details." } }The toast would only change from "session.prompt request failed" to "Unexpected server error". Both OpenCode text-generation paths also deliberately use fixed error text.
Two small options, both product calls:
[-][Bug]: Commit & push doesn't work with opencode[/-][+][Bug]: Default model config for Commit & push doesn't work with opencode[/+]t3dotgg commentedon Oct 21, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for the report. One part of this is fixed on main in #19386. Please test on the nightly built from main on 2026-10-21, or on the next stable release. One part is still open: Other OpenCode-only setups can still fall back to openai/gpt-5 and show a generic generation error. If that part still matters to you, please open a new issue for that part only.