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

Open
opened 2026-02-16 17:34:33 -05:00 by yindo · 4 comments
Owner

Originally created by @dgarridoa on GitHub (Oct 19, 2025).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @dgarridoa on GitHub (Oct 19, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Hello For some reason, the Opencode GitHub Agent with GitHub Copilot provider does not work. I followed the installation instruction explained [here](https://opencode.ai/docs/github/). 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 <img width="1381" height="947" alt="Image" src="https://github.com/user-attachments/assets/81991fc8-1308-415c-a220-b5cf3a466417" /> <img width="1637" height="1298" alt="Image" src="https://github.com/user-attachments/assets/3ea51037-4446-45c0-97fc-3d1af4cfb465" /> ### Operating System Omarchy 3.1.0 ### Terminal Alacritty
yindo added the bug label 2026-02-16 17:34:33 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 19, 2025):

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

  • #678: AI_APICallError: Bad Request with GitHub Copilot - similar error pattern and provider
  • #1282: Copilot models respond with AI_APICallError: Bad Request after a quick chat - same error with GitHub Copilot provider
  • #3017: Reproducible AI_APICallError: Bad Request on a particular repo and prompt - similar error pattern though with different provider
  • #494: AI_APICallError: Bad Request with Open Router - similar error pattern but different provider

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.

@github-actions[bot] commented on GitHub (Oct 19, 2025): This issue might be a duplicate of existing issues. Please check: - #678: AI_APICallError: Bad Request with GitHub Copilot - similar error pattern and provider - #1282: Copilot models respond with AI_APICallError: Bad Request after a quick chat - same error with GitHub Copilot provider - #3017: Reproducible AI_APICallError: Bad Request on a particular repo and prompt - similar error pattern though with different provider - #494: AI_APICallError: Bad Request with Open Router - similar error pattern but different provider 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.
Author
Owner

@rekram1-node commented on GitHub (Oct 19, 2025):

@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

@rekram1-node commented on GitHub (Oct 19, 2025): @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
Author
Owner

@rothnic commented on GitHub (Oct 24, 2025):

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?

@rothnic commented on GitHub (Oct 24, 2025): 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?
Author
Owner

@rekram1-node commented on GitHub (Oct 24, 2025):

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

@rekram1-node commented on GitHub (Oct 24, 2025): 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2181