Skip to content

Opencode Github Agent with GitHub Copilot provider Throw AI_APICallError: Bad Request #3287

Closed

Description

@dgarridoa

Description

Hello

For some reason, the Opencode GitHub Agent with GitHub Copilot provider does not work. I followed the installation instruction explained here.

As you can see is able to find the copilot/gpt-5 model, therefore I dont think is an authentication problem:

https://github.com/dgarridoa/ragtube/actions/runs/18634091148/job/53122832766#step:3:88

Error summary:

error: {
    name: "UnknownError",
    data: {
      message: "AI_APICallError: Bad Request",
    },
  }
117692 |               }
117693 |             ])
117694 |           ]
117695 |         });
117696 |         if (result.info.role === "assistant" && result.info.error) {
117697 |           throw new Error(`${result.info.error.name}: ${"message" in result.info.error ? result.info.error.message : ""}`);

Locally, It does work.

OpenCode version

0.15.8

Steps to reproduce

  1. Install opencode github agent opencode github install
  2. Set Github Copilot as provider and pick a model
  3. Push opencode workflow
  4. Add GitHub App to the target repository
  5. Create an issue and add the /oc summarize comment.

Screenshot and/or share link

Image Image

Operating System

Omarchy 3.1.0

Terminal

Alacritty

Activity

  1. github-actions commented on Oct 19, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The most relevant potential duplicates are #678 and #1282 as they both specifically involve GitHub Copilot provider throwing the same AI_APICallError: Bad Request error.

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Oct 19, 2025

    @rekram1-node
    Contributor

    @dgarridoa im fairly certain copilot is oauth only so idk if you can use it in actions easily

    ill need to double check but if that is the case we should remove it from the suggestions for github install probs

  3. self-assigned this
    on Oct 19, 2025
  4. rothnic commented on Oct 24, 2025

    @rothnic

    So, I was just looking into this as well, since the big driver of using opencode for me is more control over the great value of the GitHub copilot pro+ subscription. I'd like to use the same setup within GitHub actions.

    Is there any way to store the auth file contents as a secret and reference it in the workflow before using opencode?

  5. rekram1-node commented on Oct 24, 2025

    @rekram1-node
    Contributor

    Idk the lifetime of the refresh token but the auth file is on your local system ~/.local/share/opencode/auth.json

    we will probbaly find some way to allow fro this when we have time

  6. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions