feat: adicionar workflows OpenCode com OmniRoute e remover OpenHands - #67
Conversation
Co-Authored-By: Afonso Dutra Nogueira Filho <afonsoft@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Qodana Community for .NET1272 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2026.1.3
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
| contains(github.event.comment.body, '/oc') || | ||
| contains(github.event.comment.body, '/opencode') |
There was a problem hiding this comment.
🟡 Overly broad comment trigger causes the CI workflow to run on unrelated comments
The workflow trigger matches any comment containing the two-character substring /oc (contains(github.event.comment.body, '/oc') at .github/workflows/opencode.yml:12), so any comment with a URL path like /octokit, a word like /occasionally, or any other incidental occurrence of /oc will start the agent workflow.
Impact: The AI agent workflow fires on unrelated comments, consuming CI minutes and potentially making unwanted repository changes.
Substring matching in GitHub Actions contains() causes false positives
GitHub Actions' contains() function performs a simple substring search. The pattern /oc is only two meaningful characters and appears in many common strings — URLs with path segments like /octokit/rest.js, file paths, or any word starting with oc after a slash.
Additionally, since /opencode itself contains /oc, the second condition on line 13 (contains(github.event.comment.body, '/opencode')) is completely redundant — it can never match without the first condition also matching.
A safer approach would be to match the full command, e.g., github.event.comment.body == '/oc' for exact match, or use startsWith(github.event.comment.body, '/oc ') combined with github.event.comment.body == '/oc' to allow the command with or without arguments.
Prompt for agents
The if condition in .github/workflows/opencode.yml uses contains() for substring matching on '/oc', which is too broad. Any comment containing '/oc' as a substring (URLs, file paths, etc.) will trigger the workflow. The second condition checking for '/opencode' is also redundant since '/opencode' contains '/oc'. Consider using a more precise matching approach. GitHub Actions doesn't support regex in expressions, but you could use startsWith or exact equality checks. For example, you could check if the comment body starts with '/oc ' or equals '/oc' exactly, and similarly for '/opencode'. Alternatively, use a longer, more unique trigger command that's unlikely to appear in normal text.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
|
||
| jobs: | ||
| opencode: | ||
| if: github.event.label.name == 'fix-me' |
There was a problem hiding this comment.
🔍 Migration drops support for the experimental label trigger
The deleted openhands-resolver.yml supported both fix-me and fix-me-experimental labels as triggers (with different pip install paths for experimental vs stable). The new opencode-auto-fix.yml:11 only checks for fix-me. If any existing issues or automation rely on the fix-me-experimental label, they will silently stop working. This may be intentional if the experimental path is no longer needed, but worth confirming.
Was this helpful? React with 👍 or 👎 to provide feedback.
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] |
There was a problem hiding this comment.
🔍 Migration drops the pull_request_review trigger for agent invocation
The old openhands-resolver.yml triggered on pull_request_review: [submitted], allowing reviewers to invoke the agent by mentioning @openhands-agent in a review body (not just a review comment). The new opencode.yml only triggers on issue_comment and pull_request_review_comment, so submitting a review with /oc in the review summary will no longer invoke the agent. This is a subtle behavioral regression if reviewers were accustomed to triggering the agent from review submissions.
Was this helpful? React with 👍 or 👎 to provide feedback.
| persist-credentials: false | ||
|
|
||
| - name: Run OpenCode | ||
| uses: anomalyco/opencode/github@latest |
There was a problem hiding this comment.
🔍 Action pinned to mutable @latest tag risks unexpected breakage
Both opencode.yml:30 and opencode-auto-fix.yml:28 reference anomalyco/opencode/github@latest. Using a mutable tag means the action version can change without any PR review, potentially introducing breaking changes or unexpected behavior. GitHub's security hardening guide recommends pinning actions to a full-length commit SHA. This is especially important here since the action has contents: write permission.
Was this helpful? React with 👍 or 👎 to provide feedback.
| name: OpenCode Auto-Fix | ||
|
|
||
| on: | ||
| issues: | ||
| types: [labeled] | ||
| pull_request: | ||
| types: [labeled] | ||
|
|
||
| jobs: | ||
| opencode: | ||
| if: github.event.label.name == 'fix-me' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
| env: | ||
| OMNIROUTE_BASE_URL: https://omniroute.afonsoft.dev/v1 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 1 | ||
| persist-credentials: false | ||
|
|
||
| - name: Run OpenCode | ||
| uses: anomalyco/opencode/github@latest | ||
| env: | ||
| OMNIROUTE_API_KEY: ${{ secrets.OMNIROUTE_API_KEY }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| model: omniroute/auto/claude-sonnet | ||
| agent: build | ||
| use_github_token: true | ||
| prompt: | | ||
| Fix the issue or implement the feature described. | ||
| Open a pull request with the changes and provide a clear summary. |
There was a problem hiding this comment.
🔍 Migration removes workflow_call reusability
The old openhands-resolver.yml supported workflow_call with configurable inputs (max_iterations, macro, target_branch, pr_type, LLM_MODEL, etc.), allowing other workflows or repositories to reuse it. The new workflows are standalone with hardcoded values. If any external workflow was calling the old one via workflow_call, those references will break. Worth verifying no other workflow files or repositories depend on openhands-resolver.yml as a reusable workflow.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
User devin-ai-integration[bot] does not have write permissions |
|
User devin-ai-integration[bot] does not have write permissions |
|
User devin-ai-integration[bot] does not have write permissions |
|
User devin-ai-integration[bot] does not have write permissions |
|
User devin-ai-integration[bot] does not have write permissions |
Co-Authored-By: Afonso Dutra Nogueira Filho <afonsoft@gmail.com>
|



All Submissions:
Changes to Core Features:
Description
This PR replaces the OpenHands workflow with OpenCode workflows using the OmniRoute API.
Added
opencode.yml: triggers on issue comments and PR review comments (/oc,/opencode).opencode-auto-fix.yml: triggers when an issue or PR is labeledfix-me.opencode.json: project-level configuration for OpenCode with the OmniRoute provider.Removed
.github/workflows/openhands-resolver.yml(no longer needed).Configuration
OMNIROUTE_API_KEYGitHub secret.opencode.jsonuses environment variables to avoid committing secrets.Notes
.agents/TOOLS.mdwas updated to reflect the new workflows./closes
Link to Devin session: https://app.devin.ai/sessions/f862be50b6ad41bfa3bb93c39e8a89a6
Requested by: @afonsoft