Skip to content

Commit 32db545

Browse files
Copilotpelikhan
andcommitted
Update OpenCode to version 0.15.13 with --model flag support
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 5c62b1e commit 32db545

2 files changed

Lines changed: 15 additions & 34 deletions

File tree

.github/workflows/shared/opencode.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
engine:
33
id: custom
44
env:
5-
GH_AW_AGENT_VERSION: "0.1.0"
5+
GH_AW_AGENT_VERSION: "0.15.13"
66
GH_AW_AGENT_MODEL: "anthropic/claude-3-5-sonnet-20241022"
77
steps:
88
- name: Install OpenCode
@@ -13,13 +13,7 @@ engine:
1313
- name: Run OpenCode
1414
id: opencode
1515
run: |
16-
output=$(opencode run "$(cat "$GH_AW_PROMPT")" --print-logs 2>&1)
17-
echo "$output"
18-
# Check if opencode showed usage help instead of running (indicates error)
19-
if echo "$output" | grep -q "Run OpenCode with a message"; then
20-
echo "Error: OpenCode failed to run (showed usage help)"
21-
exit 1
22-
fi
16+
opencode run "$(cat "$GH_AW_PROMPT")" --model "${GH_AW_AGENT_MODEL}" --print-logs
2317
env:
2418
GH_AW_AGENT_MODEL: ${{ env.GH_AW_AGENT_MODEL }}
2519
GH_AW_PROMPT: ${{ env.GH_AW_PROMPT }}
@@ -50,7 +44,7 @@ imports:
5044
- shared/opencode.md
5145
engine:
5246
env:
53-
GH_AW_AGENT_VERSION: "0.2.0" # Use a different OpenCode version
47+
GH_AW_AGENT_VERSION: "0.15.13" # Use a different OpenCode version
5448
GH_AW_AGENT_MODEL: "openai/gpt-4" # Use a different AI model
5549
---
5650
```
@@ -60,17 +54,16 @@ engine:
6054
- The prompt file is read directly in the Run OpenCode step using command substitution
6155
- OpenCode is executed in non-interactive mode with logs printed to stderr
6256
- Output is captured in the agent log file
63-
- **Network access required**: OpenCode connects to https://api.dev.opencode.ai/
6457
6558
**Environment Variables:**
66-
- `GH_AW_AGENT_VERSION`: OpenCode version (default: `0.1.0`)
67-
- `GH_AW_AGENT_MODEL`: AI model preference (for documentation only - not used by CLI)
59+
- `GH_AW_AGENT_VERSION`: OpenCode version (default: `0.15.13`)
60+
- `GH_AW_AGENT_MODEL`: AI model in `provider/model` format (default: `anthropic/claude-3-5-sonnet-20241022`)
6861
- `ANTHROPIC_API_KEY`: Required if using Anthropic models
6962
- `OPENAI_API_KEY`: Required if using OpenAI models
7063
71-
**Important Notes**:
72-
- The opencode-ai project repository is archived and may not receive updates
73-
- This workflow requires internet access to both install npm packages and connect to OpenCode's cloud service
64+
**Note**:
65+
- This workflow requires internet access to install npm packages
7466
- The opencode version can be customized by setting the `GH_AW_AGENT_VERSION` environment variable
75-
- Model selection is configured through OpenCode's cloud service, not via CLI flags
67+
- The AI model can be customized by setting the `GH_AW_AGENT_MODEL` environment variable
68+
- OpenCode is provider-agnostic and supports multiple LLM providers
7669
-->

.github/workflows/smoke-opencode.lock.yml

Lines changed: 6 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)