Add --staged flag to compile for forced staged workflows#31975
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Add --staged flag to compile
Add May 13, 2026
--staged flag to compile for forced staged workflows
Copilot created this pull request from a session on behalf of
pelikhan
May 13, 2026 16:19
View session
Collaborator
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a --staged compile flag that forces safe-output workflows to compile in staged mode.
Changes:
- Adds CLI flag parsing and threads the option through
CompileConfiginto compiler setup. - Adds compiler state/accessors for forced staged mode and applies it during safe-output config extraction.
- Adds unit, help-text, and integration coverage for the new behavior.
Show a summary per file
| File | Description |
|---|---|
cmd/gh-aw/main.go |
Defines and reads the new --staged flag for compile. |
cmd/gh-aw/main_help_text_test.go |
Verifies help text for the new flag. |
pkg/cli/compile_config.go |
Adds Staged to compile configuration. |
pkg/cli/compile_compiler_setup.go |
Applies CompileConfig.Staged to the compiler. |
pkg/cli/compile_compiler_setup_test.go |
Tests compiler setup for forced staged mode. |
pkg/cli/compile_integration_test.go |
Verifies CLI compilation forces staged safe outputs. |
pkg/workflow/compiler_types.go |
Adds compiler force-staged state and accessors. |
pkg/workflow/safe_outputs_config.go |
Overrides extracted safe-output staged config when forced. |
pkg/workflow/staged_test.go |
Adds direct compiler extraction tests for forced staged mode. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 9/9 changed files
- Comments generated: 0
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Addressed in b122a3f. |
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.
New Feature
What does this feature do?
Adds a
--stagedflag togh aw compilethat forces compiled agentic workflows into staged mode, even when the source workflow does not enable it or explicitly setsstaged: false.Why is this feature needed?
This provides a compile-time override for safe-output behavior, making it possible to generate preview-only workflows without editing workflow frontmatter.
Implementation details
CLI surface
--stagedto thecompilecommandCompileConfigfrom Cobra into the compile pipelineCompiler behavior
safe-outputsconfig, so global staged mode is enabled regardless of frontmatterCoverage
--stagedoverridessafe-outputs.staged: falseExample
With
--staged, the compiled workflow is emitted in staged mode despite the frontmatter value above.