Repository navigation
Split createMainAction into focused orchestration modules - #11599
Merged
Merged
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
lpcox
marked this pull request as ready for review
November 14, 2026 19:52
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The enclave conformance workflow omits the new main-action directory and test files, allowing changes to preflight gating and exit markers to bypass its checks.
1 open issue
What changed in this PR
Refactors AWF’s main CLI action into focused modules for #11594, retaining the createMainAction export and keeping mutable lifecycle state in the handler.
Changes:
- Extracts command assembly, runtime wiring, signal callbacks, and exit handling.
- Adds focused tests for command quoting, runtime selection, diagnostics, cleanup ordering, and exit-code propagation.
| File | Description |
|---|---|
src/commands/main-action/external-runtime-wiring.ts |
Builds workflow dependencies and registers state-aware signal callbacks. |
src/commands/main-action/external-runtime-wiring.test.ts |
Tests runtime selection, diagnostics, preflight checks, and fallback callbacks. |
src/commands/main-action/exit-handling.ts |
Centralizes exit markers, fatal cleanup, and routing exit codes. |
src/commands/main-action/exit-handling.test.ts |
Tests cleanup ordering, capture handling, and exit-code propagation. |
src/commands/main-action/agent-command.ts |
Extracts reflect validation and shell-preserving command assembly. |
src/commands/main-action/agent-command.test.ts |
Tests quoting, expansion preservation, and invalid inputs. |
src/commands/main-action.ts |
Composes the helpers while retaining lifecycle ownership. |
Review effort: Max (dynamic)
Comment on lines
+134
to
+135
| prepareEnclaves: config.enclaves?.enabled | ||
| && externalRuntimeBackend?.runtime === 'cloud-hypervisor' |
Collaborator
Author
|
@copilot address all review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
Added the nested main-action path filter and both requested Jest test paths in commit |
Contributor
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
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.

createMainActionmixes command assembly, runtime wiring, and exit handling in a security-sensitive lifecycle. This refactor reduces the handler from 505 to 234 lines while retaining its export and startup/cleanup ordering.