Skip to content

Make safe-output guidance resilient to missing sandbox tools - #68716

Merged
pelikhan merged 6 commits into
mainfrom
copilot/follow-up-issue-65058
Oct 14, 2026
Merged

pelikhan merged 6 commits into
mainfrom
copilot/follow-up-issue-65058

Conversation

Copilot AI commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Self-hosted Codex runs intermittently reported missing commands prescribed by the generated prompt. Successful safe-output file copying does not establish CLI availability inside the sandbox; the historical cause remains unconfirmed.

  • Tool-free payload guidance: Prefer one single-quoted inline JSON object. Encode newlines as \n, double quotes as \", backslashes as \\, and apostrophes as \u0027; Unicode can remain literal. Runtime prompts, generated CLI recommendations/help, troubleshooting, and authoring instructions use the same approach.
  • Transport boundaries: Stdin JSON remains supported via safeoutputs <tool> ., without recommending auxiliary tools, pipelines, temporary files, or shell-expansion workarounds. Native MCP functions are alternatives only when explicitly exposed. Preserve missing_tool versus report_incomplete diagnostics, and do not claim emission when no transport is available.
  • Regression coverage: Exercise documented examples through Bash argument handling, the real CLI parser, and workflow permission checks; verify inline and stdin decoding preserve multiline content, quotes, literal backslashes, whitespace, and Unicode. Verify the compiled Pi CLI-only prompt receives the guidance.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate intermittent missing tools in agent image Make safe-output guidance resilient to missing sandbox tools Oct 14, 2026
Copilot AI requested a review from pelikhan October 14, 2026 15:02
@pelikhan
pelikhan marked this pull request as ready for review October 14, 2026 15:42
Copilot AI balanced review requested due to automatic review settings October 14, 2026 15:42

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 guidance is consistent, the fallback is safely implemented, and regression coverage validates the intended behavior.

0 open findings

What changed in this PR

Makes safe-output guidance resilient when sandbox CLI tools are unavailable, addressing #68702.

Changes:

  • Adds availability checks and a Node.js serialization fallback.
  • Tests empty and complex Unicode bodies.
  • Documents sandbox diagnostics and fallback behavior.

No confirmed vulnerabilities found. The Node fallback preserved representative complex content successfully.

File Description
actions/​setup/​md/​mcp_cli_tools_with_safeoutputs_prompt.md Adds tool checks and safe fallback guidance.
pkg/​workflow/​prompt_validation_test.go Adds prompt and serialization regression tests.
docs/​src/​content/​docs/​troubleshooting/​debugging.md Documents diagnosis of missing sandbox commands.

🧠 Review effort: Balanced


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

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · sonnet50 · 12.4 AIC · ⌖ 14.9 AIC · ◇ 6.39 AIC · ⊞ 11.6K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 14, 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 Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · gpt56 · 7.66 AIC · ⌖ 6.41 AIC · ⊞ 14.5K · ◷

Generated by Ponytail Reviewer for #68716

@github-actions

github-actions Bot commented Oct 14, 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.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · opus50 · 14 AIC · ⌖ 40.7 AIC · ◇ 35.6 AIC · ⊞ 1.9K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-14T16:04:15Z
review_event: REQUEST_CHANGES
top_themes:
  - CLI-only safe-output prompt path still lacks the new availability guidance
  - Prompt regression test is over-coupled to exact documentation formatting
files_reviewed:
  - actions/setup/md/mcp_cli_tools_with_safeoutputs_prompt.md
  - docs/src/content/docs/troubleshooting/debugging.md
  - pkg/workflow/prompt_validation_test.go
comment_count: 2

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
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 · 43.3 AIC · ⌖ 5.92 AIC · ⊞ 21.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.

Request changes

This adds useful guidance, but it still misses the CLI-only safe-output path and one of the new regression tests is overfit to prompt formatting.

Blocking themes
  • The new availability checks live only in mcp_cli_tools_with_safeoutputs_prompt.md, so workflows that rely on safe_outputs_cli_only_transport_prompt.md still hit the original missing-command failure mode.
  • The Node fallback test extracts the script via an exact prompt string, which makes future prompt maintenance fail for formatting-only edits instead of behavioral regressions.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 43.3 AIC · ⌖ 5.92 AIC · ⊞ 21.7K
Comment /review to run again

