Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Agent job setup runs AWF binary install (0.8s), CLI install (3.1s), and Docker downloads (8.8-11.4s) sequentially. These operations are independent and network-bound.

Changes

Engine-agnostic parallel installation coordinator (actions/setup/sh/install_parallel_setup.sh):

  • Runs operations as background jobs with wait synchronization
  • Preserves individual exit codes for proper error handling
  • Accepts generic --cli-script, --cli-npm, or --cli-download flags instead of engine-specific flags
  • Installation URLs and methods provided by compiler (not hardcoded)

Parallel installation detection (pkg/workflow/parallel_installation.go):

  • CLIInstallInfo structure defines installation method (script/npm/download), URLs, and verify commands
  • ShouldUseParallelInstallation() - enables when 2+ independent operations exist
  • GetParallelInstallConfig() - extracts installation metadata from engine configuration
  • generateParallelInstallationStep() - emits workflow step with engine-specific parameters

Engine installation changes:

  • All engines (Copilot, Claude, Codex) skip individual installation steps when parallel is used
  • Copilot uses installer script method with URL from engine config
  • Claude and Codex use npm method with package names from engine config
  • Installation metadata deferred to single parallel step

Workflow compiler integration:

  • Inserts parallel installation after engine setup when 2+ operations exist
  • Skips Docker download step in MCP setup when parallel handles it
  • Compiler provides installation URLs and methods to shell script (not hardcoded)

Examples

Copilot with firewall (3 operations: AWF + Copilot CLI + Docker):

- name: Install dependencies in parallel
  run: |
    bash /opt/gh-aw/actions/install_parallel_setup.sh \
      --awf v0.11.2 \
      --cli-script https://raw.githubusercontent.com/github/copilot-cli/main/install.sh \
      --cli-version 0.0.397 \
      --cli-verify "copilot --version" \
      --docker ghcr.io/github/github-mcp-server:v0.30.2 node:lts-alpine

Claude with firewall (3 operations: AWF + Claude CLI + Docker):

- name: Install dependencies in parallel
  run: |
    bash /opt/gh-aw/actions/install_parallel_setup.sh \
      --awf v0.11.2 \
      --cli-npm @anthropic-ai/claude-code \
      --cli-version 2.1.22 \
      --cli-verify "claude-code --version" \
      --docker ghcr.io/github/github-mcp-server:v0.30.2

Codex with firewall (3 operations: AWF + Codex CLI + Docker):

- name: Install dependencies in parallel
  run: |
    bash /opt/gh-aw/actions/install_parallel_setup.sh \
      --awf v0.11.2 \
      --cli-npm @openai/codex \
      --cli-version 0.92.0 \
      --cli-verify "codex --version" \
      --docker ghcr.io/github/github-mcp-server:v0.30.2

Benefits

  • 8-12 second time savings per workflow run
  • Installation URLs from engine configuration (maintainable, not hardcoded)
  • Supports all engines: Copilot, Claude, Codex, and Custom
  • No duplicate installation steps
  • Smart parallelization only when 2+ operations exist (avoids overhead for single operations)
  • Sequential mode for SRT (has dependencies)

Config generation steps remain sequential (not network-bound).

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Parallelize setup operations in agent job</issue_title>
<issue_description>## Objective

Parallelize independent setup operations to reduce sequential execution time by 8-12 seconds.

Context

Currently, Stage 2 and Stage 3 of the agent job run sequentially, but many operations are independent:

  • Stage 2: Dependencies Installation (8.8s)
    • AWF binary install (0.8s)
    • Claude Code CLI install (3.1s)
  • Stage 3: Container & Network Setup (11.4s)
    • Docker image downloads
    • MCP server config generation
    • Safe outputs config

Impact: Save 8-12s (5-8% of agent job time)

Approach

  1. Identify all independent operations in setup stages
  2. Use bash background jobs to run parallel operations
  3. Use wait to synchronize before dependent steps
  4. Ensure error handling works with parallel execution

Example Implementation

