Skip to content

Retry transient Copilot installer failures in token optimizer - #11311

Merged
lpcox merged 4 commits into
mainfrom
copilot/aw-fix-copilot-token-optimizer
Nov 8, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/aw-fix-copilot-token-optimizer

Conversation

Copilot AI commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

The Daily Copilot Token Optimization Advisor failed before agent startup after six HTTP 504 responses while downloading the pinned checksum manifest.

  • Bounded retries: Retry download failures up to three times, with 30/60-second backoff, 90-second attempt limits, and a seven-minute step timeout.
  • Preserved safeguards: Keep CLI version, checksum, and cooldown pins unchanged. Fail immediately on verification or installation errors; propagate exhausted download failures.
  • Targeted scope: Apply the retry through the existing lock postprocessor only to the token optimizer. Add regression coverage for recovery, exhaustion, fail-fast behavior, and idempotency.

Copilot AI changed the title [WIP] Fix Daily Copilot Token Optimization Advisor failure before agent execution Retry transient Copilot installer failures in token optimizer Nov 8, 2026
Copilot AI requested a review from lpcox November 8, 2026 16:16
@lpcox
lpcox marked this pull request as ready for review November 8, 2026 16:22
Copilot AI adaptive review requested due to automatic review settings November 8, 2026 16:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The timeout’s --foreground setting can let stalled download children survive the 90-second deadline, requiring process-group termination and regression coverage.

1 open issue
What changed in this PR

This PR addresses the token optimizer’s pre-agent installation failure by adding targeted Copilot CLI download retries through the existing workflow lock postprocessor.

Changes:

  • Adds three installer attempts with 30/60-second backoff, timeout controls, and exit-code-based retry selection.
  • Preserves the CLI version, checksum, and cooldown pins.
  • Adds regression coverage for recovery, exhaustion, fail-fast behavior, workflow targeting, and idempotency.
File Description
scripts/​ci/​copilot-token-optimizer-workflow.test.ts Tests retry execution, preserved pins, and targeted patching.
scripts/​ci/​apply-general-workflow-patches.ts Generates the optimizer-specific installer retry wrapper.
.github/​workflows/​copilot-token-optimizer.lock.yml Applies the retry wrapper and step timeout.

Review effort: Balanced (auto)

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

Copilot AI commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix these two ci checks https://github.com/github/gh-aw-firewall/actions/runs/42499947632/job/128790315786?pr=11311 and https://github.com/github/gh-aw-firewall/actions/runs/42499947687/job/...

Both checks failed because the lockfile still included --foreground after the postprocessor stopped generating it. I synchronized the lock in 8cc6684; the targeted regression suite now passes (9 tests).

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.80% 93.80% ➡️ +0.00%
Statements 92.35% 92.35% ➡️ +0.00%
Functions 93.02% 93.02% ➡️ +0.00%
Branches 86.68% 86.68% ➡️ +0.00%

Coverage comparison generated by scripts/ci/compare-coverage.ts

@lpcox
lpcox merged commit b2df0cf into main Nov 8, 2026
38 of 41 checks passed
@lpcox
lpcox deleted the copilot/aw-fix-copilot-token-optimizer branch November 8, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] Daily Copilot Token Optimization Advisor: failed before agent execution started

3 participants