Fix strict mode isolation between workflows and add script to priority fields#1308
Merged
Fix strict mode isolation between workflows and add script to priority fields#1308
Conversation
- Save and restore strict mode state per workflow to prevent leakage - Add 'script' as first field in PriorityStepFields - Add test for strict mode isolation between workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add handling for strict flag in workflows
Fix strict mode isolation between workflows and add script to priority fields
Oct 7, 2025
pelikhan
approved these changes
Oct 7, 2025
Copilot AI
added a commit
that referenced
this pull request
May 4, 2026
…7 packages - Renamed ## Functions/## Types/## Core Components to ## Public API in 17 packages - Added ## Usage Examples (or renamed ## Usage) in 17 packages - Added ## Dependencies to 10 packages with internal deps - Updated ## Dependencies in cli (9 missing pkgs), parser (wrong/missing external), workflow (missing external) Closes #1308 Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0eb250f6-a1e9-4e26-a498-f96203f95352 Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
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.
Problem
When compiling multiple workflows, the
strict: trueflag in one workflow's frontmatter would affect all subsequent workflow compilations. This happened because the compiler instance is reused across multiple workflows, and settingc.strictMode = truefor one workflow would persist for all following workflows.Additionally, the
scriptfield was missing from the step field priority ordering.Example of the Issue
When compiling both workflows sequentially using
gh aw compile, workflow2 would fail strict mode validation even though it didn't havestrict: true, because the strict mode state leaked from workflow1.Solution
1. Strict Mode Isolation
Modified
ParseWorkflowFileinpkg/workflow/compiler.goto:strictModestate before processing each workflowThis ensures strict mode is isolated per-workflow and doesn't affect other compilations.
2. Script Field Priority
Added
"script"as the first field inPriorityStepFieldsinpkg/constants/constants.go, ensuring proper field ordering in generated workflow steps.Testing
Added
TestStrictModeIsolationthat validates:All existing tests continue to pass, and all 59 workflows in the repository recompile successfully.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.