Propagate workflow timeout to Copilot SDK driver sessions#37262
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
June 6, 2026 05:47
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Copilot SDK driver runs timing out at the SDK’s default send timeout by propagating the effective workflow timeout-minutes budget into the Copilot execution step environment (GH_AW_TIMEOUT_MINUTES), enabling process_runner.cjs to derive COPILOT_SDK_SEND_TIMEOUT_MS correctly.
Changes:
- Emit
GH_AW_TIMEOUT_MINUTESin Copilot execution step env, derived from the workflow timeout (default or configured), and reuse the same normalized value for the step’stimeout-minutes. - Normalize
workflowData.TimeoutMinutesparsing to accept both prefixed (timeout-minutes: ...) and already-normalized forms before emitting env/step fields. - Extend Copilot engine tests to cover default timeout emission and expression-based timeout propagation in Copilot SDK mode.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/copilot_engine_execution.go | Derives a normalized timeout value, adds GH_AW_TIMEOUT_MINUTES to the Copilot step env, and unifies step timeout-minutes emission. |
| pkg/workflow/copilot_engine_test.go | Adds assertions (including expression coverage) that SDK mode emits GH_AW_TIMEOUT_MINUTES derived from the workflow timeout. |
| actions/setup/js/handle_agent_failure.cjs | Formatting-only change to the effective-tokens context import. |
| actions/setup/js/effective_tokens_context.cjs | Formatting-only changes to pattern array and a wrapped assignment. |
| actions/setup/js/copilot_sdk_driver.test.cjs | Formatting-only change to a test fixture argument array. |
| actions/setup/js/copilot_sdk_driver.cjs | Minor JSDoc cast formatting simplification (no behavior change). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 0
dsyme
added a commit
that referenced
this pull request
Jun 6, 2026
…ng infrastructure fields (#37299) * fix patch/bindle file paths * remove all mention of patch_path and bundle_path * recompile workflow * recompile workflow * Update wasm golden files for GH_AW_TIMEOUT_MINUTES env var PR #37262 (e76a712) added GH_AW_TIMEOUT_MINUTES to the agent step env in copilot_engine_execution.go but did not refresh the wasm golden fixtures. Regenerated via 'make update-wasm-golden'. * docs: replace Effective Tokens terminology with AI Credits (AIC) * docs: rename GH_AW_DEFAULT_MAX_EFFECTIVE_TOKENS → GH_AW_DEFAULT_MAX_AI_CREDITS * clean old stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copilot SDK driver runs were timing out at the hardcoded 600000ms default while waiting for
session.idle, even when workflowtimeout-minuteswas higher. The SDK path was not consistently receiving the workflow timeout budget needed to deriveCOPILOT_SDK_SEND_TIMEOUT_MS.Timeout propagation
GH_AW_TIMEOUT_MINUTESin the Copilot execution step env for SDK-driver runs, using the effective workflow timeout (explicit value or default).process_runner.cjsderivation path forCOPILOT_SDK_SEND_TIMEOUT_MS.Timeout value normalization
timeout-minutes: ...) before writing env.Coverage updates
${{ inputs.timeout }})