Skip to content

Improve OpenCode PR review with MCP-backed inline suggestions - #7

Merged
LiusCraft merged 2 commits into
mainfrom
chore/opencode-pr-review-inline-suggestions
Mar 14, 2026
Merged

Improve OpenCode PR review with MCP-backed inline suggestions#7
LiusCraft merged 2 commits into
mainfrom
chore/opencode-pr-review-inline-suggestions

Conversation

@LiusCraft

Copy link
Copy Markdown
Owner

Background

  • The current OpenCode PR review workflow gives only generic feedback and does not consistently use inline review comments.
  • We need review behavior that is higher-signal, bug-first, and better aligned with actionable GitHub review UX.

Changes

  • Updated .github/workflows/opencode-pr-review.yml to wire GitHub MCP remote server config into OpenCode via OPENCODE_CONFIG_CONTENT.
  • Added token handling with GITHUB_MCP_TOKEN (secrets.GITHUB_MCP_PAT fallback to github.token) and enabled use_github_token: true.
  • Replaced the prompt with a stricter review protocol: AGENTS.md-aware checks, high-confidence issue filtering, required inline review flow, and suggestion-block usage guidance.

Behavior Impact

  • Automated reviews now instruct the agent to create pending reviews, add inline comments on exact diff lines, and submit the review.
  • For small self-contained fixes, comments can include GitHub suggestion blocks to make fixes one-click applicable.
  • Existing trigger events and job permissions remain unchanged.

Risks and Rollback

  • Risk: Inline review behavior depends on MCP tool availability and token scopes; limited scopes may reduce functionality.
  • Risk: Stricter prompt may reduce comment volume and omit low-confidence findings by design.
  • Rollback: Revert .github/workflows/opencode-pr-review.yml to the previous prompt/env configuration and rerun workflow.

Verification

  • Parsed workflow YAML successfully using: ruby -e 'require "yaml"; YAML.load_file(".github/workflows/opencode-pr-review.yml")'.
  • Could not run full GitHub Actions execution locally because workflow runtime and PR events are GitHub-hosted.

Notes

  • GITHUB_MCP_PAT is optional; when absent the workflow falls back to GITHUB_TOKEN.
  • Reviewer focus: confirm inline comments appear on changed lines and suggestion blocks are used only for fully-contained fixes.

@LiusCraft
LiusCraft force-pushed the chore/opencode-pr-review-inline-suggestions branch from b8bcdb2 to 02b5d70 Compare March 14, 2026 15:15
github-actions[bot]

This comment was marked as outdated.

@github-actions

Copy link
Copy Markdown

No issues found. Checked for bugs and AGENTS.md compliance.

The workflow changes are correct:

  • MCP configuration follows OpenCode schema and GitHub documentation
  • Token handling with fallback is properly implemented
  • Prompt changes are well-structured for bug-first review process

New%20session%20-%202026-03-14T15%3A16%3A10.879Z
opencode session  |  github run

@github-actions

Copy link
Copy Markdown

Based on my review, I found no issues. The changes are correct:

  1. YAML/JSON syntax: Valid - passes Ruby YAML parser and embedded JSON parser
  2. OpenCode MCP config: Valid - follows official OpenCode MCP documentation (type: "remote", correct URL format https://api.githubcopilot.com/mcp/, proper headers)
  3. GitHub MCP URL: Correct - verified against GitHub's official documentation
  4. Token handling: Correct - uses secrets.GITHUB_MCP_PAT || github.token fallback pattern
  5. Permissions: Properly configured (pull-requests: write needed for inline comments)
  6. AGENTS.md compliance: No specific rules apply to GitHub workflow files in this repo

New%20session%20-%202026-03-14T15%3A50%3A34.584Z
opencode session  |  github run

@LiusCraft
LiusCraft merged commit 0a61502 into main Mar 14, 2026
2 checks passed
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