Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/shared/opencode.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ engine:
- name: Run OpenCode
id: opencode
run: |
opencode run "$(cat "$GH_AW_PROMPT")" --model "${GH_AW_AGENT_MODEL}" --print-logs
opencode run "$(cat "$GH_AW_PROMPT")" --model "${GH_AW_AGENT_MODEL}" --print-logs --log-level DEBUG --format json
env:
GH_AW_AGENT_MODEL: ${{ env.GH_AW_AGENT_MODEL }}
GH_AW_PROMPT: ${{ env.GH_AW_PROMPT }}
Expand Down Expand Up @@ -126,7 +126,10 @@ OpenCode automatically integrates with MCP servers configured in your workflow:
- The workflow will install opencode-ai npm package using version from `GH_AW_AGENT_VERSION` env var
- `jq` is installed for JSON transformation between MCP config formats
- 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
- OpenCode is executed with enhanced logging:
- `--print-logs`: All logs printed to stderr for real-time visibility
- `--log-level DEBUG`: Maximum log verbosity for troubleshooting
- `--format json`: Structured JSON output for programmatic parsing
- Output is captured in the agent log file

**Environment Variables:**
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/smoke-opencode.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/cli/completions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func TestCompleteEngineNames(t *testing.T) {
{
name: "empty prefix returns all engines",
toComplete: "",
wantLen: 4, // copilot, claude, codex, custom
wantLen: 5, // copilot, claude, codex, custom, opencode
},
{
name: "c prefix returns claude, codex, copilot, custom",
Expand Down
2 changes: 1 addition & 1 deletion pkg/constants/constants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func TestVersionConstants(t *testing.T) {
{"DefaultClaudeCodeVersion", DefaultClaudeCodeVersion, "2.1.6"},
{"DefaultCopilotVersion", DefaultCopilotVersion, "0.0.381"},
{"DefaultCodexVersion", DefaultCodexVersion, "0.80.0"},
{"DefaultOpenCodeVersion", DefaultOpenCodeVersion, "0.15.12"},
{"DefaultOpenCodeVersion", DefaultOpenCodeVersion, "0.15.13"},
{"DefaultGitHubMCPServerVersion", DefaultGitHubMCPServerVersion, "v0.28.1"},
{"DefaultMCPGatewayVersion", DefaultMCPGatewayVersion, "v0.0.56"},
{"DefaultSandboxRuntimeVersion", DefaultSandboxRuntimeVersion, "0.0.26"},
Expand Down
6 changes: 6 additions & 0 deletions pkg/workflow/opencode_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ func (e *OpenCodeEngine) GetExecutionSteps(workflowData *WorkflowData, logFile s
// Add print-logs flag for enhanced debugging output
opencodeArgs = append(opencodeArgs, "--print-logs")

// Add log-level DEBUG for maximum log verbosity
opencodeArgs = append(opencodeArgs, "--log-level", "DEBUG")

// Add format json for structured JSON output
opencodeArgs = append(opencodeArgs, "--format", "json")

// Add custom args from engine configuration before the prompt
if workflowData.EngineConfig != nil && len(workflowData.EngineConfig.Args) > 0 {
opencodeArgs = append(opencodeArgs, workflowData.EngineConfig.Args...)
Expand Down