Skip to content

feat: adicionar workflows OpenCode com OmniRoute e remover OpenHands - #67

Merged
afonsoft merged 2 commits into
mainfrom
devin/1783793057-opencode
Jul 11, 2026
Merged

feat: adicionar workflows OpenCode com OmniRoute e remover OpenHands#67
afonsoft merged 2 commits into
mainfrom
devin/1783793057-opencode

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?

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 labeled fix-me.
  • opencode.json: project-level configuration for OpenCode with the OmniRoute provider.

Removed

  • .github/workflows/openhands-resolver.yml (no longer needed).

Configuration

  • The workflows read the OmniRoute API key from the OMNIROUTE_API_KEY GitHub secret.
  • The opencode.json uses environment variables to avoid committing secrets.

Notes

  • .agents/TOOLS.md was updated to reflect the new workflows.

/closes

Link to Devin session: https://app.devin.ai/sessions/f862be50b6ad41bfa3bb93c39e8a89a6
Requested by: @afonsoft


Open in Devin Review

Co-Authored-By: Afonso Dutra Nogueira Filho <afonsoft@gmail.com>
@afonsoft afonsoft self-assigned this Jul 11, 2026
@afonsoft
afonsoft self-requested a review July 11, 2026 18:07
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

Qodana Community for .NET

1272 new problems were found

Inspection name Severity Problems
Inconsistent Naming 🔶 Warning 537
Redundant using directive 🔶 Warning 28
Member initialized value ignored 🔶 Warning 13
Possible 'System.NullReferenceException' 🔶 Warning 9
Assignment is not used 🔶 Warning 9
Do not use object initializer for 'using' variable: Do not use object initializer for 'using' variable 🔶 Warning 8
Redundant explicit type in array creation 🔶 Warning 7
Redundant name qualifier 🔶 Warning 6
Auto-property accessor is never used: Private accessibility 🔶 Warning 5
Non-accessed field: Private accessibility 🔶 Warning 4
Possible multiple enumeration 🔶 Warning 4
Specify string culture explicitly 🔶 Warning 4
Auto-property accessor is never used: Non-private accessibility 🔶 Warning 4
Possible loss of fraction 🔶 Warning 3
Redundant cast 🔶 Warning 3
Expression is always 'true' or always 'false' 🔶 Warning 2
Redundant argument with default value 🔶 Warning 2
Conditional access qualifier expression is known to be null or not null 🔶 Warning 1
Empty general catch clause 🔶 Warning 1
Underlying type of enum is 'int' 🔶 Warning 1
Member hides static member from outer class 🔶 Warning 1
Possible 'System.InvalidOperationException' 🔶 Warning 1
Redundant explicit size specification in array creation 🔶 Warning 1
Redundant 'switch' expression arms 🔶 Warning 1
Redundant 'object.ToString()' call 🔶 Warning 1
Type member is never used: Private accessibility 🔶 Warning 1
Unused local variable 🔶 Warning 1
Type member is never used: Non-private accessibility ◽️ Notice 360
Use preferred body style: Convert into property, indexer, or event with preferred body style ◽️ Notice 38
Field can be made readonly: Private accessibility ◽️ Notice 36
Type is never used: Non-private accessibility ◽️ Notice 32
Convert into 'using' declaration ◽️ Notice 29
Member can be made private: Non-private accessibility ◽️ Notice 29
Redundant verbatim string prefix ◽️ Notice 22
Use preferred style of 'new' expression when created type is evident ◽️ Notice 10
Merge null/pattern checks into complex pattern ◽️ Notice 9
Auto-property can be made get-only: Non-private accessibility ◽️ Notice 7
Redundant string interpolation ◽️ Notice 7
Use format specifier in interpolated strings ◽️ Notice 6
Merge conditional ?: expression into conditional access ◽️ Notice 4
Class is never instantiated: Non-private accessibility ◽️ Notice 3
Use index from end expression ◽️ Notice 3
Check for reference equality instead: Check for reference equality instead ◽️ Notice 2
'if' statement can be rewritten as '?:' expression ◽️ Notice 2
Convert property into auto-property ◽️ Notice 2
For-loop can be converted into foreach-loop ◽️ Notice 2
Redundant explicit collection creation in argument of 'params' parameter ◽️ Notice 2
Auto-property can be made get-only: Private accessibility ◽️ Notice 1
Class with virtual (overridable) members never inherited: Non-private accessibility ◽️ Notice 1
Convert lambda expression into method group ◽️ Notice 1
Convert constructor into member initializers ◽️ Notice 1
Introduce optional parameters: Non-private accessibility ◽️ Notice 1
Member can be made protected: Non-private accessibility ◽️ Notice 1
Unused parameter: Non-private accessibility ◽️ Notice 1
Use string interpolation expression ◽️ Notice 1
Virtual (overridable) member is never overridden: Non-private accessibility ◽️ Notice 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2026.1.3
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 5 potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread .github/workflows/opencode.yml Outdated
Comment on lines +12 to +13
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


jobs:
opencode:
if: github.event.label.name == 'fix-me'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +4 to +7
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread .github/workflows/opencode.yml Outdated
persist-credentials: false

- name: Run OpenCode
uses: anomalyco/opencode/github@latest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +1 to +38
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@github-actions

Copy link
Copy Markdown

User devin-ai-integration[bot] does not have write permissions

github run

@github-actions

Copy link
Copy Markdown

User devin-ai-integration[bot] does not have write permissions

github run

@github-actions

Copy link
Copy Markdown

User devin-ai-integration[bot] does not have write permissions

github run

@github-actions

Copy link
Copy Markdown

User devin-ai-integration[bot] does not have write permissions

github run

@github-actions

Copy link
Copy Markdown

User devin-ai-integration[bot] does not have write permissions

github run

Co-Authored-By: Afonso Dutra Nogueira Filho <afonsoft@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

@afonsoft
afonsoft merged commit 936a287 into main Jul 11, 2026
18 of 20 checks passed
@afonsoft
afonsoft deleted the devin/1783793057-opencode branch July 12, 2026 16:40
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