feat: add OpenCode GitHub/GitLab integration support#5
Conversation
- Add opencode-github.md with GitHub App setup and /oc trigger docs - Add opencode-gitlab.md with GitLab CI integration docs - Add opencode-github-setup-helper.sh for auto-detection of setup status - Add workflow templates for GitHub Actions and GitLab CI - Update git.md and AGENTS.md with integration references Enables AI-powered issue/PR automation via OpenCode's native integrations.
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Setup and Configuration Documentation \.agent/AGENTS\.md, \.agent/tools/git\.md |
Updated agent and tool documentation to reference new OpenCode GitHub/GitLab integration sections with setup commands, usage examples, and links to detailed integration guides. |
OpenCode Integration Documentation \.agent/tools/git/opencode-github\.md, \.agent/tools/git/opencode-gitlab\.md |
Added comprehensive integration guides covering setup (automated/manual), workflow installation, usage examples, token/secret management, permissions, troubleshooting, security considerations, and integration with aidevops for both platforms. |
Platform Detection and Setup Script \.agent/scripts/opencode-github-setup-helper\.sh |
New Bash utility that detects Git remote type (GitHub, GitLab, Gitea, Bitbucket), inspects OpenCode integration status, validates AI provider secrets, and provides platform-specific setup workflows via check, setup, create-workflow, and help commands. |
Workflow and CI Templates configs/mcp-templates/opencode-github-workflow\.yml, configs/mcp-templates/opencode-gitlab-ci\.yml |
Added GitHub Actions workflow template triggered on issue/PR comments with /oc or /opencode guards, and GitLab CI pipeline template with multi-stage setup, dependency installation, OpenCode execution, and post-run git commit/push workflows. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~35 minutes
- Bash script logic: Platform detection, remote parsing, conditional checks for secrets and workflow files warrant careful validation
- GitHub workflow permissions and triggers: Verify correct scopes (id-token, contents, pull-requests, issues) and guard clause implementation (
/ocor/opencodetrigger) - GitLab CI template complexity: Multi-stage setup, environment variable handling, conditional execution logic, and git push behavior need review
- Documentation accuracy: Cross-references between GitHub and GitLab docs, setup instructions, and security considerations should be verified for consistency and completeness
Poem
🐰 Hop, skip, and a script so fine,
GitHub and GitLab now intertwine!
OpenCode flows through workflows bright,
AI comments dancing left and right,
Setup helpers ease the way—let's code with might! ✨
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately and concisely summarizes the main change: adding OpenCode GitHub/GitLab integration support. It directly matches the changeset's primary objective. |
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
feature/opencode-github-gitlab-integration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the OpenCode platform's capabilities by introducing native integrations for GitHub and GitLab. It allows developers to leverage AI for automated issue resolution and pull request reviews directly from their version control system's comment sections. The changes include new documentation, a setup helper script, and CI/CD templates, all designed to simplify the adoption and configuration of these powerful AI-driven workflows. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Mon Dec 22 01:19:20 UTC 2025 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Code Review
This pull request introduces OpenCode integration for GitHub and GitLab, adding documentation, helper scripts, and CI/CD templates. The changes are well-structured and comprehensive. My review focuses on improving the robustness and maintainability of the new scripts and CI/CD templates, particularly around dependency management and scripting best practices. I've suggested pinning dependency versions in CI configurations to ensure stable and reproducible builds, and made some recommendations for improving the shell script's clarity and adherence to best practices.
| - npm install --global opencode-ai | ||
| - apt-get update && apt-get install -y git | ||
| # Install glab CLI | ||
| - | | ||
| curl -sL https://github.com/profclems/glab/releases/latest/download/glab_Linux_x86_64.tar.gz | tar xz | ||
| mv glab /usr/local/bin/ |
There was a problem hiding this comment.
In the .gitlab-ci.yml example, npm install --global opencode-ai and the script to install glab both fetch the latest versions. This can cause your pipeline to break unexpectedly if a new version with breaking changes is released. It's a best practice to pin dependencies to specific versions for more stable and reproducible builds.
For example:
- npm install --global opencode-ai@1.2.3
- |
GLAB_VERSION="v1.39.1" # Or any other specific version
curl -sL "https://github.com/profclems/glab/releases/download/${GLAB_VERSION}/glab_${GLAB_VERSION#v}_Linux_x86_64.tar.gz" | tar xz
mv glab /usr/local/bin/| fetch-depth: 1 | ||
|
|
||
| - name: Run OpenCode | ||
| uses: sst/opencode/github@latest |
There was a problem hiding this comment.
Using @latest for GitHub Actions can lead to unexpected workflow failures if a new major version with breaking changes is released. It is a best practice to pin the action to a specific version (e.g., @v1) or a commit SHA to ensure workflow stability and reproducibility.
uses: sst/opencode/github@v1 # Pin to a major version for stability|
|
||
| before_script: | ||
| # Install OpenCode CLI | ||
| - npm install --global opencode-ai |
There was a problem hiding this comment.
The npm install command does not specify a version for opencode-ai. This can lead to non-reproducible builds and unexpected failures if a new version with breaking changes is released. It's a best practice in CI/CD to pin dependencies to specific versions.
- npm install --global opencode-ai@1.0.0 # Pin to a specific version| - | | ||
| GLAB_VERSION=$(curl -s https://api.github.com/repos/profclems/glab/releases/latest | grep tag_name | cut -d '"' -f 4) | ||
| curl -sL "https://github.com/profclems/glab/releases/download/${GLAB_VERSION}/glab_${GLAB_VERSION#v}_Linux_x86_64.tar.gz" | tar xz | ||
| mv glab /usr/local/bin/ |
There was a problem hiding this comment.
This script block to install glab has two issues:
- It fetches the
latestversion, which can cause pipeline instability if breaking changes are introduced. It's better to pin to a specific version. - It parses the GitHub API's JSON response using
grepandcut, which is fragile. A small change in the API output could break this script.
For a robust CI pipeline, you should use a fixed version and avoid fragile parsing.
- |
GLAB_VERSION="v1.39.1" # Pin to a specific version of glab
curl -sL "https://github.com/profclems/glab/releases/download/${GLAB_VERSION}/glab_${GLAB_VERSION#v}_Linux_x86_64.tar.gz" | tar xz
mv glab /usr/local/bin/| print_info() { | ||
| local msg="$1" | ||
| echo -e "${BLUE}[INFO]${NC} $msg" | ||
| return 0 | ||
| } |
There was a problem hiding this comment.
The explicit return 0 is redundant in this shell function. By default, a function's return status is the exit status of the last command executed. Since echo will return 0 on success, the explicit return is not needed. Removing it makes the code more idiomatic. This advice applies to print_success, print_warning, and print_error as well.
| print_info() { | |
| local msg="$1" | |
| echo -e "${BLUE}[INFO]${NC} $msg" | |
| return 0 | |
| } | |
| print_info() { | |
| local msg="$1" | |
| echo -e "${BLUE}[INFO]${NC} $msg" | |
| } |
| check_github_secrets() { | ||
| local repo_path="$1" | ||
|
|
||
| if ! command -v gh &> /dev/null; then | ||
| return 1 | ||
| fi | ||
|
|
||
| # Check if ANTHROPIC_API_KEY secret exists | ||
| local secrets | ||
| secrets=$(gh secret list 2>/dev/null) || return 1 | ||
|
|
||
| if echo "$secrets" | grep -q "ANTHROPIC_API_KEY\|OPENAI_API_KEY\|GOOGLE_API_KEY"; then | ||
| return 0 | ||
| fi | ||
| return 1 | ||
| } |
There was a problem hiding this comment.
The repo_path parameter is unused in this function, as gh secret list automatically targets the current repository. It's good practice to remove unused parameters for cleaner code. Also, using grep -E with single quotes for the pattern is slightly more robust and standard for alternations.
Don't forget to update the call to this function in check_github_status (line 247) by removing the $repo_path argument.
| check_github_secrets() { | |
| local repo_path="$1" | |
| if ! command -v gh &> /dev/null; then | |
| return 1 | |
| fi | |
| # Check if ANTHROPIC_API_KEY secret exists | |
| local secrets | |
| secrets=$(gh secret list 2>/dev/null) || return 1 | |
| if echo "$secrets" | grep -q "ANTHROPIC_API_KEY\|OPENAI_API_KEY\|GOOGLE_API_KEY"; then | |
| return 0 | |
| fi | |
| return 1 | |
| } | |
| check_github_secrets() { | |
| if ! command -v gh &> /dev/null; then | |
| return 1 | |
| fi | |
| # Check if an AI provider API key secret exists | |
| local secrets | |
| secrets=$(gh secret list 2>/dev/null) || return 1 | |
| if echo "$secrets" | grep -qE 'ANTHROPIC_API_KEY|OPENAI_API_KEY|GOOGLE_API_KEY'; then | |
| return 0 | |
| fi | |
| return 1 | |
| } |
🤖 Augment PR SummarySummary: Adds first-class documentation and templates for OpenCode’s GitHub/GitLab integrations so issues/PRs/MRs can trigger AI automation via comments. Changes:
Technical Notes: Workflows run OpenCode on your CI runners and require configuring an AI provider API key (e.g., 🤖 Was this summary useful? React with 👍 or 👎 |
| # Check if OpenCode app is installed on the repo | ||
| # This checks for any app installations on the repo | ||
| local installations | ||
| installations=$(gh api "repos/$repo_path/installation" 2>/dev/null) || { |
| jobs: | ||
| opencode: | ||
| # Only run if comment contains /oc or /opencode | ||
| if: | |
There was a problem hiding this comment.
| fetch-depth: 1 | ||
|
|
||
| - name: Run OpenCode | ||
| uses: sst/opencode/github@latest |
There was a problem hiding this comment.
| # Install glab CLI for GitLab operations | ||
| - | | ||
| GLAB_VERSION=$(curl -s https://api.github.com/repos/profclems/glab/releases/latest | grep tag_name | cut -d '"' -f 4) | ||
| curl -sL "https://github.com/profclems/glab/releases/download/${GLAB_VERSION}/glab_${GLAB_VERSION#v}_Linux_x86_64.tar.gz" | tar xz |
There was a problem hiding this comment.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.agent/tools/git/opencode-gitlab.md (1)
246-246: Minor: Fix capitalization in table.The word "github" in the table should be capitalized as "GitHub" (official product name).
🔎 Proposed fix
-| Auto-setup | `opencode github install` | Manual | +| Auto-setup | `opencode GitHub install` | Manual |configs/mcp-templates/opencode-gitlab-ci.yml (1)
39-42: Add error handling for glab CLI installation.The dynamic version fetching from GitHub API could fail due to network issues or API rate limits. Consider adding error handling or falling back to a known stable version.
🔎 Proposed enhancement
# Install glab CLI for GitLab operations - | - GLAB_VERSION=$(curl -s https://api.github.com/repos/profclems/glab/releases/latest | grep tag_name | cut -d '"' -f 4) + GLAB_VERSION=$(curl -s https://api.github.com/repos/profclems/glab/releases/latest | grep tag_name | cut -d '"' -f 4 || echo "v1.36.0") + echo "Installing glab version: $GLAB_VERSION" curl -sL "https://github.com/profclems/glab/releases/download/${GLAB_VERSION}/glab_${GLAB_VERSION#v}_Linux_x86_64.tar.gz" | tar xz mv glab /usr/local/bin/ + glab version || { echo "glab installation failed"; exit 1; }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.agent/AGENTS.md.agent/scripts/opencode-github-setup-helper.sh.agent/tools/git.md.agent/tools/git/opencode-github.md.agent/tools/git/opencode-gitlab.mdconfigs/mcp-templates/opencode-github-workflow.ymlconfigs/mcp-templates/opencode-gitlab-ci.yml
🧰 Additional context used
📓 Path-based instructions (2)
.agent/scripts/*-helper.sh
📄 CodeRabbit inference engine (AGENTS.md)
.agent/scripts/*-helper.sh: Use consistent function naming patterns in Bash scripts following [service]-helper.sh model where service names are lowercase with hyphens
Document service-specific integration using the pattern: ./.agent/scripts/[service]-helper.sh [command] [account/instance] [target] [options]
Implement standard commands for all services: help, accounts|instances, monitor|audit|status using consistent parameter handling
Files:
.agent/scripts/opencode-github-setup-helper.sh
.agent/**/*.md
📄 CodeRabbit inference engine (AGENTS.md)
.agent/**/*.md: Always include AI-CONTEXT-START and AI-CONTEXT-END comment markers in documentation files to separate condensed AI-friendly content from verbose human documentation
Use lowercase filenames with hyphens for all markdown documentation files in .agent/ directory (e.g., hostinger.md, api-integrations.md)
Files:
.agent/tools/git/opencode-github.md.agent/tools/git.md.agent/tools/git/opencode-gitlab.md.agent/AGENTS.md
🧠 Learnings (17)
📓 Common learnings
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Applies to .agent/scripts/{github,gitlab,gitea}-cli-helper.sh : Use helper scripts (github-cli-helper.sh, gitlab-cli-helper.sh, gitea-cli-helper.sh) for multi-account Git platform management with consistent CLI integration
📚 Learning: 2025-11-29T04:35:16.725Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Applies to .agent/scripts/{github,gitlab,gitea}-cli-helper.sh : Use helper scripts (github-cli-helper.sh, gitlab-cli-helper.sh, gitea-cli-helper.sh) for multi-account Git platform management with consistent CLI integration
Applied to files:
.agent/scripts/opencode-github-setup-helper.sh.agent/tools/git.md.agent/tools/git/opencode-gitlab.md.agent/AGENTS.md
📚 Learning: 2025-11-29T04:35:16.725Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Applies to .agent/scripts/quality-*.sh : Organize code quality scripts into consistent categories: quality-check.sh for validation, quality-fix.sh for automated remediation, pre-commit-hook.sh for continuous assurance
Applied to files:
.agent/scripts/opencode-github-setup-helper.sh
📚 Learning: 2025-11-29T04:35:16.725Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Applies to .agent/scripts/*-helper.sh : Document service-specific integration using the pattern: ./.agent/scripts/[service]-helper.sh [command] [account/instance] [target] [options]
Applied to files:
.agent/scripts/opencode-github-setup-helper.sh
📚 Learning: 2025-11-29T04:35:16.725Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Applies to .agent/scripts/*-helper.sh : Implement standard commands for all services: help, accounts|instances, monitor|audit|status using consistent parameter handling
Applied to files:
.agent/scripts/opencode-github-setup-helper.sh
📚 Learning: 2025-11-29T04:35:16.725Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Applies to .agent/**/*.md : Always include AI-CONTEXT-START and AI-CONTEXT-END comment markers in documentation files to separate condensed AI-friendly content from verbose human documentation
Applied to files:
.agent/tools/git/opencode-github.md.agent/tools/git/opencode-gitlab.md.agent/AGENTS.md
📚 Learning: 2025-11-29T04:34:27.147Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T04:34:27.147Z
Learning: All instructions, documentation, and operational guidance should be maintained in AGENTS.md as the single source of truth
Applied to files:
.agent/tools/git/opencode-github.md.agent/AGENTS.md
📚 Learning: 2025-11-29T04:35:16.725Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Never duplicate instructions across multiple documentation files; maintain single source of truth in ~/git/aidevops/AGENTS.md with minimal templates elsewhere
Applied to files:
.agent/tools/git/opencode-github.md.agent/AGENTS.md
📚 Learning: 2025-11-29T04:35:25.058Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:25.058Z
Learning: Reference ~/git/aidevops/AGENTS.md for all detailed AI assistant instructions and working directory specifications
Applied to files:
.agent/tools/git/opencode-github.md
📚 Learning: 2025-11-29T04:34:24.044Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-29T04:34:24.044Z
Learning: This appears to be a reference to an AGENTS.md file
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-11-29T04:34:30.730Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-11-29T04:34:30.730Z
Learning: Maintain all instructions, documentation, and operational guidance in AGENTS.md as the single source of truth
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-11-29T04:34:42.024Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENT.md:0-0
Timestamp: 2025-11-29T04:34:42.024Z
Learning: Reference AGENTS.md (authoritative) instead of AGENT.md for AI assistant guidance
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-11-29T04:34:37.574Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: .windsurfrules:0-0
Timestamp: 2025-11-29T04:34:37.574Z
Learning: Applies to **/*agent*.md : Document agent capabilities, limitations, and decision-making processes
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-11-29T04:35:16.725Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Applies to .agent/**/*.md : Use lowercase filenames with hyphens for all markdown documentation files in .agent/ directory (e.g., hostinger.md, api-integrations.md)
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-11-29T04:34:30.730Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-11-29T04:34:30.730Z
Learning: Reference AGENTS.md for authoritative AI assistant guidance instead of GEMINI.md
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-11-29T04:35:16.725Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Always reference ~/git/aidevops/AGENTS.md as the authoritative source for AI assistant instructions; never duplicate instructions in other AGENTS.md files
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-11-29T04:35:16.725Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T04:35:16.725Z
Learning: Run quality checks before every commit: SonarCloud status verification, CodeFactor validation, ShellCheck compliance on modified files
Applied to files:
.agent/AGENTS.md
🧬 Code graph analysis (1)
.agent/scripts/opencode-github-setup-helper.sh (5)
.agent/scripts/github-release-helper.sh (1)
main(180-235)setup.sh (1)
setup_git_clis(58-133).agent/scripts/quality-feedback-helper.sh (3)
cmd_codacy(169-213)main(379-444)cmd_status(56-91).agent/scripts/quality-check.sh (1)
main(251-289).agent/scripts/pre-commit-hook.sh (1)
main(145-212)
🪛 LanguageTool
.agent/tools/git/opencode-github.md
[uncategorized] ~21-~21: The official name of this software platform is spelled with a capital “H”.
Context: ...T --> ## Quick Reference - Setup: opencode github install (automated) - Trigger: `/o...
(GITHUB)
[uncategorized] ~76-~76: The official name of this software platform is spelled with a capital “H”.
Context: .... #### 2. Create Workflow File Create .github/workflows/opencode.yml: ```yaml name:...
(GITHUB)
.agent/tools/git/opencode-gitlab.md
[style] ~228-~228: Consider an alternative adverb to strengthen your wording.
Context: ...orrectly 2. Verify auth.json is created properly 3. Check pipeline logs for specific err...
(PROPERLY_THOROUGHLY)
[uncategorized] ~246-~246: The official name of this software platform is spelled with a capital “H”.
Context: ... (Files tab) | Limited | | Auto-setup | opencode github install | Manual | ## Related - **Gi...
(GITHUB)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (12)
.agent/AGENTS.md (2)
117-131: LGTM! OpenCode integration section is well-structured.The documentation clearly explains the integration workflow with practical examples and proper cross-references to detailed documentation files.
198-198: LGTM! Table entry is consistent.The tools/git table entry correctly references the new OpenCode integration documentation files.
.agent/tools/git/opencode-gitlab.md (1)
1-252: Excellent documentation structure and completeness.The documentation provides comprehensive coverage of OpenCode GitLab integration including setup, usage, configuration, security, and troubleshooting. The AI-CONTEXT section follows coding guidelines and provides a clear quick reference.
configs/mcp-templates/opencode-github-workflow.yml (2)
1-68: Well-structured GitHub Actions workflow template.The workflow correctly triggers on issue and PR comments, has appropriate permissions, and includes clear documentation for users.
44-44: Pin the OpenCode action to a commit SHA to comply with security requirements.The workflow currently uses
sst/opencode/github@latest, which violates GitHub Actions security compliance. All third-party actions must be pinned to a full-length commit SHA (never mutable tags like @latest or version tags).To fix this, replace
@latestwith the commit SHA of the OpenCode release you intend to use, along with the human-readable tag as a comment for auditability. For example:uses: sst/opencode/github@<full-commit-sha> # v<version>Verify the SHA from the OpenCode GitHub Action repository and pin accordingly.
⛔ Skipped due to learnings
Learnt from: CR Repo: marcusquinn/aidevops PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-11-29T04:35:16.743Z Learning: Applies to .github/workflows/*.yml : All GitHub Actions workflows must pin to commit SHA, never use mutable tags, to maintain security complianceconfigs/mcp-templates/opencode-gitlab-ci.yml (1)
1-114: Well-designed GitLab CI template with comprehensive setup.The template provides both full and minimal configurations, includes necessary dependencies, and handles authentication properly. The caching strategy for npm packages is a nice optimization.
.agent/scripts/opencode-github-setup-helper.sh (3)
1-50: Excellent script structure and compliance with coding guidelines.The script follows the
*-helper.shnaming pattern, uses consistent color constants, and implements clear utility functions for user feedback. The use ofset -euo pipefailand explicit return values demonstrates good Bash practices.Based on learnings: Consistent with helper script patterns for Git platform management.
174-443: Well-implemented command structure following coding guidelines.The script implements standard commands (check, setup, help) as required by coding guidelines for
*-helper.shscripts. The command routing is clear, and platform-specific logic is properly separated.Based on learnings: Implements standard commands for services (help, status/check) with consistent parameter handling.
346-377: Workflow template generation is well-implemented.The embedded template is consistent with the separate template file and includes all required permissions and triggers. The heredoc approach maintains good readability.
.agent/tools/git.md (1)
38-40: LGTM! OpenCode integration is well-integrated into git tools documentation.The additions provide clear overview information and proper cross-references to the detailed OpenCode documentation files. The structure is consistent with the existing documentation style.
Also applies to: 169-197, 206-207
.agent/tools/git/opencode-github.md (2)
1-295: Excellent comprehensive documentation for OpenCode GitHub integration.The documentation is thorough, well-organized, and covers all necessary topics including installation (automated and manual), usage examples, configuration options, permissions, troubleshooting, and security. The AI-CONTEXT section follows coding guidelines and provides an effective quick reference.
Note: The LanguageTool suggestions about "github" capitalization are false positives—these are actual command names that must be lowercase.
264-288: Strong security guidance and aidevops integration examples.The security section appropriately emphasizes that code runs on user-controlled runners, and the aidevops integration examples show how to customize OpenCode behavior to match project conventions.
- Add yaml-language-server schema reference - Move path_instructions under reviews (was at root level) - Change path_filters from object to array of strings with ! prefix - Move review_instructions to tone_instructions (correct field name) - Add TypeScript path instructions Addresses feedback from PR #1, #3, #5 about unrecognized properties
- Add file header with description, usage, commands, examples - Add docstrings to all functions explaining purpose, arguments, returns - Improves docstring coverage from 33% toward 80% threshold Addresses CodeRabbit feedback from PR #5
- Consolidate 4 separate jq calls for user profile into single pass with tab-delimited output, remove stderr suppression (Gemini #6) - Consolidate own repos loop into single jq pass, eliminating per-row jq invocations (Gemini #2) - Replace sequential N+1 gh api calls for fork parent URLs with parallel xargs -P 6 batch fetch (Gemini #1) - Add _sanitize_md() and _sanitize_url() helpers to sanitize user-controlled fields (display_name, bio, blog, twitter) before embedding in markdown, preventing markdown injection and javascript: URI attacks (Gemini #4, #5) Ref: PR #3962 review comments from gemini-code-assist
…#3963) * fix: address Gemini code review feedback on profile README generation - Consolidate 4 separate jq calls for user profile into single pass with tab-delimited output, remove stderr suppression (Gemini #6) - Consolidate own repos loop into single jq pass, eliminating per-row jq invocations (Gemini #2) - Replace sequential N+1 gh api calls for fork parent URLs with parallel xargs -P 6 batch fetch (Gemini #1) - Add _sanitize_md() and _sanitize_url() helpers to sanitize user-controlled fields (display_name, bio, blog, twitter) before embedding in markdown, preventing markdown injection and javascript: URI attacks (Gemini #4, #5) Ref: PR #3962 review comments from gemini-code-assist * fix: address second round of Gemini review feedback - Remove 2>/dev/null from xargs fork fetch (|| true suffices) - Tighten _sanitize_url to reject markdown-breaking chars in URLs using glob patterns (bash regex [^...] with escaped parens is unreliable across bash versions) - Strip tabs/newlines from jq user profile output to prevent tab-delimiter injection in bio/description fields - Sanitize repo names and descriptions in both own repos (jq gsub) and fork repos (_sanitize_md) before markdown embedding - Keep printf '%s\n' for own_repos (bash $() strips trailing newlines, so the explicit \n is needed for section spacing) Ref: PR #3963 review comments from gemini-code-assist
- Fix data corruption in cmd_archive/cmd_remove: collect all section headers into an immutable snapshot before any deletions, then delete in reverse order so earlier line offsets remain valid (fixes #1) - Fix sed error suppression: remove '|| true', capture exit status, only increment archived/removed counters on success (fixes #2) - Fix check_todo_completed: remove '|| echo 0' fallback that caused duplicate zero output; grep -c already returns 0 on no match (fixes #3) - Fix agent-deploy.sh: remove 2>/dev/null suppression on plans_cleanup invocation, log failures via print_warn instead of silencing (fixes #4) - Fix agent-deploy.sh: pass explicit PLANS_FILE/ARCHIVE_FILE/TODO_FILE env vars so plans_cleanup targets the repo dir, not cwd; use deployed copy of script from target_dir (fixes #5) - Fix setup.sh: gate standalone archive confirm_step to only run when deploy_aidevops_agents was skipped; deploy already runs cleanup internally, so running it again would be a double-run (fixes #6) - Fix PLANS.md: change 'MERGED' to 'CLOSED' for issue references in Issues summary line (fixes #7)
…5355) * chore: archive completed plans from PLANS.md and add cleanup helper All 16 plans in PLANS.md had Status: Planning but all their tasks were completed and issues closed upstream. Updated status to Completed. Added plans-cleanup-helper.sh to automate detection and archiving of completed plans. Wired into setup.sh and agent-deploy.sh so new installs get a clean PLANS.md with only active work. Commands: - check: show completion status of all plans - archive: move completed plans to PLANS-ARCHIVE.md - remove: delete completed plans entirely - status: JSON summary Fixes stale 'Planning' status for: - Restore OpenAI Codex (t1483, GH#4656) - Agent Runtime Sync (t1453, GH#4205) - gh Mutation Fix (t1434, GH#4122) - Grith Security (t1428, GH#4025) - Convos Agent (t1414, GH#3126) - URL Skill Updates (t1415, GH#3131) - Recursive Decomposition (t1408, GH#2983) - LLM Evaluation Suite (t1393-1396) - Runaway Memory Fix (t1398, GH#2854) - Prompt Injection Scanner (t1375) - Vector Search Agent (t1370) - UI/UX Inspiration (t1371-1374) - PaddleOCR (t1369) - Multi-Model Orchestration (t1364) - Mission System (t1357) - Conversational Memory (t1363) * fix: address CodeRabbit review findings on plans-cleanup PR #5355 - Fix data corruption in cmd_archive/cmd_remove: collect all section headers into an immutable snapshot before any deletions, then delete in reverse order so earlier line offsets remain valid (fixes #1) - Fix sed error suppression: remove '|| true', capture exit status, only increment archived/removed counters on success (fixes #2) - Fix check_todo_completed: remove '|| echo 0' fallback that caused duplicate zero output; grep -c already returns 0 on no match (fixes #3) - Fix agent-deploy.sh: remove 2>/dev/null suppression on plans_cleanup invocation, log failures via print_warn instead of silencing (fixes #4) - Fix agent-deploy.sh: pass explicit PLANS_FILE/ARCHIVE_FILE/TODO_FILE env vars so plans_cleanup targets the repo dir, not cwd; use deployed copy of script from target_dir (fixes #5) - Fix setup.sh: gate standalone archive confirm_step to only run when deploy_aidevops_agents was skipped; deploy already runs cleanup internally, so running it again would be a double-run (fixes #6) - Fix PLANS.md: change 'MERGED' to 'CLOSED' for issue references in Issues summary line (fixes #7) --------- Co-authored-by: Rob M <robi@MacBookPro.attlocal.net> Co-authored-by: marcusquinn <6428977+marcusquinn@users.noreply.github.com>
Address CodeRabbit review comment #5 on PR #5529: cross-process race condition between oauth-pool.mjs and oauth-pool-helper.sh. - savePool() now uses temp-file + renameSync for atomic writes, matching the pattern in the shell script's save_pool() - Add withPoolLock() wrapper that opens the same .lock file used by the shell script's fcntl.flock(), enabling future coordination when Node.js gains native flock support - Wrap all 6 read-modify-write operations (upsertAccount, savePendingToken, assignPendingToken, removeAccount, patchAccount, reset-cooldowns) with withPoolLock() - Primary defense is atomic writes (prevents corruption); advisory locking is best-effort coordination (prevents lost updates)
…concile MCP parity (#5529) * feat: add rotate and status commands to oauth-pool-helper.sh Add rotate command that switches the active account in OpenCode's auth.json by reading the pool file, identifying the current account, and writing the next available account's tokens. Also adds status command for pool rotation statistics. Reconcile MCP model-accounts-pool tool description with the shell helper by updating the oauth-pool.mjs header comment to document both interfaces and their supported commands. Closes #5528 * feat: add assign-pending command and reconcile MCP/shell parity (GH#5528) Closes #5528 - assign-pending <provider> [email]: assigns a pending unidentified token (saved when email could not be resolved during OAuth) to a named account. Without email arg, shows pending token info and available accounts. - Updated header comment and help text to include assign-pending - Updated main() dispatch to route assign-pending to cmd_assign_pending - Reconciled MCP model-accounts-pool tool description to note shell helper parity: both now support rotate, status, assign-pending, check, list, remove, add (GH#5528) * fix: resolve colon delimiter bug and add advisory locking in rotate command - Change Python output from colon-delimited to newline-delimited format to prevent parsing breakage when email addresses contain colons - Replace cut -d: parsing with sed -n line extraction in bash - Add fcntl.flock advisory lock around the read-modify-write cycle for both oauth-pool.json and auth.json to prevent concurrent write races * fix: anchor grep error patterns to end-of-line in assign-pending (GH#5528) * fix: use count_provider_accounts helper in cmd_add_cursor for consistency (GH#5529) * fix: address CodeRabbit review feedback on oauth-pool-helper (GH#5529) - Use os.replace() instead of os.rename() for atomic file writes in cmd_rotate (auth.json and pool file) for cross-platform robustness - Extract get_now_ms() helper to deduplicate Python one-liner across 4 call sites (cmd_add, cmd_add_cursor, cmd_check, cmd_status) - Fix 'available' count in cmd_status to only include active/idle accounts not on cooldown, matching cmd_rotate's candidate selection * fix: use atomic temp+os.replace writes in cmd_rotate Python block (GH#5528) * fix: use atomic temp+renameSync in savePool() in oauth-pool.mjs (GH#5528) Replace direct writeFileSync to POOL_FILE with a write-to-temp + renameSync pattern so a mid-write crash cannot corrupt the pool file. Matches the atomic write pattern already used by save_pool() in oauth-pool-helper.sh. * fix: atomic writes and lock coordination in oauth-pool.mjs (GH#5528) Address CodeRabbit review comment #5 on PR #5529: cross-process race condition between oauth-pool.mjs and oauth-pool-helper.sh. - savePool() now uses temp-file + renameSync for atomic writes, matching the pattern in the shell script's save_pool() - Add withPoolLock() wrapper that opens the same .lock file used by the shell script's fcntl.flock(), enabling future coordination when Node.js gains native flock support - Wrap all 6 read-modify-write operations (upsertAccount, savePendingToken, assignPendingToken, removeAccount, patchAccount, reset-cooldowns) with withPoolLock() - Primary defense is atomic writes (prevents corruption); advisory locking is best-effort coordination (prevents lost updates) --------- Co-authored-by: marcusquinn <6428977+marcusquinn@users.noreply.github.com>
- Correct Electron SharedArrayBuffer requirement from 28+ to 11.0+ - Mark Tauri (webview) as unconfirmed/not in upstream PGlite docs - Mark Browser extension (MV3) as unconfirmed in official docs - Add gotcha #5 noting Tauri and MV3 support is unverified upstream
* docs: tighten pglite-local-first.md from 233 to 203 lines Consolidate redundant content while preserving all institutional knowledge: - Merge 5 schema-related comparison rows into 2 (same information, less repetition) - Merge 4 performance rows into 1 with inline benchmarks - Replace server.ts code block with prose (not PGlite-specific) - Replace renderer IPC code block with prose (derivable boilerplate) - Trim extension code block imports (duplicated from earlier blocks) - Remove Runtime column from platform table (derivable from Platform) - Compress pgvector example (remove redundant PGlite import) - Add Persistence Modes table (consolidates patterns scattered across code blocks) - Merge Platform Compatibility and Gotchas sections All URLs, package names, gotchas, security notes, and cross-references preserved. Verified: zero markdownlint errors. Closes #11888 * fix: use promise-based single-flight init in extension getDb() example Addresses CodeRabbit review: concurrent calls to getDb() could race and create multiple PGlite clients before the first one finishes initializing. The promise-based pattern ensures only one initialization runs regardless of concurrent callers. * fix: address CodeRabbit review on pglite platform compatibility table - Correct Electron SharedArrayBuffer requirement from 28+ to 11.0+ - Mark Tauri (webview) as unconfirmed/not in upstream PGlite docs - Mark Browser extension (MV3) as unconfirmed in official docs - Add gotcha #5 noting Tauri and MV3 support is unverified upstream * fix: address CodeRabbit review — persistence note, Electron version, platform confidence - Extensions snippet: show persisted constructor (idb://), add note about in-memory default to prevent data-loss footgun - Platform table: correct Electron SharedArrayBuffer requirement from 28+ to 14+ (Chrome 92+ site isolation) - Mark Tauri and MV3 browser extension rows as community-reported (not in upstream PGlite docs) --------- Co-authored-by: marcusquinn <6428977+marcusquinn@users.noreply.github.com>
…ns, watchdog, timeout, stdout) Bug #1: Fix step-start vs step_start event type mismatch in output_has_activity() and watchdog grep — mismatched event names caused false negatives in activity detection during slow MCP startup. Bug #2: Use pkill -P for process tree kill in watchdog — previously only killed the subshell PID, leaving opencode and tee as orphans consuming CPU+memory. Bug #3: Add timeout wrapper to non-sandbox execution path — the non-sandbox path had no overall timeout, risking indefinite hangs if the worker produced initial activity but then stalled. Bug #4 (critical): Add --stream-stdout to sandbox-exec-helper.sh — the sandbox's store-and-replay pattern captured child stdout to a temp file, so the activity watchdog (reading tee output) saw nothing and killed every sandboxed worker at ~93s. Now child stdout flows through the pipe to tee in real-time when called from headless dispatch. Bug #5: Redirect subshell stdout/stderr to /dev/null — the backgrounded subshell inherited parent FDs, blocking Claude Code's bash tool (which waits for all FDs to close) on /runners dispatches. Closes #15180
…ns, watchdog, timeout, stdout) (#15188) Bug #1: Fix step-start vs step_start event type mismatch in output_has_activity() and watchdog grep — mismatched event names caused false negatives in activity detection during slow MCP startup. Bug #2: Use pkill -P for process tree kill in watchdog — previously only killed the subshell PID, leaving opencode and tee as orphans consuming CPU+memory. Bug #3: Add timeout wrapper to non-sandbox execution path — the non-sandbox path had no overall timeout, risking indefinite hangs if the worker produced initial activity but then stalled. Bug #4 (critical): Add --stream-stdout to sandbox-exec-helper.sh — the sandbox's store-and-replay pattern captured child stdout to a temp file, so the activity watchdog (reading tee output) saw nothing and killed every sandboxed worker at ~93s. Now child stdout flows through the pipe to tee in real-time when called from headless dispatch. Bug #5: Redirect subshell stdout/stderr to /dev/null — the backgrounded subshell inherited parent FDs, blocking Claude Code's bash tool (which waits for all FDs to close) on /runners dispatches. Closes #15180



Summary
Changes
opencode-github.md/octrigger docsopencode-gitlab.mdopencode-github-setup-helper.shopencode-github-workflow.ymlopencode-gitlab-ci.ymlUsage
Then use
/oc fix thisin any issue or PR comment.Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.