Objective
Add a compile-time warning in pkg/workflow/copilot_engine_execution.go that alerts users when they set timeout-minutes > 60 while features: copilot-requests: true is active, because github.token Copilot sessions expire after ~1 hour causing silent mid-run failures.
Context
Ref: #24920 (Problem 2)
When features: copilot-requests: true is used, the agent step's COPILOT_GITHUB_TOKEN is set to ${{ github.token }}. The Copilot API session is bound to the token at creation time and expires after ~1 hour. Any workflow with timeout-minutes > 60 is therefore likely to fail mid-run with authentication errors, with no indication at compile time.
The threat-detection job is not affected (completes in under 1 minute).
Files to Modify
pkg/workflow/copilot_engine_execution.go — after resolving useCopilotRequests, check workflowData.TimeoutMinutes; if parsed integer value > 60, emit a warning via console.FormatWarningMessage to stderr
Approach
Add logic similar to:
if useCopilotRequests && workflowData.TimeoutMinutes != "" {
timeoutVal := parseTimeoutMinutesInt(workflowData.TimeoutMinutes)
if timeoutVal > 60 {
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(
"features: copilot-requests: true with timeout-minutes > 60 may cause mid-run " +
"authentication failures: the github.token Copilot session expires after ~1 hour. " +
"Set timeout-minutes ≤ 60 or configure COPILOT_GITHUB_TOKEN as a PAT instead."))
}
}
If a helper parseTimeoutMinutesInt() does not already exist, create it in the same file or a shared utility. It should parse string timeout values (skip GitHub Actions expressions like ${{ inputs.timeout }}).
Acceptance Criteria
Generated by Plan Command for issue #24920 · ● 142.2K · ◷
Objective
Add a compile-time warning in
pkg/workflow/copilot_engine_execution.gothat alerts users when they settimeout-minutes > 60whilefeatures: copilot-requests: trueis active, becausegithub.tokenCopilot sessions expire after ~1 hour causing silent mid-run failures.Context
Ref: #24920 (Problem 2)
When
features: copilot-requests: trueis used, the agent step'sCOPILOT_GITHUB_TOKENis set to${{ github.token }}. The Copilot API session is bound to the token at creation time and expires after ~1 hour. Any workflow withtimeout-minutes > 60is therefore likely to fail mid-run with authentication errors, with no indication at compile time.The threat-detection job is not affected (completes in under 1 minute).
Files to Modify
pkg/workflow/copilot_engine_execution.go— after resolvinguseCopilotRequests, checkworkflowData.TimeoutMinutes; if parsed integer value > 60, emit a warning viaconsole.FormatWarningMessageto stderrApproach
Add logic similar to:
If a helper
parseTimeoutMinutesInt()does not already exist, create it in the same file or a shared utility. It should parse string timeout values (skip GitHub Actions expressions like${{ inputs.timeout }}).Acceptance Criteria
features: copilot-requests: trueandtimeout-minutes: 90emits a warning to stderrtimeout-minutesis absent or ≤ 60copilot-requestsfeature flag is absent/falsetimeout-minutes(e.g.${{ inputs.timeout }}) are gracefully skipped (no crash, no false warning)make agent-finishpassesRelated to Bugfix: GitHub Token S2S TTL and Actions Timeouts #24920