Repository navigation
/opencode raise an error in github actions #2549
Copy link
Copy link
Closed
Description
I was making a couple of test recently using the opencode Github action.
Here is the yaml file
name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
opencode:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run opencode
uses: sst/opencode/github@latest
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
with:
model: openrouter/anthropic/claude-sonnet-4
share: trueHere the error log on Github
Run sst/opencode/github@latest
with:
model: openrouter/anthropic/claude-sonnet-4
share: true
env:
OPENROUTER_API_KEY: ***
Run curl -fsSL https://opencode.ai/install | bash
curl -fsSL https://opencode.ai/install | bash
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
OPENROUTER_API_KEY: ***
VERSION: 0.5.29
Downloading opencode version: 0.5.29 ...
######################################################################## 100.0%
Successfully added opencode to $PATH in /home/runner/.bashrc
Added /home/runner/.opencode/bin to $GITHUB_PATH
Run opencode github run
opencode github run
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
OPENROUTER_API_KEY: ***
MODEL: openrouter/anthropic/claude-sonnet-4
SHARE: true
opencode github
manage GitHub agent
Commands:
opencode github install install the GitHub agent
Options:
--help show help [boolean]
-v, --version show version number [boolean]
--print-logs print logs to stderr [boolean]
--log-level log level
[string] [choices: "DEBUG", "INFO", "WARN", "ERROR"]
Error: Process completed with exit code 1.
A couple of thing I am surprised about:
- The version
0.5.29of opencode is being download - This is very strange
Commands:
opencode github install install the GitHub agent
Options:
--help show help [boolean]
-v, --version show version number [boolean]
--print-logs print logs to stderr [boolean]
--log-level log level
[string] [choices: "DEBUG", "INFO", "WARN", "ERROR"]
It is running the help / doc of the cli. It seems like something may be wrong with the command being triggered.
Let me know if you need anything more. The yaml is made with OpenRouter but I also tested directly with my Claude Max subscription and got the exact same error.
Many thanks
Cheers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
fbraza commentedon Sep 11, 2025
Ok.
Out of ignorance, because it runs the
curl -fsSL https://opencode.ai/install | bashI thought it will get the most up to date version. How did you pin this? I cannot find anything on thegithubfolder oraction.ymlfile.Second do you think this may be the root cause of the error?
Cheers
harrismcc commentedon Sep 12, 2025
I'm getting the same error on my repo, I just setup opencode in it today
notlousybook commentedon Sep 13, 2025
same error guys, when fixing this? and does /oc work here?
tudragon154203 commentedon Sep 14, 2025
/opencode can you take a look?
rmoriz commentedon Sep 17, 2025
"@latest" resolves to the latest tag of this repo which is right now 2 weeks behind the dev HEAD.
When using @v0.9.11 i'm getting a error related to bun v1.2.22
anglisano commentedon Sep 19, 2025
Same error here, there are some temporal solution? Or version that we can use until the latest work?
2025-09-19T14:42:20.5329362Z ##[group]Run sst/opencode/github@latest
with:
model: google/gemini-1.5-pro
env:
GOOGLE_GENERATIVE_AI_API_KEY: ***
Run curl -fsSL https://opencode.ai/install | bash
Downloading opencode version: 0.5.29 ...
#=#=#
##O#-#
############# 18.2%
################# 24.0%
#################### 28.9%
######################## 34.1%
############################# 40.9%
################################ 45.1%
############################################# 62.9%
################################################## 70.2%
############################################################## 87.1%
################################################################# 91.4%
######################################################################## 100.0%
Successfully added opencode to $PATH in /home/runner/.bashrc
Added /home/runner/.opencode/bin to $GITHUB_PATH
Run opencode github run
opencode github
manage GitHub agent
Commands:
opencode github install install the GitHub agent
Options:
--help show help [boolean]
-v, --version show version number [boolean]
--print-logs print logs to stderr [boolean]
--log-level log level
[string] [choices: "DEBUG", "INFO", "WARN", "ERROR"]
Process completed with exit code 1.
m9tdev commentedon Sep 19, 2025
Same here.
Also tried to pin to the latest version manually using:
but that results in the following error:
rekram1-node commentedon Sep 19, 2025
I will raise this to the team
fwang commentedon Sep 19, 2025
should be fixed!
give it a try
rekram1-node commentedon Sep 19, 2025
tested seems fixed
m9tdev commentedon Sep 19, 2025
Uses 0.5.5 now for me. It does seem to get further, but (i guess) because of the old version it doesn't support the
opencodeprovider yetSeems that providing the
VERSIONenv var doesn't have an effect and usinguses: sst/opencode/github@devin combination with the env var results in the same error as usingsst/opencode/github@v0.10.2fwang commentedon Sep 19, 2025
@m9tdev ah got it. im in the middle of revamping the gh actions stuff.. will try to get a version out early next week.
fbraza commentedon Sep 20, 2025
You rock @fwang thank loads for the good work. Looking forward
rohit-gohri commentedon Sep 22, 2025
Still an issue - downloading 0.5.5 version
rekram1-node commentedon Sep 22, 2025
@rohit-gohri can you share your action yml definition?
rohit-gohri commentedon Sep 22, 2025
I'm trying to use with GITHUB_TOKEN rather than with app
I tried with latest and it gave me this error:
I also tried using
sst/opencode/github@devand it gave me this error:rekram1-node commentedon Sep 22, 2025
this is the issue
remove that it should work
rohit-gohri commentedon Sep 22, 2025
@rekram1-node it doesn't work if I remove the token:
rohit-gohri commentedon Sep 22, 2025
The only way I got it working was with this fork - dev...rohit-gohri:opencode:dev
where I upgraded "@opencode-ai/sdk" to "0.11.1" and fixed build issues ( with opencode locally 😅 )
Happy to open a PR though not sure if this is the direction you want to go
rekram1-node commentedon Sep 22, 2025
@fwang is in charge of github action so he would know what is best here
rmoriz commentedon Sep 22, 2025
Also wonder if Github Workflow integration works at all with Githup Copilot. If not, that should be documented. I didn't manage to get it working at all a couple of days ago.
beaussan commentedon Oct 6, 2025
For anyone finding this comment, one version of the github action that actually works is
0.6.10, since it's the last commit (from a month ago) that didn't had thecatalog:as bun types versionsCurrently "works" with the following:
@fwang if there is a way to try / help out the new github integration, let me know!
jtag05 commentedon Oct 28, 2025
I'm not seeing a more appropriate issue to lend my voice to but I am still experiencing this with @latest attemtping to use
zai-coding-plan/glm-4.6. Pinning the version tov0.6.10works but seems to choking when I enable the posthog mcp I have wired up. Happy to open a new issue if that's preferable.rekram1-node commentedon Oct 28, 2025
new issue would be great @jtag05