Repository navigation
Open
Labels
Description
Problem
PR github/gh-aw-firewall#2337 gates the OpenCode API proxy listener (port 10004) behind an explicit --enable-opencode CLI flag. Previously, the listener started unconditionally whenever any credential was present (OPENAI_API_KEY, ANTHROPIC_API_KEY, or COPILOT_AUTH_TOKEN).
After this change lands, OpenCode workflows compiled by gh-aw will silently lose access to port 10004 because the compiler does not currently emit --enable-opencode.
Current Behavior
BuildAWFArgs()inpkg/workflow/awf_helpers.godoes not emit--enable-opencode- The OpenCode engine routes through an existing backend port (10000–10003) via
UniversalLLMConsumerEngine, but port 10004 (OpenCode's unified dynamic-routing endpoint) will no longer start
Expected Behavior
When config.EngineName == "opencode", the compiler should:
- Add
--enable-opencodeto AWF args inBuildAWFArgs() - Add port 10004 to
--allow-host-portsso the agent container can reach the OpenCode listener - Gate behind a minimum AWF version (the firewall version that ships PR Fix commit-title-prefix being stripped by git am #2337) — skip the flag for older pinned versions
Implementation Notes
- The flag is a CLI flag to the
awfbinary (not part of the config file schema) - AWF internally maps it to
AWF_ENABLE_OPENCODE=trueenv var in the api-proxy container --enable-opencoderequires--enable-api-proxy(which gh-aw already enables via the config file'sapiProxy.enabled: true)- Port 10004 is used for OpenCode's dynamic provider routing (separate from per-engine ports 10000–10003)
- Follow the pattern used by
--difc-proxy-host(gated onawfSupportsCliProxy) or--allow-host-ports(gated onawfSupportsAllowHostPorts)
Files to Modify
pkg/workflow/awf_helpers.go— Add--enable-opencodeinBuildAWFArgs()when engine is opencodepkg/workflow/awf_helpers.go— Include port 10004 in--allow-host-portsfor opencodepkg/constants/— AddAWFEnableOpenCodeMinVersionconstantpkg/workflow/awf_helpers_test.go— Test the new flag emissionpkg/workflow/enable_api_proxy_test.go— Add OpenCode to the proxy enablement tests
Depends On
- github/gh-aw-firewall#2337 (must be merged and released first)
Reacted by Copilot and Vlad Ionescu
Activity