Add noop safe output for transparent workflow completion#4286
Conversation
…validation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot default max is 1 |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot continue work |
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
|
@copilot max should be 1 |
…ob and fix test workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Continued the work and completed the implementation in commit 0330244. All requested changes have been addressed:
The conclusion job now loads agent output and appends noop messages to the completion status comment when present.
Fixed in commit 0330244. Default max for noop is now 1 across all files:
|
|
Agentic Changeset Generator triggered by this pull request. |
|
@copilot the conclusion job should always be generated so that no-ops can be handled |
…handle noop messages Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit 34bfcca. The conclusion job is now always generated when safe-outputs exist (because noop is auto-enabled as a fallback). Key changes:
Behavior:
All tests pass and 80/80 workflows compile successfully. |
|
Agentic Changeset Generator triggered by this pull request. |
|
@copilot make sure load_agent_output.cjs is inlined by the bundler See error trace at https://github.com/githubnext/gh-aw/actions/runs/19478013400/job/55742960695#step:5:1 |
|
@copilot make sure load_agent_output.cjs is inlined by the bundler See error trace at https://github.com/githubnext/gh-aw/actions/runs/19478013400/job/55742960695#step:5:1 |
…ript Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot make sure the no-op tool is defined in the safe output tools.JSON |
Fixed in commit 1934f80. Changes:
Verification:
The bundler now automatically inlines |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit 3901953. Changes:
Verification:
|
|
✅ Agentic Changeset Generator completed successfully. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new "noop" (no-operation) safe output type that allows AI agents to produce human-visible artifacts when no significant actions are required, ensuring workflows never complete silently. The noop output is automatically enabled by default when safe-outputs are configured, providing a transparent fallback mechanism.
Key Changes
- Added noop schema definition with required message field and comprehensive validation
- Implemented noop processing in conclusion job with dual-mode support (activation comment vs step summary)
- Integrated noop tool into MCP server for AI agent discoverability
- Updated conclusion job logic to always run when safe-outputs exist (not just when activation comments are configured)
Reviewed Changes
Copilot reviewed 93 out of 95 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
schemas/agent-output.json |
Added NoOpOutput schema definition with required message field |
pkg/workflow/scripts.go |
Added bundling support for notify_comment_error script to inline load_agent_output dependency |
pkg/workflow/safe_outputs_tools_test.go |
Updated test expectations to include noop in tool list |
pkg/workflow/safe_outputs.go |
Added auto-enable logic for noop (enabled by default when safe-outputs exist) and MCP tool filtering |
pkg/workflow/reaction_none_test.go |
Updated test to expect conclusion job creation when safe-outputs exist |
pkg/workflow/notify_comment_test.go |
Updated tests to reflect that conclusion job is always created when safe-outputs exist |
pkg/workflow/notify_comment.go |
Changed conclusion job creation logic to always run when safe-outputs exist (not requiring activation comment) |
pkg/workflow/noop.go |
Implemented noop configuration parser with default max of 1 |
pkg/workflow/js/types/safe-outputs.d.ts |
Added NoOpItem TypeScript interface |
pkg/workflow/js/types/safe-outputs-config.d.ts |
Added NoOpConfig TypeScript interface |
pkg/workflow/js/safe_outputs_tools.json |
Added noop tool definition for MCP integration |
pkg/workflow/js/notify_comment_error.cjs |
Enhanced to process noop messages with dual-mode handling (comment update or step summary) |
pkg/workflow/js/noop.test.cjs |
Comprehensive test coverage for noop processing including staged mode, sanitization, and multiple messages |
pkg/workflow/js/noop.cjs |
Main noop implementation with message processing and step summary generation |
pkg/workflow/js/collect_ndjson_output.test.cjs |
Added validation tests for noop output including message requirements and sanitization |
pkg/workflow/js/collect_ndjson_output.cjs |
Added noop validation case with message sanitization and default max of 1 |
pkg/workflow/js.go |
Added embedded noop script variable |
pkg/workflow/compiler.go |
Added NoOp field to SafeOutputsConfig struct |
pkg/workflow/comment_env_vars_conditional_test.go |
Updated tests to reflect that conclusion job always has comment env vars when safe-outputs exist |
pkg/parser/schemas/main_workflow_schema.json |
Added noop schema definition with configuration options |
pkg/cli/workflows/test-copilot-noop.md |
Added test workflow for Copilot engine |
pkg/cli/workflows/test-codex-noop.md |
Added test workflow for Codex engine |
pkg/cli/workflows/test-claude-noop.md |
Added test workflow for Claude engine |
.github/workflows/*.lock.yml |
Updated all compiled workflows to include noop tool and conclusion job with bundled load_agent_output |
.changeset/patch-add-noop-safe-output.md |
Added changeset for patch release |
Comments suppressed due to low confidence (2)
pkg/workflow/js/notify_comment_error.cjs:1
- Incorrect property access:
loadAgentOutput()returns{ success, items }but the code checks foragentOutputResult.data. This should beagentOutputResult.itemsto match the return structure.
pkg/workflow/js/notify_comment_error.cjs:1 - Same incorrect property access pattern: should be
agentOutputResult.itemsinstead ofagentOutputResult.datato match the return structure fromloadAgentOutput().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add documentation for three new features merged in the last 24 hours: 1. Update-release safe output (PR #4278) - Added to safe outputs table - Full documentation with operations (replace, append, prepend) - Agent output format examples - Configuration options 2. No-op safe output (PR #4286) - Added to safe outputs table - Documentation explaining transparency and auto-enable - Agent output format examples - Use cases for silent completion prevention 3. Skip-if-match trigger condition (PR #4287) - Added to triggers reference - How it works explanation - Three common use case examples - GitHub search query integration details 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Agents need to emit human-visible artifacts even when no actions are required (e.g., "No issues found"). The noop safe output provides a fallback mechanism ensuring workflows never complete silently.
Changes
Schema & Types
NoOpOutputschema definition with requiredmessagefieldNoOpItem,NoOpConfig) for type safetynoopconfigurationJavaScript Implementation
collect_ndjson_output.cjs: Validation case with message sanitization (neutralizes @mentions, etc.)notify_comment_error.cjs: Integrated noop message display into conclusion job with dual-mode handling:notify_comment_error.cjsfromjs.gotoscripts.goto enable proper bundling ofload_agent_output.cjsdependency. The bundler now inlines all required modules directly into compiled workflows, eliminating runtime require() errors.Go Integration
noop.go: Configuration parser with default max of 1safe_outputs.go: Auto-enable logic - noop enabled by default when safe-outputs exists; added noop to tool filtering logic for MCP integrationnotify_comment.go: Updated to always generate conclusion job when safe-outputs exist (not just when activation comments are present)scripts.go: AddedgetNotifyCommentErrorScript()bundling function with lazy bundling and caching, following the same pattern as other bundled scriptsMCP Integration
safe_outputs_tools.json: Added noop tool definition with proper schema for MCP server integrationmessagefield required)Architecture
Noop messages are processed in the conclusion job (not as a separate job). The conclusion job is now always generated when safe-outputs exist, ensuring noop messages can be handled regardless of whether activation comments are configured.
Behavior:
This guarantees that noop messages are always visible somewhere, preventing silent workflow completion.
Bundling Implementation
The
notify_comment_error.cjsscript usesrequire("./load_agent_output.cjs")to load agent output artifacts. To ensure this works in GitHub Actions runtime:scripts.go(bundled scripts) fromjs.go(standalone scripts)load_agent_output.cjscontent directly into the compiled workflowUsage
Noop is always available as a fallback and integrates with the conclusion job to ensure human-visible artifacts are produced in all scenarios. The tool is automatically exposed through the safe outputs MCP server for AI agent discovery.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.