Skip to content

safeoutputs: improve submit_pull_request_review description to prevent empty-invocation ERR_VALIDATION#35060

Merged
pelikhan merged 2 commits into
mainfrom
copilot/improve-submit-pull-request-review-description
May 26, 2026
Merged

safeoutputs: improve submit_pull_request_review description to prevent empty-invocation ERR_VALIDATION#35060
pelikhan merged 2 commits into
mainfrom
copilot/improve-submit-pull-request-review-description

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 26, 2026

Agents were calling submit_pull_request_review with empty arguments {}, triggering ERR_VALIDATION because GitHub rejects contentless reviews with 422. The tool description didn't communicate the body-OR-prior-comments requirement, leaving agents unaware that an empty call is invalid.

Changes

  • Top-level description (submit_pull_request_review): Added explicit REQUIRED: constraint stating every call needs either a non-empty body or at least one preceding create_pull_request_review_comment call. Mentions ERR_VALIDATION by name. Adds an inline-only review example to close the ambiguity gap.

  • body field description: Replaced the misleading "optional for APPROVE and COMMENT" with the actual invariant — body is only optional when at least one create_pull_request_review_comment was called earlier in the same run; otherwise it is required.

Both the compiler copy (pkg/workflow/js/safe_outputs_tools.json) and the runtime copy (actions/setup/js/safe_outputs_tools.json) are updated identically.

…ation errors

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve submit_pull_request_review description to prevent empty-invocation errors safeoutputs: improve submit_pull_request_review description to prevent empty-invocation ERR_VALIDATION May 26, 2026
Copilot AI requested a review from pelikhan May 26, 2026 22:03
@pelikhan pelikhan marked this pull request as ready for review May 26, 2026 22:42
Copilot AI review requested due to automatic review settings May 26, 2026 22:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the submit_pull_request_review tool description in both the compiler and runtime copies of safe_outputs_tools.json to clarify that a non-empty body or at least one preceding create_pull_request_review_comment call is required, preventing agents from triggering ERR_VALIDATION with empty invocations.

Changes:

  • Expanded top-level tool description with explicit REQUIRED constraint, ERR_VALIDATION reference, and an inline-only example.
  • Updated body field description to reflect actual invariant (optional only when prior inline comments exist).
Show a summary per file
File Description
pkg/workflow/js/safe_outputs_tools.json Compiler-side tool description updated for clearer invocation contract.
actions/setup/js/safe_outputs_tools.json Runtime-side identical update to keep both copies in sync.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@pelikhan pelikhan merged commit 98430a0 into main May 26, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/improve-submit-pull-request-review-description branch May 26, 2026 22:50
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.

[safeoutputs] Improve submit_pull_request_review description to prevent empty-invocation errors

3 participants