Skip to content

Update agent workflow concurrency - #7

Merged
kenorb merged 2 commits into
masterfrom
opencode/dispatch-6a6d55-20260419150222
Apr 19, 2026
Merged

kenorb merged 2 commits into
masterfrom
opencode/dispatch-6a6d55-20260419150222

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

I've updated the concurrency configuration for the agent workflows in the current repository to match the advanced logic used in the example repository. This ensures that concurrent runs on the same branch or pull request are queued (avoiding push conflicts), while runs on the default branch can proceed in parallel as they create unique feature branches.

Changes Summary

  • Updated opencode.yml: Replaced the basic concurrency group with a more robust one that correctly identifies PR numbers from issue comments and allows parallel runs on the default branch by using github.run_id.
  • Updated cogni-ai-agent.yml: Added the same advanced concurrency configuration (prefixed with cogni-ai-agent-) which was previously missing.

New Concurrency Configuration

concurrency:
  cancel-in-progress: false
  group: >-
    [workflow-prefix]-${{
      (github.event.issue.pull_request && github.event.issue.number)
      || github.event.pull_request.number
      || (github.ref_name != github.event.repository.default_branch && github.ref)
      || github.run_id
    }}

The updated todo list:

  1. Update opencode.yml with advanced concurrency configuration
  2. Add advanced concurrency configuration to cogni-ai-agent.yml
  3. Final review of the changes (completed)

Triggered by workflow_dispatch

New%20session%20-%202026-04-19T15%3A02%3A21.658Z
opencode session  |  github run

Co-authored-by: kenorb <kenorb@users.noreply.github.com>
@sourcery-ai

sourcery-ai Bot commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Aligns workflow concurrency behavior for the opencode and cogni-ai-agent workflows so that runs on the same PR/branch are serialized while default-branch runs can execute in parallel, using a shared, more robust concurrency-group expression.

File-Level Changes

Change Details Files
Adopt advanced concurrency grouping logic for the opencode workflow to properly serialize per-PR/branch runs while allowing parallel default-branch runs.
  • Replaced the simple concurrency group expression with a multi-branch expression that prioritizes PR numbers from issue comments, then PR numbers from pull_request events, then non-default-branch refs, and finally falls back to github.run_id.
  • Annotated the concurrency block with additional comments explaining queuing behavior, default-branch parallelism, and a link to GitHub Actions concurrency docs.
.github/workflows/opencode.yml
Introduce matching advanced concurrency configuration for the cogni-ai-agent workflow with its own group prefix.
  • Added a new concurrency block that mirrors the opencode workflow’s grouping logic but uses a cogni-ai-agent-specific prefix.
  • Documented concurrency behavior in comments directly above the new block, matching the explanation used in the opencode workflow.
.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

@kenorb

kenorb commented Apr 19, 2026

Copy link
Copy Markdown
Member

/co Fix git conflicts, opencode.yml was removed from upstream.

@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:

  • In cogni-ai-agent.yml, the new concurrency block appears to be nested under on: rather than at the workflow top level (like in opencode.yml); it should be moved to align with on/jobs or the workflow will not parse correctly.
  • Consider adding a brief note in the cogni-ai-agent concurrency comment that this logic assumes the workflow is triggered only by issue/PR-related events or branches (and will fall back to github.run_id otherwise), so future trigger changes don’t accidentally break grouping assumptions.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `cogni-ai-agent.yml`, the new `concurrency` block appears to be nested under `on:` rather than at the workflow top level (like in `opencode.yml`); it should be moved to align with `on`/`jobs` or the workflow will not parse correctly.
- Consider adding a brief note in the `cogni-ai-agent` concurrency comment that this logic assumes the workflow is triggered only by issue/PR-related events or branches (and will fall back to `github.run_id` otherwise), so future trigger changes don’t accidentally break grouping assumptions.

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.

…nd updated cogni-ai-agent.yml concurrency logic.
@opencode-agent

Copy link
Copy Markdown
Contributor Author

I've resolved the git conflicts by merging the new origin/master root with --allow-unrelated-histories, removed .github/workflows/opencode.yml to align with the upstream change, and updated .github/workflows/cogni-ai-agent.yml with the improved concurrency logic and the note requested by Sourcery. All changes have passed pre-commit checks.

New%20session%20-%202026-04-19T15%3A05%3A00.570Z
opencode session  |  github run

@kenorb
kenorb merged commit cfa8637 into master Apr 19, 2026
9 checks passed
@kenorb
kenorb deleted the opencode/dispatch-6a6d55-20260419150222 branch April 19, 2026 15:10
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