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: opencode run hangs when encountering certain errors instead of exiting #4506
I'm running opencode in a CI context, and it never proceeds past the first logging message until the timeout on the CI job executes the termination of the task. Then I see the initial output logs for installing the basic plugins.
✅ OPENCODE_CONFIG preset to /home/vsts/work/1/autopilot/opencode.jsonc
✅ OPENCODE_CONFIG_DIR preset to /home/vsts/work/1/autopilot/
✅ Using cached opencode
Running opencode command 'pr-review' with title 'PR Review: 111111'
opencode run "start evaluation and commentary on pr, in CI, so self solve all problems to finish review" --command "pr-review" --agent "default" --title "PR Review: 111111" --log-level "DEBUG" --print-logs
INFO 2025-11-19T19:04:11 +251ms service=default version=1.0.78 args=["run","start evaluation and commentary on pr, in CI, so self solve all problems to finish review","--command","pr-review","--agent","default","--title","PR Review: 111111","--log-level","DEBUG","--print-logs"] opencode
The error comes back with: Error: Command "pr-review" not found
I have created the file: $OPENCODE_CONFIG_DIR/command/pr-review.md.
When I use this same setup locally I do get further output.
I've configured all the Azure OpenAI model info and simulated running locally and it at least invokes the command.
I tried removing every MCP server, and it made no difference to the startup.
I made sure AZURE_API_KEY and AZURE_RESOURCE_NAME were set, and set my OPENCODE_CONFIG and OPENCODE_CONFIG_DIR to the repo path as cloned.
The model is accessible and confirmed to be deployed.
I also manually ran the npm install of the setup packages to try and make sure these weren't negatively impacting the agent startup.
Even though I'm running with --log-level DEBUG --print-logs it shows no activity until terminated. Should I be redirecting to stderr or something for it show up while running?
What's the most likely issue with my command not being found?
OpenCode version
1.0.78
UPDATE
/home/vsts/work/1/autopilot/ should be /home/vsts/work/1/autopilot/.opencode and /home/vsts/work/1/autopilot/.opencode/opencode.jsonc I bet that simple typo got me.
Will confirm and if so, then this would be great to have a early failure when config is not found rather than just timing out stuck.
changed the title [-]Opencode run hanging in CI, and then upon termination saying can't find a command[/-][+]bug: opencode run hangs when encountering certain errors instead of exiting[/+]on Nov 26, 2025
I tried to reproduce your issue and found that the command as you had it did not work. Also you must redirect the output, if your logging does not already capture stderr, as most informative/debug output is usually written to stdout to not clutter the stdout which will be processed.
You may replace bun run dev with opencode, and the paths with your local systems.
This is my attempt, see logfile.
#!/bin/bash
OPENCODE_CONFIG=~/.config/opencode/opencode.json
OPENCODE_CONFIG_DIR=~/.config/opencode
# opencode expects the prompt for direct evaluation to come from STDIN
echo "start evaluation and commentary on pr, in CI, so self solve all problems to finish review" |
bun run dev -- run --command "pr-review" --log-level "DEBUG" --agent plan --print-logs 2>&1
i changed the agent for my testing, and removed the --prompt.
i created ~/.config/opencode/command/pr-review.md.
Activity
[-]Opencode run hanging in CI, and then upon termination saying can't find a command[/-][+]bug: opencode run hangs when encountering certain errors instead of exiting[/+]rwese commentedon Nov 28, 2025
I tried to reproduce your issue and found that the command as you had it did not work. Also you must redirect the output, if your logging does not already capture stderr, as most informative/debug output is usually written to stdout to not clutter the stdout which will be processed.
You may replace
bun run devwithopencode, and the paths with your local systems.This is my attempt, see logfile.
i changed the agent for my testing, and removed the --prompt.
i created
~/.config/opencode/command/pr-review.md.see attached log, let me know if I got you wrong.
pipeline_command_log.gz
sheldonhull commentedon Dec 9, 2025
Ok, thanks to your suggestions I have it running. Thank you for clarifying!
fix(ci): add timeout to prevent OpenCode review workflow hangs
fix(tui): prevent hanging on certain errors
fix(tui): prevent hanging on certain errors
fix: add E2E test compatibility to error handling