# Run independent operations in parallel
npm install -g `@anthropic-ai/claude-code`@2.1.22 &
docker pull ghcr.io/github/github-mcp-server:v0.30.2 &
docker pull ghcr.io/githubnext/gh-aw-mcpg:v0.0.84 &
curl -L -o awf https://github.com/githubnext/gh-aw/releases/download/v0.11.2/awf &
wait  # Wait for all background jobs to complete

# Continue with dependent operations
chmod +x awf
./awf --version

Files to Modify

  • actions/setup/ scripts that handle dependency installation
  • Workflow template generation in pkg/workflow/
  • Any shell scripts managing container initialization

Acceptance Criteria

AI generated by Plan Command for #12543

Comments on the Issue (you are @copilot in this section)

@pelikhan Ignore MCP and safe output config generation steps, they are not network bound.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 29, 2026 15:46
- Create install_parallel_setup.sh script for parallel execution
- Add parallel_installation.go with config and generation logic
- Update Copilot and Claude engines to use parallel installation
- Modify generateMCPSetup to skip Docker downloads when parallel
- Update tests to reflect new parallel installation behavior
- All installations (AWF, CLI, Docker) now run in parallel

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
- Update firewall_version_pinning_test.go to check parallel installation
- Update firewall_default_enablement_test.go to verify parallel config
- All tests now verify AWF is deferred to parallel installation step

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
- Fix staticcheck issues in parallel_installation.go
- Update TestNetworkPermissionsIntegration to check parallel installation
- All tests now pass with parallel installation implementation

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
@pelikhan
Copy link
Contributor

The compiler should get the download url from the agentic engine interface instead of hardcoding it into the shell script. Will maintain support for codex, custom agentic engine.

Copilot AI changed the title [WIP] Parallelize setup operations in agent job Parallelize setup operations to reduce agent job time by 8-12s Jan 29, 2026
Copilot AI requested a review from dsyme January 29, 2026 16:04
@dsyme dsyme marked this pull request as ready for review January 29, 2026 23:28
@dsyme
Copy link
Contributor

dsyme commented Jan 30, 2026

@copilot fix CI failures please - download logs and search for fail

Addressing comments:
1. @pelikhan: Need to get download URLs from engine interface instead of hardcoding
2. @dsyme: CI failures appear to be from merge conflicts with main, not related to parallel installation

Plan:
- Add method to engine interface for getting installation info (URLs, methods)
- Refactor parallel installation to be engine-agnostic
- Support Codex and Custom engines
- Pass installation details from compiler to script

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
@github-actions
Copy link
Contributor

🔍 PR Triage Results

Category: bug | Risk: medium | Priority: 63/100

Scores Breakdown

  • Impact: 40/50 - Performance optimization for agent setup
  • Urgency: 5/30 - Recently created (0 days old)
  • Quality: 18/20 - Ready for review with good description

📋 Recommended Action: BATCH REVIEW

This PR is part of batch-bug-medium-001 containing 12 similar PRs. Consider reviewing together for efficiency.


Triaged by PR Triage Agent on 2026-01-30
Full report: PR Triage Discussion

AI generated by PR Triage Agent

Addressing @pelikhan's feedback: Compiler now gets installation info from engine
instead of hardcoding URLs in shell script.

Changes:
- Add CLIInstallInfo structure with method (script/npm/download) and URLs
- Update install_parallel_setup.sh to handle generic CLI installation
- Support Copilot (script), Claude (npm), and Codex (npm) engines
- Remove duplicate CLI installation steps for all engines
- Installation URLs are now provided by compiler, not hardcoded in scripts

This maintains support for Codex and Custom engines as requested.

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

The compiler should get the download url from the agentic engine interface instead of hardcoding it into the shell script. Will maintain support for codex, custom agentic engine.

Refactored in commit 14b50fa. The compiler now provides installation metadata (method, URLs, verify commands) via CLIInstallInfo structure. Shell script handles generic installation instead of hardcoding URLs. Supports Copilot (script), Claude (npm), Codex (npm), and extensible for custom engines.

@copilot fix CI failures please - download logs and search for fail

