fix: restore MCP CLI concept explanation and fix safeoutputs framing#39689
Merged
Conversation
…39684) - Restore concept explanation to mcp_cli_tools_prompt.md that was stripped by PR #36778: servers are CLI executables on PATH, not MCP tools; include usage example and JSON stdin mode - Fix safe_outputs_prompt.md line 2: 'safeoutputs MCP server tools' → 'safeoutputs CLI tool' to match the CLI framing - Update prompts.go comment to match
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
There was a problem hiding this comment.
Pull request overview
Restores missing agent-facing guidance about MCP CLI “servers” being invoked as shell executables (not via MCP tool interfaces), and fixes contradictory safeoutputs framing in the generated prompts/comments so agents are less likely to misuse the interface.
Changes:
- Expands
mcp_cli_tools_prompt.mdto reintroduce a concise CLI mental model, with concrete CLI/JSON-stdin examples and safeoutputs write-intent warnings. - Updates
safe_outputs_prompt.mdwording to consistently describesafeoutputsas a CLI tool rather than an “MCP server”. - Adjusts a high-level comment in
pkg/workflow/prompts.goto match the updated framing.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/prompts.go | Updates prompt-area comment wording for safe outputs framing. |
| actions/setup/md/safe_outputs_prompt.md | Reframes safeoutputs guidance to explicitly reference the CLI tool. |
| actions/setup/md/mcp_cli_tools_prompt.md | Restores abbreviated concept explanation + usage examples for MCP CLI executables. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 3
…config PR #39100 introduced the containerized stdio transport for safeoutputs but hardcoded ${GITHUB_WORKSPACE}/actions/setup/js/safe_outputs_mcp_server.cjs as the entrypoint. This path only exists in the gh-aw repo's own workspace. For consumer repos (e.g. github-automation), GITHUB_WORKSPACE is that repo's checkout which does not contain actions/setup/js/. The gateway container gets MODULE_NOT_FOUND, crashes with EOF on initialize, and registers 0 tools. The agent then spends ~30 minutes trying to discover the tool schema before failing. Fix: use ${RUNNER_TEMP}/gh-aw/safeoutputs/safe_outputs_mcp_server.cjs — setup.sh already copies the file there and that directory is mounted rw. Recompile all 249 lock files. Observed in: https://github.com/github/github-automation/actions/runs/27647012218
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Contributor
|
✅ smoke-ci: safeoutputs CLI comment + comment-memory run (27652140271)
|
This was referenced Jun 16, 2026
Merged
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
Two related fixes to the safeoutputs integration:
Path fix (
e00e9395b,71bdb4eca,cec086741): Thesafe_outputs_mcp_server.cjsentrypoint was hardcoded to${GITHUB_WORKSPACE}/actions/setup/js/. This is corrected to${RUNNER_TEMP}/gh-aw/safeoutputs/, where the script is actually deployed at runtime. All MCP config renderers (JSON Copilot, JSON Claude, TOML) and their corresponding unit and integration tests are updated.Framing fix (
b57fdf2f1): Agent prompts and internal comments incorrectly described safeoutputs as an MCP tool interface. The MCP CLI tools prompt is rewritten to clarify that the listed servers are CLI executables invoked with--name valueflags or JSON via stdin, not MCP tool endpoints. The safe outputs prompt is updated to instruct agents to use thesafeoutputsCLI command. A write-intent warning is also added to the MCP CLI tools prompt.Changed files
pkg/workflow/mcp_renderer_builtin.go${GITHUB_WORKSPACE}/actions/setup/js/→${RUNNER_TEMP}/gh-aw/safeoutputs/for both JSON and TOML renderersactions/setup/md/mcp_cli_tools_prompt.md--name valueand JSON-stdin examples, added write-intent warningactions/setup/md/safe_outputs_prompt.mdsafeoutputsCLI command, not the MCP server tool interfacepkg/workflow/mcp_config_refactor_test.go${RUNNER_TEMP}/gh-aw/safeoutputs/pathpkg/workflow/mcp_renderer_test.gopkg/workflow/safe_outputs_mcp_integration_test.gopkg/workflow/prompts.goMotivation
The safeoutputs script is not present in
${GITHUB_WORKSPACE}/actions/setup/js/at agent runtime — it is installed under${RUNNER_TEMP}/gh-aw/safeoutputs/by the setup action. The mismatch meant the gateway config pointed to a non-existent path, silently breaking safeoutputs for any workflow using the built-in MCP renderer. The framing fix prevents agents from attempting to call safeoutputs as an MCP tool (which would also fail) instead of as a CLI command.Test coverage
mcp_config_refactor_test.goandmcp_renderer_test.gocover all rendered config formats.safe_outputs_mcp_integration_test.govalidates the path appears correctly in the generated workflow YAML end-to-end.Checklist
mcp_renderer_builtin.go)${RUNNER_TEMP}/gh-aw/safeoutputs/safe_outputs_mcp_server.cjsis reliably present after setup action runs