Skip to content

fix: recover transient Cloud Hypervisor readiness failures - #7611

Merged
lpcox merged 2 commits into
mainfrom
copilot/wait-for-cloud-hypervisor-guest-readiness
Aug 21, 2026
Merged

fix: recover transient Cloud Hypervisor readiness failures#7611
lpcox merged 2 commits into
mainfrom
copilot/wait-for-cloud-hypervisor-guest-readiness

Conversation

Copilot AI commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • verify loopback, eth0, the planned guest address, and the expected default route before trusted-service probes
  • retry Squid, API proxy, and topology-peer connectivity independently inside the same microVM with per-leg diagnostics
  • classify exhausted readiness failures structurally and recreate the Cloud Hypervisor VM at most three total times with 5-second and 10-second backoff
  • preserve diagnostics for every failed boot attempt while keeping the wrapped agent command outside the recovery loop

Validation

  • npm run build
  • npm run lint
  • npm test -- --runInBand --silent

Fixes #7610

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d69f30be-77fd-415b-aa99-5f050637b2e9
@lpcox lpcox changed the title [WIP] Fix connectivity probing for Cloud Hypervisor readiness Recover transient Cloud Hypervisor readiness failures Aug 21, 2026
@lpcox
lpcox marked this pull request as ready for review August 21, 2026 21:56
Copilot AI balanced review requested due to automatic review settings August 21, 2026 21:56
@github-actions

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit 653d7e1

