Fix Copilot SDK crashes in Cloud Hypervisor - #55495
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Ponytail Reviewer completed successfully!
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ 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).
|
|
✅ 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.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
There was a problem hiding this comment.
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
| // 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) { |
There was a problem hiding this comment.
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.
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd — requesting changes on two focused issues.
📋 Key Themes & Highlights
Issues Found
- Magic string:
"copilot"used directly insandbox.goinstead ofconstants.CopilotEngine— inconsistent with the rest of the codebase - Missing regression test: No
TestApplySandboxDefaultscase 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.goupdated to assert the fullallowWriteorder 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 "copilot" should use constants.CopilotEngine to stay consistent with the rest of the codebase and avoid silent drift.
<details>
<summary>💡 Suggested fix</summary>
import "github.com/github/gh-aw/pkg/constants"
// in ensureDefaultAgentWritePath:
if engineConfig != nil && 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: "cloud-hypervisor runtime for non-copilot engin…
</details>There was a problem hiding this comment.
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
|
Please do one focused follow-up pass:
I also attempted a branch refresh for this PR in this run. Run: https://github.com/github/gh-aw/actions/runs/32780228606
|
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>
Follow-up complete in 6271d65: use |
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
Coverage
gh-aw-pr-sous-chef: attempted branch refresh in run https://github.com/github/gh-aw/actions/runs/32780228606