Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 18, 2025

Problem

The copilot engine had special concurrency handling that differed from other engines (claude, codex, custom). Specifically, it used hasDefaultConcurrency: true which applied an agent-level concurrency group pattern gh-aw-copilot to limit concurrent execution across all copilot workflows globally.

This special behavior was inconsistent with the design principle that all engines should use the same concurrency formulas.

Solution

Removed the hasDefaultConcurrency feature entirely and implemented a new default concurrency pattern for workflows without special triggers:

  • Removed hasDefaultConcurrency field from BaseEngine struct
  • Removed HasDefaultConcurrency() method from CodingAgentEngine interface and BaseEngine implementation
  • Removed the field from all engine constructors (copilot, claude, codex, custom)
  • Implemented default concurrency pattern gh-aw-${engine-id}-${{ github.workflow }} for workflows with generic triggers (workflow_dispatch, schedule, workflow_run, etc.)
  • Workflows with special triggers (issues, PRs, discussions, push) do NOT get default concurrency at agent level
  • Custom concurrency configuration via engine.concurrency field continues to work as before

Changes

Code:

  • pkg/workflow/agentic_engine.go: Removed hasDefaultConcurrency field and HasDefaultConcurrency() method
  • pkg/workflow/copilot_engine.go: Removed hasDefaultConcurrency field from engine initialization
  • pkg/workflow/claude_engine.go: Removed hasDefaultConcurrency field from engine initialization
  • pkg/workflow/codex_engine.go: Removed hasDefaultConcurrency field from engine initialization
  • pkg/workflow/custom_engine.go: Removed hasDefaultConcurrency field from engine initialization
  • pkg/workflow/concurrency.go:
    • Updated GenerateJobConcurrencyConfig to implement default concurrency for non-special-case workflows
    • Added hasSpecialTriggers helper function to detect workflows with special trigger handling
  • pkg/workflow/concurrency_test.go: Updated unit tests to reflect new behavior
  • pkg/workflow/engine_concurrency_integration_test.go: Updated integration tests with cases for both special and non-special triggers

Generated workflows:

  • Recompiled 23 .lock.yml files with default concurrency pattern for workflows using generic triggers

Behavior Change

Workflows with special triggers (issues, PRs, discussions, push):

agent:
  # No default concurrency - uses workflow-level formula instead

Workflows with generic triggers (workflow_dispatch, schedule, etc.):

agent:
  concurrency:
    group: "gh-aw-copilot-${{ github.workflow }}"

Custom concurrency (always takes precedence):

engine:
  id: copilot
  concurrency: "custom-group-${{ github.ref }}"

Testing

  • ✅ All unit tests pass
  • ✅ All integration tests pass
  • ✅ Manual verification confirms correct behavior for both special and non-special trigger workflows
  • ✅ Custom concurrency configuration still works correctly
  • ✅ Build and linting successful
Original prompt

Remove special handling of concurrency group for the copilot agentic engine. Use the same formulas as the other engine.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Changed hasDefaultConcurrency from true to false in copilot_engine.go
- Updated tests to reflect that copilot now uses same formula as other engines
- Recompiled all workflow files to remove agent-level concurrency for copilot workflows
- All tests pass successfully

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove special handling of concurrency group for agentic engine Remove special concurrency handling for copilot engine Oct 18, 2025
Copilot AI requested a review from pelikhan October 18, 2025 00:48
@pelikhan
Copy link
Contributor

@copilot remove hasDefaultConcurrency it should not be used anymore.

@pelikhan
Copy link
Contributor

@copilot the default concurrency group should by gh-aw-${enginer id}-${{ github.workflow }} if nothing is specified and none of the special cases are selected (for workflow_dispatch for example)

Removed hasDefaultConcurrency completely as it's no longer needed:
- Removed hasDefaultConcurrency field from BaseEngine struct
- Removed HasDefaultConcurrency() method from CodingAgentEngine interface
- Removed HasDefaultConcurrency() implementation from BaseEngine
- Removed field from all engine constructors (copilot, claude, codex, custom)
- Simplified GenerateJobConcurrencyConfig to only check explicit config
- All tests pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 18, 2025

@copilot remove hasDefaultConcurrency it should not be used anymore.

Done! Removed hasDefaultConcurrency completely - the field, method, and all related logic. Commit: a4afcf7

@copilot remove hasDefaultConcurrency it should not be used anymore.

Done! Removed hasDefaultConcurrency completely - the field, method, and all related logic. Commit: 1529baf

Copilot AI changed the title Remove special concurrency handling for copilot engine Remove hasDefaultConcurrency from all engines Oct 18, 2025
Implemented default concurrency group pattern: gh-aw-${engine-id}-${{ github.workflow }}
- Applied to workflows with generic triggers (workflow_dispatch, schedule, etc.)
- NOT applied to workflows with special triggers (issues, PRs, discussions, push)
- Custom concurrency configuration still takes precedence
- Updated tests to reflect new behavior
- All tests pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 18, 2025

@copilot the default concurrency group should by gh-aw-${enginer id}-${{ github.workflow }} if nothing is specified and none of the special cases are selected (for workflow_dispatch for example)

Implemented! Default concurrency now uses pattern gh-aw-${engine-id}-${{ github.workflow }} for workflows without special triggers (workflow_dispatch, schedule, etc.). Workflows with special triggers (issues, PRs, discussions, push) don't get default concurrency. Commit: 91e7f5b

@copilot the default concurrency group should by gh-aw-${enginer id}-${{ github.workflow }} if nothing is specified and none of the special cases are selected (for workflow_dispatch for example)

Implemented! Default concurrency now uses pattern gh-aw-${engine-id}-${{ github.workflow }} for workflows without special triggers (workflow_dispatch, schedule, etc.). Workflows with special triggers (issues, PRs, discussions, push) don't get default concurrency. Commit: e17775e

Copilot AI changed the title Remove hasDefaultConcurrency from all engines Add default concurrency pattern for non-special-case workflows Oct 18, 2025
@pelikhan pelikhan marked this pull request as ready for review October 18, 2025 01:18
@github-actions
Copy link
Contributor

Agentic Changeset Generator triggered by this pull request.

@pelikhan pelikhan merged commit edb5a09 into main Oct 18, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/remove-concurrency-group-handling branch October 18, 2025 01:22
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.

2 participants