You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recent commit 06ae01f8e10698a239a930f7ff69df3592ec9d72 extracted awfVersionAtLeast to remove repeated AWF version checks. The same feature-gate pattern still appears across production workflow helpers for AWF, Copilot, and MCP Gateway support checks. Each helper resolves an effective version, treats latest as supported, and compares the value against a minimum semver threshold.
This is now a cross-helper duplication pattern rather than AWF-local duplication. A small shared helper would keep future feature gates consistent and avoid subtle drift in latest, default-version, and non-semver behavior.
funccopilotSupportsNoAskUser(engineConfig*EngineConfig) bool {
varversionStrstringifengineConfig!=nil&&engineConfig.Version!="" {
versionStr=engineConfig.Version
} else {
// No override -> use the default, which is always >= the minimum.returntrue
}
// "latest" means the newest release - always supports the flag.ifstrings.EqualFold(versionStr, "latest") {
returntrue
}
minVersion:=string(constants.CopilotNoAskUserMinVersion)
returnsemverutil.Compare(versionStr, minVersion) >=0
}
funcmcpgSupportsIntegrityReactions(gatewayConfig*MCPGatewayRuntimeConfig) bool {
varversionstringifgatewayConfig!=nil&&gatewayConfig.Version!="" {
version=gatewayConfig.Version
} else {
// No override -> use the default version for comparison.version=string(constants.DefaultMCPGatewayVersion)
}
// "latest" means the newest release - always supports the field.ifstrings.EqualFold(version, "latest") {
returntrue
}
minVersion:=string(constants.MCPGIntegrityReactionsMinVersion)
returnsemverutil.Compare(version, minVersion) >=0
}
Impact Analysis
Maintainability: Every new version-gated feature may copy and slightly alter the same latest plus semver comparison logic.
Bug Risk: Default-version behavior already differs by helper: AWF and MCPG compare defaults, while Copilot returns true for default because the pinned default is known to satisfy the minimum. Future changes could make these semantics drift.
Code Bloat: The duplicated bodies are each small, but together they exceed the duplicate-code threshold and are likely to grow as more feature gates are added.
Refactoring Recommendations
Extract a shared version threshold helper
Suggested location: pkg/workflow/version_gate.go or another workflow-local helper file.
Possible shape: versionAtLeast(version, defaultVersion, minVersion string) bool, where callers resolve domain-specific defaults before calling, or pass an explicit default version.
Estimated effort: Low.
Keep domain-specific wrapper functions
Preserve awfSupports..., copilotSupportsNoAskUser, and mcpgSupportsIntegrityReactions as readable call sites.
Have each wrapper handle only config extraction and call the shared threshold helper.
The following domains were blocked by the firewall during workflow execution:
api.github.com
github.com
💡 Tip:api.github.com is blocked because GitHub API access uses the built-in GitHub tools by default. Instead of adding api.github.com to network.allowed, use tools.github.mode: gh-proxy for direct pre-authenticated GitHub CLI access without requiring network access to api.github.com:
tools:
github:
mode: gh-proxy
See GitHub Tools for more information on gh-proxy mode.
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
Summary
Recent commit
06ae01f8e10698a239a930f7ff69df3592ec9d72extractedawfVersionAtLeastto remove repeated AWF version checks. The same feature-gate pattern still appears across production workflow helpers for AWF, Copilot, and MCP Gateway support checks. Each helper resolves an effective version, treatslatestas supported, and compares the value against a minimum semver threshold.This is now a cross-helper duplication pattern rather than AWF-local duplication. A small shared helper would keep future feature gates consistent and avoid subtle drift in
latest, default-version, and non-semver behavior.Duplication Details
pkg/workflow/awf_helpers.golines 646-656:awfVersionAtLeastpkg/workflow/copilot_engine_execution.golines 544-560:copilotSupportsNoAskUserpkg/workflow/mcp_github_config.golines 390-406:mcpgSupportsIntegrityReactionsCode Samples
Impact Analysis
latestplus semver comparison logic.truefor default because the pinned default is known to satisfy the minimum. Future changes could make these semantics drift.Refactoring Recommendations
Extract a shared version threshold helper
pkg/workflow/version_gate.goor another workflow-local helper file.versionAtLeast(version, defaultVersion, minVersion string) bool, where callers resolve domain-specific defaults before calling, or pass an explicit default version.Keep domain-specific wrapper functions
awfSupports...,copilotSupportsNoAskUser, andmcpgSupportsIntegrityReactionsas readable call sites.Add focused table tests for shared behavior
latest, and non-semver branch names.Implementation Checklist
make agent-finishbefore opening the remediation PRAnalysis Metadata
pkg/workflowproduction Go code06ae01f8e10698a239a930f7ff69df3592ec9d72Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
api.github.comgithub.com💡 Tip:
api.github.comis blocked because GitHub API access uses the built-in GitHub tools by default. Instead of addingapi.github.comtonetwork.allowed, usetools.github.mode: gh-proxyfor direct pre-authenticated GitHub CLI access without requiring network access toapi.github.com:See GitHub Tools for more information on
gh-proxymode.To allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.