Add SafeOutput for reply to PR Review Comment#15691
Conversation
…-review-comment Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # actions/setup/js/safe_output_handler_manager.cjs # actions/setup/js/safe_output_unified_handler_manager.cjs # actions/setup/js/safe_outputs_tools.json # actions/setup/js/types/safe-outputs-config.d.ts # docs/src/content/docs/reference/frontmatter-full.md # docs/src/content/docs/reference/safe-outputs.md # pkg/parser/schemas/main_workflow_schema.json # pkg/workflow/compiler_safe_outputs_config.go # pkg/workflow/compiler_safe_outputs_job.go # pkg/workflow/compiler_types.go # pkg/workflow/imports.go # pkg/workflow/js/safe_outputs_tools.json # pkg/workflow/safe_output_validation_config.go # pkg/workflow/safe_outputs_config.go # pkg/workflow/safe_outputs_config_generation.go # pkg/workflow/safe_outputs_config_helpers_reflection.go # pkg/workflow/safe_outputs_permissions.go # pkg/workflow/safe_outputs_tools_test.go # pkg/workflow/tool_description_enhancer.go # schemas/agent-output.json
There was a problem hiding this comment.
Pull request overview
This PR adds SafeOutput support for replying to existing pull request review comments, enabling agents to respond to reviewer feedback through standard GitHub PR comment mechanisms. The implementation follows established patterns in the codebase and includes comprehensive test coverage.
Changes:
- Adds
reply-to-pull-request-review-commentsafe output type with configuration for max replies, target PR, cross-repository support, and optional footer control - Implements JavaScript handler using GitHub's REST API
createReplyForReviewCommentwith validation, target resolution, and PR context detection - Includes full schema definitions, TypeScript types, Go configuration parsing, and documentation
Reviewed changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/agent-output.json | Adds JSON schema for reply_to_pull_request_review_comment output type with comment_id, body, and optional pull_request_number fields |
| pkg/parser/schemas/main_workflow_schema.json | Adds configuration schema with max, target, target-repo, allowed-repos, footer, and github-token options |
| pkg/workflow/reply_to_pr_review_comment.go | Implements Go config parser with footer (*bool), target, and repository options |
| pkg/workflow/compiler_types.go | Adds ReplyToPullRequestReviewCommentConfig to SafeOutputsConfig struct |
| pkg/workflow/safe_outputs_*.go | Integrates new output type across config extraction, validation, permissions, imports, and handler registry |
| pkg/workflow/tool_description_enhancer.go | Adds max constraint description for the reply tool |
| pkg/workflow/safe_output_validation_config.go | Adds validation rules for comment_id, body, and pull_request_number fields |
| actions/setup/js/reply_to_pr_review_comment.cjs | Implements handler factory with validation, target resolution, PR context checking, and API integration |
| actions/setup/js/reply_to_pr_review_comment.test.cjs | Comprehensive test suite covering success cases, validation, context handling, and error scenarios |
| actions/setup/js/safe_outputs_tools.json | Adds tool definition for AI agent consumption |
| actions/setup/js/safe_output_*_handler_manager.cjs | Registers handler in both handler managers |
| actions/setup/js/types/*.d.ts | Adds TypeScript type definitions for the new output item and config |
| docs/src/content/docs/reference/*.md | Documents the new feature with configuration examples and usage guidelines |
| .devcontainer/devcontainer.json | Adds permissions for strawgate/gh-aw repository (appears unrelated to PR purpose) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
So many files... needs a major cleanup eventually |
|
merge main, recompile, lint, fix tests |
|
I think the linting/testing issues are issues on main |
|
Yes fixing |
|
main is clean |
|
there is one failure related to docker, but it is otherwise clean. run |
|
Should be clean now. You can also ask your agent to validate your safe output against the specification. |
|
make agent-finish has no changes. Spec passes. Would you like me to add a reply_to_pull_request_review_comment section to the spec? |
|
Yes. Use the w3c-spec-writer agent to update the spec |
|
added spec |
|
👀 |
|
Those errors are mine. |
|
not all of them it would appear 😢 |
Closes #15576