From b9d873e164519bb31530b4edd87115216051d4aa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:38:00 +0000 Subject: [PATCH 1/4] Initial plan From 8138ce53d171f35669214687665284875e98daef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:47:19 +0000 Subject: [PATCH 2/4] Fix OpenCode CLI syntax in smoke test workflow Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/shared/opencode.md | 15 ++++++++------- .github/workflows/smoke-opencode.lock.yml | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/shared/opencode.md b/.github/workflows/shared/opencode.md index 8964fc2c35..29c8872309 100644 --- a/.github/workflows/shared/opencode.md +++ b/.github/workflows/shared/opencode.md @@ -13,7 +13,7 @@ engine: - name: Run OpenCode id: opencode run: | - opencode run "$(cat "$GH_AW_PROMPT")" --model "${GH_AW_AGENT_MODEL}" --no-tui + opencode run "$(cat "$GH_AW_PROMPT")" --print-logs env: GH_AW_AGENT_MODEL: ${{ env.GH_AW_AGENT_MODEL }} GH_AW_PROMPT: ${{ env.GH_AW_PROMPT }} @@ -52,18 +52,19 @@ engine: **Requirements:** - The workflow will install opencode-ai npm package using version from `GH_AW_AGENT_VERSION` env var - The prompt file is read directly in the Run OpenCode step using command substitution -- OpenCode is executed in non-TUI mode with the specified model +- OpenCode is executed in non-interactive mode with logs printed to stderr - Output is captured in the agent log file +- **Network access required**: OpenCode connects to https://api.dev.opencode.ai/ **Environment Variables:** - `GH_AW_AGENT_VERSION`: OpenCode version (default: `0.1.0`) -- `GH_AW_AGENT_MODEL`: AI model in `provider/model` format (default: `anthropic/claude-3-5-sonnet-20241022`) +- `GH_AW_AGENT_MODEL`: AI model preference (for documentation only - not used by CLI) - `ANTHROPIC_API_KEY`: Required if using Anthropic models - `OPENAI_API_KEY`: Required if using OpenAI models -**Note**: -- This workflow requires internet access to install npm packages +**Important Notes**: +- The opencode-ai project repository is archived and may not receive updates +- This workflow requires internet access to both install npm packages and connect to OpenCode's cloud service - The opencode version can be customized by setting the `GH_AW_AGENT_VERSION` environment variable -- The AI model can be customized by setting the `GH_AW_AGENT_MODEL` environment variable -- OpenCode is provider-agnostic and supports multiple LLM providers +- Model selection is configured through OpenCode's cloud service, not via CLI flags --> diff --git a/.github/workflows/smoke-opencode.lock.yml b/.github/workflows/smoke-opencode.lock.yml index e8499f9c72..99a76a6e05 100644 --- a/.github/workflows/smoke-opencode.lock.yml +++ b/.github/workflows/smoke-opencode.lock.yml @@ -1119,7 +1119,7 @@ jobs: - name: Run OpenCode id: opencode run: | - opencode run "$(cat "$GH_AW_PROMPT")" --model "${GH_AW_AGENT_MODEL}" --no-tui + opencode run "$(cat "$GH_AW_PROMPT")" --print-logs env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GH_AW_AGENT_MODEL: anthropic/claude-3-5-sonnet-20241022 @@ -2378,7 +2378,7 @@ jobs: - name: Run OpenCode id: opencode run: | - opencode run "$(cat "$GH_AW_PROMPT")" --model "${GH_AW_AGENT_MODEL}" --no-tui + opencode run "$(cat "$GH_AW_PROMPT")" --print-logs env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GH_AW_AGENT_MODEL: anthropic/claude-3-5-sonnet-20241022 From 5c62b1e07cf965d933df99970241c0102e989290 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:50:28 +0000 Subject: [PATCH 3/4] Add error detection for OpenCode CLI failures Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/shared/opencode.md | 8 +++++++- .github/workflows/smoke-opencode.lock.yml | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/shared/opencode.md b/.github/workflows/shared/opencode.md index 29c8872309..a6905ea913 100644 --- a/.github/workflows/shared/opencode.md +++ b/.github/workflows/shared/opencode.md @@ -13,7 +13,13 @@ engine: - name: Run OpenCode id: opencode run: | - opencode run "$(cat "$GH_AW_PROMPT")" --print-logs + output=$(opencode run "$(cat "$GH_AW_PROMPT")" --print-logs 2>&1) + echo "$output" + # Check if opencode showed usage help instead of running (indicates error) + if echo "$output" | grep -q "Run OpenCode with a message"; then + echo "Error: OpenCode failed to run (showed usage help)" + exit 1 + fi env: GH_AW_AGENT_MODEL: ${{ env.GH_AW_AGENT_MODEL }} GH_AW_PROMPT: ${{ env.GH_AW_PROMPT }} diff --git a/.github/workflows/smoke-opencode.lock.yml b/.github/workflows/smoke-opencode.lock.yml index 99a76a6e05..ffc56955fe 100644 --- a/.github/workflows/smoke-opencode.lock.yml +++ b/.github/workflows/smoke-opencode.lock.yml @@ -1119,7 +1119,13 @@ jobs: - name: Run OpenCode id: opencode run: | - opencode run "$(cat "$GH_AW_PROMPT")" --print-logs + output=$(opencode run "$(cat "$GH_AW_PROMPT")" --print-logs 2>&1) + echo "$output" + # Check if opencode showed usage help instead of running (indicates error) + if echo "$output" | grep -q "Run OpenCode with a message"; then + echo "Error: OpenCode failed to run (showed usage help)" + exit 1 + fi env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GH_AW_AGENT_MODEL: anthropic/claude-3-5-sonnet-20241022 @@ -2378,7 +2384,13 @@ jobs: - name: Run OpenCode id: opencode run: | - opencode run "$(cat "$GH_AW_PROMPT")" --print-logs + output=$(opencode run "$(cat "$GH_AW_PROMPT")" --print-logs 2>&1) + echo "$output" + # Check if opencode showed usage help instead of running (indicates error) + if echo "$output" | grep -q "Run OpenCode with a message"; then + echo "Error: OpenCode failed to run (showed usage help)" + exit 1 + fi env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GH_AW_AGENT_MODEL: anthropic/claude-3-5-sonnet-20241022 From 32db545f1cfc6392cc2ecf03be1f0b863d884ac8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:03:42 +0000 Subject: [PATCH 4/4] Update OpenCode to version 0.15.13 with --model flag support Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/shared/opencode.md | 25 ++++++++--------------- .github/workflows/smoke-opencode.lock.yml | 24 ++++++---------------- 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/.github/workflows/shared/opencode.md b/.github/workflows/shared/opencode.md index a6905ea913..a0344570ca 100644 --- a/.github/workflows/shared/opencode.md +++ b/.github/workflows/shared/opencode.md @@ -2,7 +2,7 @@ engine: id: custom env: - GH_AW_AGENT_VERSION: "0.1.0" + GH_AW_AGENT_VERSION: "0.15.13" GH_AW_AGENT_MODEL: "anthropic/claude-3-5-sonnet-20241022" steps: - name: Install OpenCode @@ -13,13 +13,7 @@ engine: - name: Run OpenCode id: opencode run: | - output=$(opencode run "$(cat "$GH_AW_PROMPT")" --print-logs 2>&1) - echo "$output" - # Check if opencode showed usage help instead of running (indicates error) - if echo "$output" | grep -q "Run OpenCode with a message"; then - echo "Error: OpenCode failed to run (showed usage help)" - exit 1 - fi + opencode run "$(cat "$GH_AW_PROMPT")" --model "${GH_AW_AGENT_MODEL}" --print-logs env: GH_AW_AGENT_MODEL: ${{ env.GH_AW_AGENT_MODEL }} GH_AW_PROMPT: ${{ env.GH_AW_PROMPT }} @@ -50,7 +44,7 @@ imports: - shared/opencode.md engine: env: - GH_AW_AGENT_VERSION: "0.2.0" # Use a different OpenCode version + GH_AW_AGENT_VERSION: "0.15.13" # Use a different OpenCode version GH_AW_AGENT_MODEL: "openai/gpt-4" # Use a different AI model --- ``` @@ -60,17 +54,16 @@ engine: - The prompt file is read directly in the Run OpenCode step using command substitution - OpenCode is executed in non-interactive mode with logs printed to stderr - Output is captured in the agent log file -- **Network access required**: OpenCode connects to https://api.dev.opencode.ai/ **Environment Variables:** -- `GH_AW_AGENT_VERSION`: OpenCode version (default: `0.1.0`) -- `GH_AW_AGENT_MODEL`: AI model preference (for documentation only - not used by CLI) +- `GH_AW_AGENT_VERSION`: OpenCode version (default: `0.15.13`) +- `GH_AW_AGENT_MODEL`: AI model in `provider/model` format (default: `anthropic/claude-3-5-sonnet-20241022`) - `ANTHROPIC_API_KEY`: Required if using Anthropic models - `OPENAI_API_KEY`: Required if using OpenAI models -**Important Notes**: -- The opencode-ai project repository is archived and may not receive updates -- This workflow requires internet access to both install npm packages and connect to OpenCode's cloud service +**Note**: +- This workflow requires internet access to install npm packages - The opencode version can be customized by setting the `GH_AW_AGENT_VERSION` environment variable -- Model selection is configured through OpenCode's cloud service, not via CLI flags +- The AI model can be customized by setting the `GH_AW_AGENT_MODEL` environment variable +- OpenCode is provider-agnostic and supports multiple LLM providers --> diff --git a/.github/workflows/smoke-opencode.lock.yml b/.github/workflows/smoke-opencode.lock.yml index ffc56955fe..00de8be1de 100644 --- a/.github/workflows/smoke-opencode.lock.yml +++ b/.github/workflows/smoke-opencode.lock.yml @@ -1110,7 +1110,7 @@ jobs: run: npm install -g opencode-ai@${GH_AW_AGENT_VERSION} env: GH_AW_AGENT_MODEL: anthropic/claude-3-5-sonnet-20241022 - GH_AW_AGENT_VERSION: 0.1.0 + GH_AW_AGENT_VERSION: 0.15.13 GH_AW_MCP_CONFIG: /tmp/gh-aw/mcp-config/mcp-servers.json GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} @@ -1119,17 +1119,11 @@ jobs: - name: Run OpenCode id: opencode run: | - output=$(opencode run "$(cat "$GH_AW_PROMPT")" --print-logs 2>&1) - echo "$output" - # Check if opencode showed usage help instead of running (indicates error) - if echo "$output" | grep -q "Run OpenCode with a message"; then - echo "Error: OpenCode failed to run (showed usage help)" - exit 1 - fi + opencode run "$(cat "$GH_AW_PROMPT")" --model "${GH_AW_AGENT_MODEL}" --print-logs env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GH_AW_AGENT_MODEL: anthropic/claude-3-5-sonnet-20241022 - GH_AW_AGENT_VERSION: 0.1.0 + GH_AW_AGENT_VERSION: 0.15.13 GH_AW_MCP_CONFIG: /tmp/gh-aw/mcp-config/mcp-servers.json GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} @@ -2375,7 +2369,7 @@ jobs: run: npm install -g opencode-ai@${GH_AW_AGENT_VERSION} env: GH_AW_AGENT_MODEL: anthropic/claude-3-5-sonnet-20241022 - GH_AW_AGENT_VERSION: 0.1.0 + GH_AW_AGENT_VERSION: 0.15.13 GH_AW_MCP_CONFIG: /tmp/gh-aw/mcp-config/mcp-servers.json GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} @@ -2384,17 +2378,11 @@ jobs: - name: Run OpenCode id: opencode run: | - output=$(opencode run "$(cat "$GH_AW_PROMPT")" --print-logs 2>&1) - echo "$output" - # Check if opencode showed usage help instead of running (indicates error) - if echo "$output" | grep -q "Run OpenCode with a message"; then - echo "Error: OpenCode failed to run (showed usage help)" - exit 1 - fi + opencode run "$(cat "$GH_AW_PROMPT")" --model "${GH_AW_AGENT_MODEL}" --print-logs env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GH_AW_AGENT_MODEL: anthropic/claude-3-5-sonnet-20241022 - GH_AW_AGENT_VERSION: 0.1.0 + GH_AW_AGENT_VERSION: 0.15.13 GH_AW_MCP_CONFIG: /tmp/gh-aw/mcp-config/mcp-servers.json GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}