Skip to content

Commit 6fdadba

Browse files
Copilotpelikhan
andcommitted
Changes before error encountered
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 39b2e25 commit 6fdadba

2 files changed

Lines changed: 23 additions & 13 deletions

File tree

pkg/workflow/concurrency.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ func GenerateJobConcurrencyConfig(workflowData *WorkflowData) string {
3737
}
3838

3939
// Build agent concurrency for max-concurrency feature
40-
// This uses ONLY engine ID and run_id slot for global limiting
40+
// This uses ONLY engine ID (or custom concurrency-group) and run_id slot for global limiting
4141
var keys []string
4242

4343
// Prepend with gh-aw- prefix
4444
keys = append(keys, "gh-aw")
4545

46-
// Add engine ID as the base key
47-
if workflowData.EngineConfig != nil && workflowData.EngineConfig.ID != "" {
46+
// Use custom concurrency-group if provided, otherwise use engine ID
47+
if workflowData.EngineConfig != nil && workflowData.EngineConfig.ConcurrencyGroup != "" {
48+
keys = append(keys, workflowData.EngineConfig.ConcurrencyGroup)
49+
} else if workflowData.EngineConfig != nil && workflowData.EngineConfig.ID != "" {
4850
keys = append(keys, workflowData.EngineConfig.ID)
4951
}
5052

pkg/workflow/engine.go

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ import (
77

88
// EngineConfig represents the parsed engine configuration
99
type EngineConfig struct {
10-
ID string
11-
Version string
12-
Model string
13-
MaxTurns string
14-
MaxConcurrency int
15-
UserAgent string
16-
Env map[string]string
17-
Steps []map[string]any
18-
ErrorPatterns []ErrorPattern
19-
Config string
10+
ID string
11+
Version string
12+
Model string
13+
MaxTurns string
14+
MaxConcurrency int
15+
ConcurrencyGroup string
16+
UserAgent string
17+
Env map[string]string
18+
Steps []map[string]any
19+
ErrorPatterns []ErrorPattern
20+
Config string
2021
}
2122

2223
// NetworkPermissions represents network access permissions
@@ -86,6 +87,13 @@ func (c *Compiler) ExtractEngineConfig(frontmatter map[string]any) (string, *Eng
8687
}
8788
}
8889

90+
// Extract optional 'concurrency-group' field
91+
if concurrencyGroup, hasConcurrencyGroup := engineObj["concurrency-group"]; hasConcurrencyGroup {
92+
if concurrencyGroupStr, ok := concurrencyGroup.(string); ok {
93+
config.ConcurrencyGroup = concurrencyGroupStr
94+
}
95+
}
96+
8997
// Extract optional 'user-agent' field
9098
if userAgent, hasUserAgent := engineObj["user-agent"]; hasUserAgent {
9199
if userAgentStr, ok := userAgent.(string); ok {

0 commit comments

Comments
 (0)