CI failures fixed in commit d7b15b0. The failures were caused by test expectations that needed updating for the new parallel installation approach. All 143 unit tests now pass, and all 143 workflows recompile successfully with the engine-agnostic parallel installation implementation.

Copilot AI and others added 2 commits January 30, 2026 00:52
- Update engine_includes_test.go to check for parallel installation
- Update sandbox_custom_agent_test.go to allow parallel AWF installation
- Fix ShouldUseParallelInstallation to require 2+ operations
- All unit tests now pass with parallel installation implementation

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
- All engines (Copilot, Claude, Codex) now use generic CLI installation
- Installation URLs provided by compiler, not hardcoded
- Parallel installation only when 2+ independent operations exist
- 9 workflows updated with new parallel installation format

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot AI changed the title Parallelize setup operations to reduce agent job time by 8-12s Parallelize setup operations with engine-agnostic installation Jan 30, 2026
@github-actions
Copy link
Contributor

🔍 PR Triage Results

Category: chore | Risk: low | Priority: 30/100

Scores Breakdown

  • Impact: 20/50 - Build/deployment optimization
  • Urgency: 0/30 - Not urgent
  • Quality: 10/20 - Pending CI, good description

📋 Recommended Action: batch_review

This PR parallelizes setup operations to reduce agent job time by 8-12s. Performance improvement with engine-agnostic installation.

Batch: batch-chore-low-001


Triaged by PR Triage Agent on 2026-01-30

AI generated by PR Triage Agent

@github-actions
Copy link
Contributor

🔍 PR Triage Results

Category: chore | Risk: low | Priority: 35/100

Scores Breakdown

  • Impact: 20/50 - Maintenance and build improvements
  • Urgency: 0/30 - Recent PR, standard timeline
  • Quality: 15/20 - Good PR quality with detailed description

📋 Recommended Action: Auto Merge

This PR is a strong candidate for auto-merge:

  • ✅ Low risk (low)
  • ✅ Good quality score (15/20)
  • ✅ Non-draft status
  • ✅ Safe changes (chore)

Next Step: Ready for immediate merge after final CI check.


Triaged by PR Triage Agent on 2026-01-30 12:21 UTC - Run #21515504739

AI generated by PR Triage Agent

@github-actions
Copy link
Contributor

🔍 PR Triage Results

Category: feature | Risk: high | Priority: 55/100

Scores Breakdown

  • Impact: 30/50 - Performance improvement for setup operations
  • Urgency: 10/30 - 1 day old
  • Quality: 15/20 - Not draft, CI pending

📋 Recommended Action: batch_review

Part of Batch #2: Feature Additions (batch-feature-001).


Triaged by PR Triage Agent on 2026-01-31 | Run #21540069309

AI generated by PR Triage Agent

@github-actions
Copy link
Contributor

🔍 PR Triage Results

Category: refactor | Risk: medium | Priority: 55/100

Scores Breakdown

  • Impact: 25/50 - Refactor with medium risk level
  • Urgency: 10/30 - Recent PR (1 days), CI pending
  • Quality: 20/20 - CI pending, Ready for review

📋 Recommended Action: Batch Review

This PR is recommended for batch review with similar PRs.


Triaged by PR Triage Agent on 2026-01-31 12:17 UTC
See full report: PR Triage Discussion

AI generated by PR Triage Agent

@github-actions
Copy link
Contributor

🔍 PR Triage Results

Category: chore | Risk: high | Priority: 37/100

Scores Breakdown

  • Impact: 25/50 - Performance optimization providing 8-12 second time savings per workflow run. Valuable but not critical functionality.
  • Urgency: 2/30 - 2 days old, moderate urgency. Performance improvements are important but not blocking.
  • Quality: 10/20 - Good PR quality with detailed implementation notes. CI pending. Active discussion with 8 comments. High file count (156 files) requires thorough review.

📋 Recommended Action: batch_review

