Conversation
…s_prompt Agent-Logs-Url: https://github.com/github/gh-aw/sessions/48e76f02-c443-4ae8-9bf1-ac883d8aa856 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
May 2, 2026 00:30
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the MCP CLI usage prompt to document a non-pipe workflow for passing multi-field JSON payloads via stdin, preventing PR bodies from accidentally becoming raw JSON when agents fall back to --body - patterns.
Changes:
- Rewords JSON-stdin guidance to emphasize supplying a JSON object via stdin (dot sentinel) rather than only “piping.”
- Adds a “When pipes are blocked” section demonstrating
. < filestdin file-redirection for JSON payload mode. - Adds an explicit warning against
--body - < filefor multi-field JSON payloads and updates examples/notes accordingly.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/md/mcp_cli_tools_prompt.md | Adds file-redirection examples and warnings so multi-field JSON stdin payloads are parsed correctly even when pipes are restricted. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
This was referenced May 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the "automatic mcp-to-cli stdin JSON parsing" issue observed in PR #29649, where the PR body contained a raw JSON object instead of the intended markdown content.
Root Cause
When an agent tried to create a PR with a multi-field JSON payload via the
safeoutputsCLI, this sequence occurred:printf '...' | safeoutputs create_pull_request .→ ❌ blocked by Claude Code bash security ("Redirect has multiple targets")cat file | safeoutputs create_pull_request .→ ❌ blocked ("multiple operations require approval")safeoutputs create_pull_request --body - < /tmp/payload.json→ ✅ allowed, but wrong:--body -reads the entire JSON object as a raw string for thebodyparameter, rather than parsing it and distributingtitle,body,branch,baseto their respective fieldsThe correct approach —
safeoutputs create_pull_request . < /tmp/payload.json— was never tried because the prompt only showed pipe examples.Fix
Updated
actions/setup/md/mcp_cli_tools_prompt.mdto:safeoutputs create_pull_request . < /tmp/payload.json(.sentinel with<file redirection, no pipe required)--body - < filefor multi-field JSON payloads — this reads the whole JSON object as the body string. < fileform. < filealongsideprintf ... |as equivalent approachesWhy
. < fileworks.sentinel tells the bridge to parse stdin as a full JSON argument object< fileredirects stdin from a file (not a pipe — no second command)process.stdin.isTTYisundefinedfor both pipes and file redirections, so the bridge reads stdin correctly in both cases