Skip to content

Add regression coverage for Copilot AWF chroot-home cleanup#42736

Merged
pelikhan merged 2 commits into
mainfrom
copilot/aw-fix-http-400-bad-request
Jul 1, 2026
Merged

Add regression coverage for Copilot AWF chroot-home cleanup#42736
pelikhan merged 2 commits into
mainfrom
copilot/aw-fix-http-400-bad-request

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The Copilot PR Conversation NLP Analysis failure was caused by stale root-owned /tmp/awf-*-chroot-home directories left behind by AWF host-access runs. When those directories persisted, Copilot CLI cleanup could fail with EACCES, surfacing as an engine-side HTTP 400 / unexpected termination.

  • What changed

    • Added focused regression coverage for the existing AWF chroot-home cleanup behavior in actions/setup/js/chroot_home_cleanup.test.js.
    • The new test locks in the install-time cleanup path in actions/setup/sh/install_copilot_cli.sh, so future edits do not silently drop the stale-directory removal that protects Copilot startup.
  • Why this matters

    • The runtime fix already existed in the setup scripts; this change makes that protection explicit in test coverage.
    • It specifically guards the failure mode where stale AWF chroot homes interfere with Copilot CLI filesystem cleanup.
  • Coverage added

    • Verifies install_copilot_cli.sh still:
      • fixes ownership of "$COPILOT_DIR"
      • logs stale chroot-home cleanup
      • runs sudo find /tmp ... -name 'awf-*-chroot-home' ... -exec rm -rf
const cleanupCommandIndex = script.indexOf(
  "sudo find /tmp -maxdepth 1 -name 'awf-*-chroot-home' -type d -exec rm -rf -- {} + 2>/dev/null || true"
);

expect(cleanupCommandIndex).toBeGreaterThan(cleanupBannerIndex);

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix HTTP 400 bad request in Copilot PR Conversation NLP analysis Add regression coverage for Copilot AWF chroot-home cleanup Jul 1, 2026
Copilot AI requested a review from pelikhan July 1, 2026 12:17
@pelikhan pelikhan marked this pull request as ready for review July 1, 2026 12:20
Copilot AI review requested due to automatic review settings July 1, 2026 12:20
@pelikhan pelikhan merged commit 1a668df into main Jul 1, 2026
@pelikhan pelikhan deleted the copilot/aw-fix-http-400-bad-request branch July 1, 2026 12:21

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 a regression test to ensure the Copilot CLI install script continues to perform AWF chroot-home cleanup, protecting Copilot CLI startup from EACCES failures caused by stale root-owned /tmp/awf-*-chroot-home directories created by prior AWF host-access runs.

Changes:

  • Added a new vitest suite that asserts install_copilot_cli.sh contains (and orders) the ownership-fix and stale chroot-home cleanup steps.
  • Locked in the presence of the sudo find /tmp ... -name 'awf-*-chroot-home' ... -exec rm -rf cleanup command.
Show a summary per file
File Description
actions/setup/js/chroot_home_cleanup.test.js Adds regression coverage that inspects install_copilot_cli.sh for the AWF chroot-home cleanup sequence.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment on lines +145 to +153
const ownershipFixIndex = script.indexOf('sudo chown -R "$(id -u):$(id -g)" "$COPILOT_DIR"');
const cleanupBannerIndex = script.indexOf('echo "Cleaning up stale AWF chroot home directories..."');
const cleanupCommandIndex = script.indexOf(
"sudo find /tmp -maxdepth 1 -name 'awf-*-chroot-home' -type d -exec rm -rf -- {} + 2>/dev/null || true"
);

expect(ownershipFixIndex).toBeGreaterThanOrEqual(0);
expect(cleanupBannerIndex).toBeGreaterThan(ownershipFixIndex);
expect(cleanupCommandIndex).toBeGreaterThan(cleanupBannerIndex);
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] Copilot PR Conversation NLP Analysis hit HTTP 400 bad request

3 participants