Comment thread actions/setup/md/mcp_cli_tools_with_safeoutputs_prompt.md Outdated
Comment thread pkg/workflow/prompt_validation_test.go Outdated

@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 /grill-with-docs and /tdd (triage used the fallback heuristic consistent with pr-triage's own output — change type: documentation). Posting as COMMENT; one recurring naming gap worth fixing, otherwise solid.

📋 Key Themes & Highlights

Key Themes

  • Vocabulary gap: both the prompt guidance and the new troubleshooting section tell the agent/operator to "report the missing command" once a CLI tool is confirmed unavailable, but neither names the actual safe-output tool (missing_tool) that exists for exactly this scenario, per docs/src/content/docs/reference/safe-outputs.md. Leaving this implicit risks an agent defaulting to report_incomplete (reserved for failed write attempts) or ending the turn with no safe-output call at all — the documented #1 cause of workflow failures.

Positive Highlights

  • ✅ TestSafeOutputsCLIPromptNodeFallbackPreservesBody is a genuine regression test: it extracts the real heredoc script from the prompt file and executes it with Node, verifying empty-body and large Unicode/quoted-content round-trips — this is exactly the kind of test-as-specification the /tdd skill looks for, not just a string-contains check.
  • ✅ The jq-missing → Node.js fallback instructions correctly gate on serialization success before submitting, matching the existing "don't hand-escape large bodies" guardrail already in the file.
  • ✅ Troubleshooting doc correctly separates "scripts copied to runner" from "CLI wrapper mounted on PATH" — a subtle but real distinction for self-hosted runner debugging.

Uncertainty

  • Diff was small (119 lines) and fully reviewed; no truncation concerns.

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

Comment thread actions/setup/md/mcp_cli_tools_with_safeoutputs_prompt.md Outdated
Comment thread docs/src/content/docs/troubleshooting/debugging.md
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/md/mcp_cli_tools_with_safeoutputs_prompt.md:10): This only updates the MCP-CLI safeoutputs prompt, so CLI-only safe-output runs still never probe safeoutputs/jq/node and will keep failing with command not found in the exact sandbox scenario this PR is trying to fix. - Make safe-output guidance resilient to missing sandbox tools #68716 (comment)
  3. Review (pkg/workflow/prompt_validation_test.go:39): This test is pinned to one exact heredoc header and output path, so harmless prompt edits will start failing CI even when the Node fallback behavior is still correct. - Make safe-output guidance resilient to missing sandbox tools #68716 (comment)
  4. Review (actions/setup/md/mcp_cli_tools_with_safeoutputs_prompt.md:10): [/grill-with-docs] When no supported transport is available, the guidance tells the agent to "stop and report the missing command in the final response" — but it does not name which safe-output tool to call. This repo already has missing_tool for exactly this case ("Required functionality is not available"), while report_incomplete is reserved for failed write attempts per safe_outputs_prompt.md. Leaving it unnamed risks the agent picking the wrong diagnostic tool or silently ending the turn without calling any safe output. - Make safe-output guidance resilient to missing sandbox tools #68716 (comment)
  5. Review (docs/src/content/docs/troubleshooting/debugging.md:94): [/grill-with-docs] Good troubleshooting addition distinguishing "command not found" from an unavailable MCP tool. One gap: this section documents the detection steps but, like the prompt change, never tells the reader/agent which safe-output diagnostic to emit (missing_tool vs report_incomplete) once unavailability is confirmed — leaving a dead end for the operational guidance. - Make safe-output guidance resilient to missing sandbox tools #68716 (comment)

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: 7ac99e4
Sous-chef state: 9bd350bc8b9db7178fd0559f95f244ce43aafb2f0e0fb672e6adcfda09caa981

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 16.2 AIC · ⌖ 5.98 AIC · ⊞ 1.1K · ◷
Comment /souschef to run again

pelikhan and others added 2 commits October 14, 2026 09:40
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ue-65058

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
pelikhan and others added 2 commits October 14, 2026 10:34
Document stdin support without auxiliary-tool recommendations and preserve escaping across generated examples, runtime prompts, and troubleshooting guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore explicit CLI-only transport guidance and validate inline JSON examples while preserving stdin support and single-output guarantees.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan merged commit 9b821b6 into main Oct 14, 2026
49 checks passed
@pelikhan
pelikhan deleted the copilot/follow-up-issue-65058 branch October 14, 2026 18:09
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.

Follow-up to #65058: intermittent missing tools in the agent image

4 participants