Batch: batch-chore-001 (with PR #12827)

This PR should be reviewed together with #12827 as both are infrastructure/tooling improvements. Consider the combined impact of parallel installation with AWF version updates.

Blockers:

  • CI status pending
  • High risk due to extensive changes (156 files, 2096 additions)

Strengths:

  • Clear performance benefits (8-12s savings)
  • Engine-agnostic design
  • Comprehensive examples for all engines (Copilot, Claude, Codex)

Review Notes:


Triaged by PR Triage Agent on 2026-01-31T18:14:11Z

AI generated by PR Triage Agent

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

🔍 PR Triage Results

Category: feature | Risk: high | Priority: 48/100

Scores Breakdown

  • Impact: 35/50 - Performance improvement (8-12s savings per workflow) - high value feature affecting all engines and workflows
  • Urgency: 3/30 - 3 days old, performance enhancement (non-blocking), pending CI
  • Quality: 10/20 - CI pending, detailed description with examples, 156 files changed, fixes issue [plan] Parallelize setup operations in agent job #12554

📋 Recommended Action: fast_track

Why: High-value performance optimization with significant impact. Needs thorough review for correctness due to parallelization complexity.

Next steps:

  • Wait for CI results
  • Validate claimed 8-12s time savings with benchmarks
  • Review error handling for parallel operations
  • Fast-track review once CI passes

Triaged by PR Triage Agent on 2026-02-01

AI generated by PR Triage Agent

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

🔍 PR Triage Results

Category: feature | Risk: high | Priority: 58/100

Scores Breakdown

  • Impact: 40/50 - Performance improvement affecting all workflows (8-12s savings per run)
  • Urgency: 10/30 - 2 days old, has merge conflict, related to issue [plan] Parallelize setup operations in agent job #12554
  • Quality: 8/20 - Good engagement (10 comments), needs conflict resolution

📋 Recommended Action: Fast-track

This PR introduces significant performance improvements and should be prioritized for review. However, it currently has merge conflicts that must be resolved before review can proceed.

Next Steps:

  1. Rebase on main to resolve merge conflicts
  2. Once conflicts resolved, fast-track for review
  3. Expected impact: 8-12 second improvement per workflow run

Batch Info: Part of batch-feature-001 - can be reviewed alongside similar infrastructure improvements


Triaged by PR Triage Agent on 2026-02-01

AI generated by PR Triage Agent

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

🔍 PR Triage Results

Category: feature | Risk: high | Priority: 53/100

Scores Breakdown

  • Impact: 30/50 - Performance improvement - saves 8-12 seconds per workflow run through parallelization
  • Urgency: 13/30 - Medium - 3 days old, addresses performance optimization
  • Quality: 10/20 - Fair - CI pending, detailed description, extensive changes (156 files), but needs verification

📋 Recommended Action: batch_review

This PR can be reviewed in batch with other performance/feature PRs. The parallelization feature is valuable but not urgent, and the extensive changes (156 files, 2096+ additions) require thorough review. Once CI passes and the changes are validated, this can be merged.

Next steps:

  1. Wait for CI to complete
  2. Review parallel installation implementation
  3. Verify no race conditions introduced
  4. Test with all engines (Copilot, Claude, Codex)
  5. Merge after comprehensive review

Triaged by PR Triage Agent on 2026-02-01 - Run #21567753665

AI generated by PR Triage Agent

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

🔍 PR Triage Results

Category: feature | Risk: high | Priority: 62/100

Scores Breakdown

  • Impact: 35/50 - Performance optimization saving 8-12 seconds per workflow run through parallel installation
  • Urgency: 17/30 - Medium - 4 days old, significant performance improvement for all workflows
  • Quality: 10/20 - Fair - detailed implementation with engine-agnostic coordinator, CI pending

📋 Recommended Action: fast-track

Excellent performance optimization - parallelizes AWF binary, CLI, and Docker downloads using background jobs. Engine-agnostic design supports Copilot (installer script), Claude/Codex (npm), and Custom engines.

Review focus areas: Error handling with wait, exit code preservation, engine-specific installation methods.


Triaged by PR Triage Agent on 2026-02-02

AI generated by PR Triage Agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment