Skip to content

Comments

Fix missing OpenCode engine case in aw_info model environment variable generation#10099

Merged
pelikhan merged 2 commits intocopilot/add-opencode-agentic-supportfrom
copilot/lint-js-code
Jan 15, 2026
Merged

Fix missing OpenCode engine case in aw_info model environment variable generation#10099
pelikhan merged 2 commits intocopilot/add-opencode-agentic-supportfrom
copilot/lint-js-code

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

The compiler was generating invalid JavaScript syntax process.env. || "" for OpenCode engine workflows, causing SyntaxError: Unexpected token '||' in CI.

The switch statement in compiler_yaml.go that maps engine IDs to model environment variables was missing the opencode case, leaving modelEnvVar empty.

Changes:

  • Added opencode case to switch statement, setting modelEnvVar = constants.EnvVarModelAgentOpenCode
  • Recompiled affected workflows (dev.lock.yml, smoke-opencode.lock.yml)

Before:

switch engineID {
case "copilot":
    modelEnvVar = constants.EnvVarModelAgentCopilot
case "claude":
    modelEnvVar = constants.EnvVarModelAgentClaude
case "codex":
    modelEnvVar = constants.EnvVarModelAgentCodex
}
// modelEnvVar is empty for "opencode"

After:

switch engineID {
case "copilot":
    modelEnvVar = constants.EnvVarModelAgentCopilot
case "claude":
    modelEnvVar = constants.EnvVarModelAgentClaude
case "codex":
    modelEnvVar = constants.EnvVarModelAgentCodex
case "opencode":
    modelEnvVar = constants.EnvVarModelAgentOpenCode
}

Generated JavaScript:

// Before: process.env. || ""  ❌
// After:  process.env.GH_AW_MODEL_AGENT_OPENCODE || ""  ✅
Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/21036597930/job/60486139352#step:15:1

Lint js


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Add missing "opencode" case to model environment variable switch statement in compiler_yaml.go. This fixes the CI error "SyntaxError: Unexpected token '||'" caused by generating invalid JavaScript "process.env. || ''" when modelEnvVar was empty for OpenCode engine workflows.

The fix follows the existing pattern for copilot, claude, and codex engines by setting modelEnvVar = constants.EnvVarModelAgentOpenCode for the opencode case.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add linter for JavaScript code Fix missing OpenCode engine case in aw_info model environment variable generation Jan 15, 2026
Copilot AI requested a review from pelikhan January 15, 2026 16:04
@pelikhan pelikhan marked this pull request as ready for review January 15, 2026 16:06
@pelikhan pelikhan merged commit 4916405 into copilot/add-opencode-agentic-support Jan 15, 2026
@pelikhan pelikhan deleted the copilot/lint-js-code branch January 15, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants