Skip to content

Fix Copilot SDK crashes in Cloud Hypervisor - #55495

Merged
pelikhan merged 6 commits into
mainfrom
copilot/fix-native-engine-crash
Aug 24, 2026
Merged

Fix Copilot SDK crashes in Cloud Hypervisor#55495
pelikhan merged 6 commits into
mainfrom
copilot/fix-native-engine-crash

Conversation

Copilot AI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Copilot SDK workflows under Cloud Hypervisor could exit with code 1 because filesystem isolation blocked creation of session-state logs under /tmp/gh-aw/sandbox/agent/logs.

  • Sandbox policy

    • Allow the canonical agent-log directory for Cloud Hypervisor Copilot runs.
    • Keep the permission Copilot-specific to avoid broadening other engines’ writable paths.
  • Coverage

    • Verify Copilot receives the required log permission.
    • Verify other engines retain their existing narrower policy.

gh-aw-pr-sous-chef: attempted branch refresh in run https://github.com/github/gh-aw/actions/runs/32780228606

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 36 AIC · ⌖ 8.01 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GitHub Copilot CLI native-engine crash Fix Copilot SDK crashes in Cloud Hypervisor Aug 24, 2026
Copilot AI requested a review from pelikhan August 24, 2026 19:55
@pelikhan
pelikhan marked this pull request as ready for review August 24, 2026 20:57
Copilot AI balanced review requested due to automatic review settings August 24, 2026 20:57
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #55495

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #55495 does not have the 'implementation' label and has only 22 new lines of code in business logic directories (threshold: 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Completed PR review. No actionable changed-line issues were found, so no review comments or submit-review write was needed from safeoutputs.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions github-actions Bot 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.

A small simplification opportunity is worth considering here. net: -2 lines possible.

Generated by ✂️ Ponytail Reviewer for #55495 · codex · mai10 · 3.59 AIC · ⌖ 1.42 AIC · ⊞ 18.3K
Comment /ponytail to run again

Comment thread pkg/workflow/sandbox.go
// Seeding a default there would therefore break every compose-runtime workflow, so
// filesystem.allowWrite stays opt-in for those runtimes.
func ensureDefaultAgentWritePath(sandboxConfig *SandboxConfig) {
func ensureDefaultAgentWritePath(sandboxConfig *SandboxConfig, engineConfig *EngineConfig) {

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.

pkg/workflow/sandbox.go:312: yagni: the new engineConfig plumbing for a one-off copilot branch. Keep the helper engine-agnostic and add the log-path tweak inline at the call site until a second engine needs it.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-24T00:00:00Z
review_event: COMMENT
top_themes:
  - no actionable changed-line issues found
files_reviewed:
  - pkg/workflow/cloud_hypervisor_test.go
  - pkg/workflow/sandbox.go
  - pkg/workflow/sandbox_test.go
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 4.47 AIC · ⌖ 6.79 AIC · ⊞ 7K ·
Comment /review to run again

@github-actions github-actions Bot 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.

The fix is clean and well-targeted. ensureDefaultAgentWritePath now correctly seeds /tmp/gh-aw/sandbox/agent/logs for the Copilot engine under Cloud Hypervisor. The nil guard on engineConfig is present, and the updated tests cover the new expected path. No blocking issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet46 · 17.6 AIC · ⌖ 8.96 AIC · ⊞ 6.2K

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — requesting changes on two focused issues.

📋 Key Themes & Highlights

Issues Found

  • Magic string: "copilot" used directly in sandbox.go instead of constants.CopilotEngine — inconsistent with the rest of the codebase
  • Missing regression test: No TestApplySandboxDefaults case for Cloud Hypervisor + non-copilot engine, leaving the guard unverified by the unit suite

Positive Highlights

  • ✅ Targeted fix: log-path permission is Copilot-specific, preserving other engines' narrower policy
  • ✅ Good inline documentation explaining the Cloud Hypervisor virtiofs export model
  • cloud_hypervisor_test.go updated to assert the full allowWrite order including the new path
  • ✅ Clean, minimal change — only touches what's needed

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet46 · 41.5 AIC · ⌖ 9.93 AIC · ⊞ 7.6K
Comment /matt to run again

Comments that could not be inline-anchored

pkg/workflow/sandbox.go:326

[/diagnosing-bugs] Magic string &quot;copilot&quot; should use constants.CopilotEngine to stay consistent with the rest of the codebase and avoid silent drift.

<details>
<summary>💡 Suggested fix</summary>

import &quot;github.com/github/gh-aw/pkg/constants&quot;

// in ensureDefaultAgentWritePath:
if engineConfig != nil &amp;&amp; engineConfig.ID == string(constants.CopilotEngine) {
    addAllowWritePathIfMissing(sandboxConfig.Agent.Config.Filesystem, defaultAgentLogsWritePath)
}

Every other engine-ID…

pkg/workflow/sandbox_test.go:263

[/tdd] Missing test case: Cloud Hypervisor + non-copilot engine (e.g. claude) should confirm that defaultAgentLogsWritePath is not added. The PR description says "Verify other engines retain their existing narrower policy", but TestApplySandboxDefaults has no Cloud Hypervisor case for a non-copilot engine — only a compose-runtime claude case (no Runtime set).

<details>
<summary>💡 Suggested test case</summary>

{
    name: &quot;cloud-hypervisor runtime for non-copilot engin</details>

@github-actions github-actions Bot mentioned this pull request Aug 24, 2026

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 Copilot-specific write access for Cloud Hypervisor session-state logs, preventing SDK crashes while preserving other engines’ narrower policies.

Changes:

  • Adds the canonical agent-log directory to Copilot’s Cloud Hypervisor allowlist.
  • Updates sandbox and generated AWF configuration tests.
  • Confirms non-Copilot engines retain existing permissions.
Show a summary per file
File Description
pkg/workflow/sandbox.go Adds Copilot-specific log-directory permission.
pkg/workflow/sandbox_test.go Verifies engine-specific allowlists.
pkg/workflow/cloud_hypervisor_test.go Verifies generated AWF configuration.

Review details

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs forward progress before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

  • review the current blocking feedback and either push the smallest required fix or reply in-thread if no code change is needed
  • refresh the branch if needed and use the pr-finisher skill before handing back for review
  • run make fmt if you touch code

I also attempted a branch refresh for this PR in this run.

Run: https://github.com/github/gh-aw/actions/runs/32780228606

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 36 AIC · ⌖ 8.01 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Copilot AI and others added 3 commits August 24, 2026 21:49
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
This reverts commit 54d5b7b.

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs forward progress before maintainer investigation is likely to be productive.
...

Follow-up complete in 6271d65: use constants.CopilotEngine and explicitly verify Cloud Hypervisor non-Copilot engines do not receive the log-path permission. Also reverted unrelated lockfile drift from the branch refresh.

Copilot AI requested a review from gh-aw-bot August 24, 2026 21:56
@pelikhan
pelikhan merged commit 4524d12 into main Aug 24, 2026
34 checks passed
@pelikhan
pelikhan deleted the copilot/fix-native-engine-crash branch August 24, 2026 22:18
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.5

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-failures] [aw] Failure Investigator Report — 2026-08-24 19:02 UTC (6h)

4 participants