@lpcox lpcox changed the title Recover transient Cloud Hypervisor readiness failures fix: recover transient Cloud Hypervisor readiness failures Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 93.67% 93.67% ➡️ +0.00%
Statements 92.53% 92.53% ➡️ +0.00%
Functions 93.05% 92.77% 📉 -0.28%
Branches 85.80% 85.79% ➡️ -0.01%
📁 Per-file Coverage Changes (3 files)
File Lines (Before → After) Statements (Before → After)
src/cloud-hypervisor/manager.ts 90.7% → 89.5% (-1.19%) 89.3% → 88.2% (-1.13%)
src/cloud-hypervisor-runtime-backend.ts 96.9% → 96.6% (-0.28%) 94.6% → 94.2% (-0.32%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

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

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.

Pull request overview

Adds bounded Cloud Hypervisor recovery for transient guest-network and trusted-service readiness failures.

Changes:

  • Verifies complete guest network readiness before connectivity probes.
  • Retries connectivity legs and recreates failed VMs up to three attempts.
  • Preserves per-attempt diagnostics and expands regression tests/documentation.
Show a summary per file
File Description
src/cloud-hypervisor/manager.ts Exposes guest network-plan properties.
src/cloud-hypervisor-runtime-backend.ts Implements readiness checks, retries, recovery, and diagnostics.
src/cloud-hypervisor-runtime-backend.test.ts Tests recovery and failure classification.
docs/cloud-hypervisor-foundation.md Documents readiness and recovery behavior.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 4/4 changed files
  • Comments generated: 5
  • Review effort level: Balanced

name: 'api-proxy',
command:
`unset HTTP_PROXY HTTPS_PROXY http_proxy https_proxy ALL_PROXY all_proxy; ` +
`wget -q -T ${CLOUD_HYPERVISOR_API_PROXY_PROBE_TIMEOUT_SECONDS} ` +
Comment on lines +717 to +724
} catch (error) {
throw new CloudHypervisorRetryableReadinessError(
'guest-network-readiness',
bootAttempt,
`guest-network-not-ready: expected lo UP with 127.0.0.1/8, ` +
`${guestInterfaceName} state UP with ${expectedAddress}, and default route via ` +
`${guestGatewayIp} (${formatError(error)})`,
error,
Comment on lines +630 to +636
const failure =
`Cloud Hypervisor guest connectivity probe failed with exit code ${result.exitCode}` +
(detail ? ` (${detail})` : ''),
(detail ? ` (${detail})` : '');
if (result.exitCode === 126 || result.exitCode === 127) {
throw new Error(`Cloud Hypervisor guest connectivity configuration is invalid: ${failure}`);
}
throw new CloudHypervisorRetryableReadinessError(
Comment on lines +764 to +768
private getBootDiagnosticsDirectory(bootAttempt: number): string {
const root = this.config.auditDir
? `${this.config.auditDir}/cloud-hypervisor`
: `${this.config.workDir}/diagnostics/cloud-hypervisor`;
return `${root}/boot-attempt-${bootAttempt}`;
});

it('waits with bounded backoff for guest loopback before probing connectivity', async () => {
it('waits with bounded backoff for the complete guest data plane before probing connectivity', async () => {
@lpcox

lpcox commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

@github-actions

Copy link
Copy Markdown
Contributor

⏳ Copilot review left inline comments.

@copilot To proceed:

  1. Ask @copilot to address the review feedback (reply to this comment or the review thread)
  2. Once the fix is pushed, add the ready-for-aw label to trigger agentic CI smoke tests

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

Generated by Smoke Claude for #7611

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Contribution Check failed. Please review the logs for details.

Generated by Contribution Check for #7611

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

📰 BREAKING: Report filed by Smoke Docker Sbx

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

Warning

Firewall blocked 3 domains

The following domains were blocked by the firewall during workflow execution:

  • msfeed2.pkgs.visualstudio.com
  • msfeed25.pkgs.visualstudio.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "msfeed2.pkgs.visualstudio.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct Mode) ✅

Status: PASS

  • ✅ GitHub MCP connectivity (2 merged PRs verified)
  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read test (smoke file confirmed)
  • ✅ BYOK inference test (api-proxy → api.githubcopilot.com working)

Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine

Overall: PASS

cc @lpcox

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API status ✅ PASS
gh check ✅ PASS
File status ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #7611 · haiku45 · 55.6 AIC · ⊞ 4K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (github.com) reachable: allowed=200
✅ Blocked domain (example.com) denied: proxy 403 CONNECT tunnel failed

Overall: PASS

cc @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

  • Redis PING: ❌ (Temporary failure in name resolution)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (could not translate host name)

Overall: FAILhost.docker.internal did not resolve; sandbox couldn't reach host service containers.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Docker Sbx Smoke Test@lpcox

  • ✅ GitHub MCP connectivity (PR list fetched)
  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read test

Overall: PASS

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox @Copilot

  • test: fix config writer tests on macOS — ✅
  • API proxy: first-class AI-credit accounting for Copilot auto dynamic selector — ✅
  • GitHub.com Connectivity — ✅
  • File Write/Read Test — ✅
  • BYOK Inference Test — ✅

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

Overall: PASS

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.14 Python 3.12.14 ✅ YES
Node.js v24.19.0 v22.23.2 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version mismatch between host and chroot environment. smoke-chroot label not applied since not all tests passed.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test:
Merged PRs: #7608 test: fix config writer tests on macOS; #7604 API proxy: first-class AI-credit accounting for Copilot auto dynamic selector
Queried PRs: #7611 fix: recover transient Cloud Hypervisor readiness failures; #7608 test: fix config writer tests on macOS
GitHub reads ✅
Playwright ✅
File write/read ✅
Discussion comment ✅
Build (npm ci && npm run build) ✅
Overall: PASS

Warning

Firewall blocked 3 domains

The following domains were blocked by the firewall during workflow execution:

  • msfeed2.pkgs.visualstudio.com
  • msfeed25.pkgs.visualstudio.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "msfeed2.pkgs.visualstudio.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

test: fix config writer tests on macOS
API proxy: first-class AI-credit accounting for Copilot auto dynamic selector

✅ MCP connectivity
✅ GitHub.com connectivity
✅ File write/read
✅ Direct BYOK inference

Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra

Overall: PASS

@Copilot @lpcox

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A (run OK) ✅ PASS
.NET json-parse N/A (run OK) ✅ PASS
Go color ok ✅ PASS
Go env ok ✅ PASS
Go uuid ok ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx all passed ✅ PASS
Node.js execa all passed ✅ PASS
Node.js p-limit all passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Note: Java Maven required a writable localRepository override in ~/.m2/settings.xml (default ~/.m2/repository was not writable), pointed at /tmp/gh-aw/agent/m2repo; after that fix, gson and caffeine both compiled and passed tests.

All ecosystems passed — adding build-test label.

Generated by Build Test Suite for #7611 · auto · 51.4 AIC · ⊞ 12K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing — Results

  • Scenario 1 (Module Loading): otel.js loaded successfully. isEnabled(): true. Exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, _provider, _ProxyAwareOtlpExporter, _FileSpanExporter, _FanOutSpanExporter, _parseEndpoints, _parseOtlpHeaders, _buildResourceSpans, _createOtlpWorkloadIdentity
  • Scenario 2 (Test Suite): npx jest --testPathPatterns='otel'3 suites passed, 68 tests passed, 0 failed (covers serialization, exporters, fan-out, span creation, gen_ai attributes, budget attributes, FileSpanExporter, ProxyAwareOtlpExporter, shutdown).
  • Scenario 3 (Env Var Forwarding): src/services/agent-environment/env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID and GITHUB_AW_OTEL_PARENT_SPAN_ID to the agent; src/services/api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, GITHUB_AW_OTEL_TRACE_ID, and GITHUB_AW_OTEL_PARENT_SPAN_ID to the api-proxy container.
  • Scenario 4 (Token Tracker Integration): token-tracker-http.js contains the onUsage callback hook point used by OTEL for token usage attributes.
  • Scenario 5 (OTEL Diagnostics): Spans were exported this run — /tmp/gh-aw/otel.jsonl contains 1 span record (workflow-level trace with correct resource attributes and gen_ai.system), and token-usage.jsonl recorded 13 usage entries confirming the token-tracker pipeline is active.

Overall: All 5 scenarios pass.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 858599c into main Aug 21, 2026
168 of 173 checks passed
@lpcox
lpcox deleted the copilot/wait-for-cloud-hypervisor-guest-readiness branch August 21, 2026 22:39
Copilot stopped work on behalf of lpcox due to an error August 21, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wait for Cloud Hypervisor guest data-plane readiness before connectivity probing

3 participants