镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[Bug]: Default model config for Commit & push doesn't work with opencode #10776

Closed

Description

@razzeee

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Setup only opencode
  2. Do some changes
  3. Try to use the "Commit & push" button
  4. It errors

Expected behavior

It shouldn't error and generate a message

Actual behavior

Image

Text generation failed in generateCommitMessage: OpenCode session.prompt request failed.

Impact

Major degradation or frequent failure

Version or commit

0.0.40

Environment

Fedora Linux

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

No response

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 8, 2026
  2. juliusmarminge commented on Sep 8, 2026

    @juliusmarminge
    Member

    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 OpenCodeTextGeneration when the SDK session.prompt call throws after a successful session.create:

    Text generation failed in generateCommitMessage: OpenCode session.prompt request failed.

    That is a different failure than:

    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:

    1. opencode --version (and whether this is OpenCode 1 or 2)
    2. Whether OpenCode chat still works in the same setup
    3. 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.

  3. added
    via-triageFiled through npx t3 triage
    acceptedfeature request accepted
    and removed
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 8, 2026
  4. razzeee commented on Sep 8, 2026

    @razzeee
    ContributorAuthor
    ❯ opencode --version
    1.18.29
    
    1. It's opencode 1
    2. 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.

    Image
  5. Destreyf commented on Sep 8, 2026

    @Destreyf

    @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.

    Image
  6. razzeee commented on Sep 8, 2026

    @razzeee
    ContributorAuthor

    I don't use go or zen.

  7. Destreyf commented on Sep 8, 2026

    @Destreyf

    If you modify the source control writer model do you get the same error?

  8. razzeee commented on Sep 8, 2026

    @razzeee
    ContributorAuthor

    Works with that enabled

  9. ciphrnotfound commented on Sep 8, 2026

    @ciphrnotfound

    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.

  10. josephv123 commented on Oct 6, 2026

    @josephv123
    Contributor

    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.
  11. 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
  12. t3dotgg commented on Oct 21, 2026

    @t3dotgg
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions