You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opencode-action installs OpenCode through the v1 curl installer and invokes opencode github run. OpenCode v2 beta is distributed through the npm next channel, uses the opencode2 executable, and does not currently expose a compatible github run command.
The bundled /review-pr workflow does not require the full OpenCode GitHub event runner: it can execute the trusted review orchestrator and submit structured reviews through fixed helper scripts. This makes review-only mode the smallest viable scope for initial v2 support.
OpenCode v1 currently owns the GitHub App authentication lifecycle inside opencode github run. Because v2 does not provide that runner, the v2 adapter must also own the minimal authentication lifecycle needed to preserve the existing bot identity and review behavior. This authentication scope is folded from #57; v1 should continue using its existing upstream authentication path rather than duplicating it in the action.
Goal
Add opt-in OpenCode v2 support for /review-pr while retaining OpenCode v1 as the default runtime and preserving the existing GitHub App authentication and review security guarantees.
Problem
opencode-actioninstalls OpenCode through the v1 curl installer and invokesopencode github run. OpenCode v2 beta is distributed through the npmnextchannel, uses theopencode2executable, and does not currently expose a compatiblegithub runcommand.The bundled
/review-prworkflow does not require the full OpenCode GitHub event runner: it can execute the trusted review orchestrator and submit structured reviews through fixed helper scripts. This makes review-only mode the smallest viable scope for initial v2 support.OpenCode v1 currently owns the GitHub App authentication lifecycle inside
opencode github run. Because v2 does not provide that runner, the v2 adapter must also own the minimal authentication lifecycle needed to preserve the existing bot identity and review behavior. This authentication scope is folded from #57; v1 should continue using its existing upstream authentication path rather than duplicating it in the action.Goal
Add opt-in OpenCode v2 support for
/review-prwhile retaining OpenCode v1 as the default runtime and preserving the existing GitHub App authentication and review security guarantees.Dependencies
Proposed changes
Add an explicit runtime input such as:
Do not infer the runtime generation solely from
opencode-version, because v2 packages may still use 1.x package versions during development.Keep
runtime: v1as the default and leave its existingopencode github runauthentication lifecycle unchanged.Install v2 from a pinned or caller-selected
@opencode-ai/cli@nextversion and invokeopencode2.Restrict
runtime: v2-betato detected/review-prruns; fail clearly for general issue or PR-comment automation.For v2 only, add the smallest action-owned GitHub App authentication path required to replace the missing
github runbehavior:oidc-base-urlfor an OpenCode GitHub App installation token;use-github-token: trueas the explicit fallback that skips App exchange;opencode-agent[bot]as the structured-review identity unless the caller explicitly selects the fallback;Do not introduce a generalized authentication framework or move v1 authentication into action-owned code solely for symmetry.
Invoke the bundled review agent through the v2 noninteractive
runcommand.Translate the separate
modelandvariantinputs to the v2provider/model#variantsyntax without silently normalizing unsupported values.Preserve prompt expansion, explicit agent selection, timeout handling, failure annotations, and action outputs.
Reuse the existing trusted review helper boundary and identity verification rather than creating a second structured-review submission path.
Add a v1/v2 CI matrix with a credential-free CLI smoke test and mocked review/authentication helper coverage.
Document the beta support level, runtime-specific authentication ownership, and compatibility policy.
Acceptance criteria
runtime: v2-betasuccessfully startsopencode2 runfor/review-pr.opencode github run.use-github-token: trueremains an explicit fallback and does not silently alter the default App-backed identity policy.opencode-agent[bot]on the v2 path unless the caller explicitly selected the fallback.