Skip to content

Fix Pi engine report_incomplete emission failing silently in sandboxed agent container (EROFS) - #57861

Merged
pelikhan merged 3 commits into
mainfrom
copilot/aw-debug-lintmonster-failure
Sep 2, 2026
Merged

Fix Pi engine report_incomplete emission failing silently in sandboxed agent container (EROFS)#57861
pelikhan merged 3 commits into
mainfrom
copilot/aw-debug-lintmonster-failure

Conversation

Copilot AI commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

LintMonster (and any pi-engine workflow) could complete a run with an internal provider error but produce zero safe outputs, instead of the expected report_incomplete diagnostic.

Root cause

  • pi_provider.cjs's message_end handler correctly detects a Pi provider infrastructure error and tries to emit a synthetic report_incomplete safe output.
  • That emission wrote directly to GH_AW_SAFE_OUTPUTS via fs.appendFileSync. This extension runs inside the AWF gvisor-sandboxed agent container, where the directory backing GH_AW_SAFE_OUTPUTS is mounted read-only.
  • The write failed with EROFS, and the failure was logged but never surfaced as a safe output — so the run appeared to produce nothing at all.

Fix

  • pi_provider.cjs now delegates emission to the existing emitInfrastructureIncomplete() helper in safeoutputs_cli.cjs, which sends the payload through the safeoutputs CLI → MCP gateway channel (a process outside the sandbox with real write access) instead of writing the file directly.
  • This is the same pattern already used by codex_harness.cjs, copilot_harness.cjs, and harness_retry_guard.cjspi_provider.cjs was the one harness still reimplementing raw fs writes.
  • Removed the now-unused buildInfrastructureIncompletePayload() helper along with the direct fs.appendFileSync/fs.mkdirSync calls; the existing "skip if safe outputs already recorded" pre-check (which only reads the file) is preserved since reads still succeed on the read-only mount.

Tests

  • pi_provider.test.cjs updated to cover both the CLI-success and CLI-failure emission paths, using the GH_AW_SAFEOUTPUTS_CLI stub-binary override already used in other harness tests, in place of asserting on direct file contents.

Copilot AI linked an issue Sep 2, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits September 2, 2026 05:51
…tead of direct fs writes

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix LintMonster workflow to produce safe outputs Fix Pi engine report_incomplete emission failing silently in sandboxed agent container (EROFS) Sep 2, 2026
Copilot AI requested a review from pelikhan September 2, 2026 05:54
@pelikhan
pelikhan marked this pull request as ready for review September 2, 2026 05:55
Copilot AI balanced review requested due to automatic review settings September 2, 2026 05:55
@github-actions

github-actions Bot commented Sep 2, 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 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ Security scanning failed for Ponytail Reviewer. Review the logs for details.

Lean already. Ship.

Warning

Firewall blocked 1 domain

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

  • ab.chatgpt.com

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

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #57861

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Sep 2, 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 Sep 2, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

No inline review comments were needed because the changed lines did not expose a blocking issue beyond what the overall review already covered.

🔎 Code quality review by PR Code Quality Reviewer

@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 — this is a clean, well-targeted fix.

📋 Analysis

The root cause (raw fs.appendFileSync writing to a read-only sandbox mount, failing with EROFS and only logging) is correctly addressed by delegating to the existing emitInfrastructureIncomplete() helper in safeoutputs_cli.cjs, which routes through the safeoutputs CLI → MCP gateway channel — the same pattern already used by codex_harness.cjs, copilot_harness.cjs, and harness_retry_guard.cjs. This brings pi_provider.cjs in line with the established convention rather than reimplementing raw fs writes.

Regression coverage is solid: pi_provider.test.cjs now exercises both the CLI-success and CLI-failure emission paths via the GH_AW_SAFEOUTPUTS_CLI stub-binary override, asserting on the new log messages instead of direct file contents — appropriately reflecting that emission no longer touches the file directly. The pre-existing "skip if safe outputs already recorded" check is preserved and still correctly relies on reads (which succeed on the read-only mount).

No dead code, no unused imports (path removal is correct since fs.mkdirSync(path.dirname(...)) was removed along with the direct write), and the buildInfrastructureIncompletePayload removal is clean since its only caller was replaced.

Positive Highlights

  • ✅ Delegates to already-tested shared helper instead of duplicating logic
  • ✅ Regression tests cover both success and failure of the new CLI channel
  • ✅ Clear doc comment explaining the sandboxed read-only mount constraint

No actionable issues found.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 16.9 AIC · ⌖ 14.6 AIC · ⊞ 10.3K
Comment /matt to run again

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.

🟢 Approval recommended

The focused change addresses the confirmed EROFS failure while preserving the existing safe-output pre-check.

Pull request overview

Fixes Pi provider diagnostics in read-only sandboxes by routing report_incomplete through the safeoutputs CLI.

Changes:

  • Replaces direct filesystem writes with emitInfrastructureIncomplete().
  • Tests successful, failed, and skipped CLI emission paths.
File summaries
File Description
actions/setup/js/pi_provider.cjs Routes infrastructure diagnostics through the MCP gateway.
actions/setup/js/pi_provider.test.cjs Updates coverage for CLI-based emission behavior.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

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

@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.

Reviewed with harden/audit lens (bug-fix category). The fix correctly delegates emission to the shared emitInfrastructureIncomplete() helper via the safeoutputs CLI channel, matching the pattern already used by other harnesses (codex_harness.cjs, copilot_harness.cjs, harness_retry_guard.cjs). Both success and failure paths are logged distinctly and covered by new tests (CLI-success and CLI-failure via GH_AW_SAFEOUTPUTS_CLI stub). No blocking issues found; no UI/design-system code involved so Impeccable modes were not directly applicable beyond the harden/audit correctness lens.

Warning

Firewall blocked 1 domain

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

  • registry.npmjs.org

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

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 19.8 AIC · ⌖ 14.3 AIC · ⊞ 8.3K

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-09-02T05:59:29Z
review_event: COMMENT
top_themes: []
files_reviewed:
  - actions/setup/js/pi_provider.cjs
  - actions/setup/js/pi_provider.test.cjs
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 · copilot · gpt54 · 45.2 AIC · ⌖ 7.32 AIC · ⊞ 23.5K ·
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.

No actionable blocking issues found in the changed lines.

### Review notes

The change removes direct filesystem writes to GH_AW_SAFE_OUTPUTS and routes the synthetic report_incomplete signal through the same safeoutputs CLI path the other harnesses already use. The remaining risk I checked for was whether the new path could double-emit or skip existing outputs; the pre-check still short-circuits when the safe-outputs file already contains task output, and the new tests cover both CLI success and CLI failure paths. I did not find a changed-line regression that should block merge.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 45.2 AIC · ⌖ 7.32 AIC · ⊞ 23.5K
Comment /review to run again

@pelikhan
pelikhan merged commit c4b30a8 into main Sep 2, 2026
59 of 67 checks passed
@pelikhan
pelikhan deleted the copilot/aw-debug-lintmonster-failure branch September 2, 2026 06:08
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.88.2

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] LintMonster produced no safe outputs

3 participants