Skip to content

feat(ci): wire OpenCode build agent into GitHub via slash commands and auto PR review - #7

Open
Martins6 wants to merge 3 commits into
mainfrom
feat/opencode-github-workflow
Open

feat(ci): wire OpenCode build agent into GitHub via slash commands and auto PR review#7
Martins6 wants to merge 3 commits into
mainfrom
feat/opencode-github-workflow

Conversation

@Martins6

Copy link
Copy Markdown
Owner

Summary

Adds two GitHub Actions workflows that wire the OpenCode build agent into the repo using the official anomalyco/opencode/github action.

  • .github/workflows/opencode.yml — slash-command trigger. Mention /opencode or /oc in any issue or PR review comment to invoke the agent.
  • .github/workflows/opencode-review.yml — automatic code review on PR open, every new commit (synchronize), reopen, and when moved out of draft. Drafts are skipped.

Both pin agent: build, model minimax-coding-plan/MiniMax-M3, use the OpenCode GitHub App via OIDC (id-token: write), and read-only repo permissions.

README.md gains a "GitHub Workflow" subsection documenting app install, secret naming, slash-command usage, and auto-review behavior.

Setup before this PR can be tested

  1. Install https://github.com/apps/opencode-agent on this repository.
  2. Add the provider's API key under Settings → Secrets and variables → Actions. The workflows reference it as MINIMAX_API_KEY — confirm the exact env var name against opencode auth login output or models.dev for the minimax-coding-plan provider, and adjust both workflow files if it differs.

Commits

  • b714604 feat(ci): add OpenCode GitHub workflows for slash-command and auto PR review
  • 6b2b14b docs(features): document OpenCode GitHub workflow integration

Verification

  • python3 -c "import yaml; yaml.safe_load(...)" confirms both workflow files parse cleanly.
  • Manual end-to-end testing (slash-command + auto-review + draft skip) requires the GitHub App and secret configured above.

… review

Adds two GitHub Actions workflows that wire the OpenCode `build` agent into
the repo via the official `anomalyco/opencode/github` action:

- .github/workflows/opencode.yml: triggered when `/opencode` or `/oc` appears
  in an issue or PR review comment. Read-only permissions + OIDC id-token.
- .github/workflows/opencode-review.yml: automatically reviews every
  non-draft PR on open, on each new commit (synchronize), on reopen, and
  when moved out of draft. Same prompt re-runs on every push.

Both pin `agent: build`, model `minimax-coding-plan/MiniMax-M3`, and read
the API key from `${{ secrets.MINIMAX_API_KEY }}` (verify the env var name
against `opencode auth login` / models.dev).

README gains a "GitHub Workflow" subsection under Development covering
app install, secret naming, slash-command usage, and auto-review behavior.
Adds feat-opencode-github-workflow.md covering both workflow files, the
slash-command trigger, the auto-review on PR open / synchronize / reopen
/ ready_for_review, the draft-skip guard, the OIDC auth path, and the
MINIMAX_API_KEY secret caveat. OVERVIEW.md and LOG-FEATS.md updated to
list the new feature.
@Martins6

Copy link
Copy Markdown
Owner Author

A pull request has been opened to address this diff/issue.

This PR was opened by an agent. It will not be merged automatically — the review DAG will post its verdict as a separate comment, and merging remains a human decision.

@opencode-agent

Copy link
Copy Markdown

Model not found: minimax-coding-plan/MiniMax-M3. Did you mean: MiniMax-M3?

opencode session  |  github run

@Martins6

Copy link
Copy Markdown
Owner Author

🤖 Automated review for #7

Reviewing PR: #7

The auto-review workflow run on this branch failed with
`Model not found: minimax-coding-plan/MiniMax-M3. Did you mean: MiniMax-M3?`
even though the catalog (models.dev) lists that exact provider/model and
the env var (MINIMAX_API_KEY) was set. The catalog suggestion proved the
catalog lookup found the model, but the opencode server's runtime
provider registry didn't include it — same root cause as opencode#7958.

The GitHub runner has no local auth/config to fall back on, so the
runtime registry stays empty for any provider whose catalog merge didn't
populate. Adding a project-level opencode.json that explicitly registers
the provider/model forces it into the runtime registry regardless of
the catalog fetch.

Files:
- opencode.json: new, pins minimax-coding-plan provider and MiniMax-M3
- README.md: note about the config under "GitHub Workflow"
- docs/features/feat-opencode-github-workflow.md: mention the config
@opencode-agent

Copy link
Copy Markdown

ProviderAuthError: Anthropic API key is missing. Pass it using the 'apiKey' parameter or the ANTHROPIC_API_KEY environment variable.

opencode session  |  github run

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.

1 participant