Skip to content

Fix workflow triggers & prompt - #8

Merged
kenorb merged 3 commits into
masterfrom
opencode/dispatch-50b0f6-20260423133203
Apr 23, 2026
Merged

kenorb merged 3 commits into
masterfrom
opencode/dispatch-50b0f6-20260423133203

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Applied trigger fixes from EA31337/ansible-role-metatrader#38 to .github/workflows/cogni-ai-agent.yml.

Changes:

  • Added issues (opened, reopened) and pull_request (opened, reopened) event triggers.
  • Updated concurrency group logic to use github.event.issue.number directly, supporting non-PR issues.
  • Updated prompt input to include github.event.issue.body and github.event.pull_request.body, with YAML multiline wrapping to satisfy yamllint.
  • Validated changes with actionlint and yamllint.

Triggered by workflow_dispatch

New%20session%20-%202026-04-23T13%3A32%3A03.308Z
opencode session  |  github run

@sourcery-ai

sourcery-ai Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the cogni-ai-agent GitHub Actions workflow to trigger on issue and PR opens/reopens, simplify concurrency grouping for non-PR issues, and broaden the AI prompt input to include issue/PR bodies while remaining YAML- and actionlint-compliant.

File-Level Changes

Change Details Files
Extend workflow triggers to run on issue and pull request creation/reopen events in addition to comments.
  • Add issues trigger for opened and reopened events under the workflow on: block
  • Add pull_request trigger for opened and reopened events under the workflow on: block
.github/workflows/cogni-ai-agent.yml
Simplify concurrency grouping logic to support non-PR issues directly.
  • Update concurrency.group expression to use github.event.issue.number directly instead of checking issue.pull_request first
  • Preserve fallback to pull_request.number, branch ref, and run_id for other event types
.github/workflows/cogni-ai-agent.yml
Broaden the prompt input to include issue and pull request bodies with YAML-safe multiline formatting.
  • Change prompt input from a simple expression to a folded multiline YAML scalar for yamllint compatibility
  • Expand prompt expression to fall back in order: comment body, issue body, pull request body, then manual inputs.prompt
.github/workflows/cogni-ai-agent.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider whether you also want to handle edited / synchronize-type events for issues and pull requests so the agent can react to content updates instead of only on open/reopen.
  • The expanded prompt now concatenates potentially large bodies from comments, issues, and PRs; it may be worth adding explicit truncation or sanitization logic upstream to keep prompts within safe size and content bounds.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider whether you also want to handle `edited` / `synchronize`-type events for issues and pull requests so the agent can react to content updates instead of only on open/reopen.
- The expanded `prompt` now concatenates potentially large bodies from comments, issues, and PRs; it may be worth adding explicit truncation or sanitization logic upstream to keep prompts within safe size and content bounds.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@kenorb

kenorb commented Apr 23, 2026

Copy link
Copy Markdown
Member

/co Check comments from here. Check pre-commit issues.

Co-authored-by: kenorb <kenorb@users.noreply.github.com>
@opencode-agent

Copy link
Copy Markdown
Contributor Author

I have addressed the comments from PR #37 and resolved the pre-commit issues as requested.

Summary of Changes

1. Workflow Improvements (.github/workflows/cogni-ai-agent.yml)

  • Expanded Triggers: Added edited and synchronize event types to issues, pull_request, and comment triggers. This ensures the agent can react to content updates.
  • Duplicate Run Guard: Implemented an if condition at the job level (github.event_name != 'issues' || !github.event.issue.pull_request) to prevent duplicate workflow runs when a Pull Request is opened or reopened (since PRs also trigger issues events).
  • Enriched Prompt Fallback: Added a clarifying comment near the prompt expression explaining the fallback logic from comment body to issue/PR body or manual input.

2. Pre-commit Fixes

  • Resolved Dead Link: Fixed a failure in markdown-link-check by removing a dead link to copilot-instructions.md in .github/AGENTS.md.
  • Verified Checks: Successfully ran pre-commit run --all-files, and all hooks (including actionlint, yamllint, and markdown-link-check) are now passing.

The workflow is now more robust, efficient, and compliant with project standards.

New%20session%20-%202026-04-23T14%3A04%3A46.067Z
opencode session  |  github run

Comment thread .github/workflows/cogni-ai-agent.yml Outdated
@kenorb

kenorb commented Apr 23, 2026

Copy link
Copy Markdown
Member

/co check ci

Co-authored-by: kenorb <kenorb@users.noreply.github.com>
@opencode-agent

Copy link
Copy Markdown
Contributor Author

I have removed the concurrency block and its associated comments from .github/workflows/cogni-ai-agent.yml, as per the suggestions in Cogni-AI-OU/cogni-ai-agent-action#59. The action now relies on its built-in serialization logic ("Wait for concurrent runs") to handle queuing, which avoids silent cancellations of intermediate runs.

I have also verified the workflow changes using actionlint and yamllint, and both checks passed.

New%20session%20-%202026-04-23T14%3A40%3A18.076Z
opencode session  |  github run

@opencode-agent

Copy link
Copy Markdown
Contributor Author

The CI status for PR #8 is healthy. Although a transient network failure occurred earlier in the Link Checker (run 24839982517), subsequent runs for the same branch have succeeded (e.g., 24840578207). I have also manually verified the current state by running pre-commit run -a, and all checks passed, including actionlint, yamllint, and markdown-link-check.

CI Status Summary

  • Current Branch: opencode/dispatch-50b0f6-20260423133203
  • Manual Verification: All checks passed (Actionlint, Yamllint, Link Checker, etc.).
  • Recent History: Latest completed runs are green; currently queued runs are expected to pass as the codebase is clean.
  • Notable Fixes: The dead link in .github/AGENTS.md was previously resolved, and the workflow concurrency block has been removed to support better queuing.

New%20session%20-%202026-04-23T14%3A48%3A09.459Z
opencode session  |  github run

@kenorb
kenorb merged commit 64efac0 into master Apr 23, 2026
8 checks passed
@kenorb
kenorb deleted the opencode/dispatch-50b0f6-20260423133203 branch April 23, 2026 15:03
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