Skip to content

[safeoutputs] Disambiguate field names and document constraints for create_code_scanning_alert, push_to_pull_request_branch, noop, create_disc [Content truncated due to length] #37409

Description

@github-actions

Analysis of agentic workflow runs from the last 24 hours (75 runs, about 40 with safe-output activity) surfaced 6 safe-output schema rejections at the MCP server (captured in rpc-messages.jsonl as rpc_response.error). Four are tool-description gaps: the field name or constraint the agent intuitively reaches for is not disambiguated by the description. None duplicate the open issues (the create_discussion parameter-wrapping issue from 2026-06-05 or the submit_pull_request_review targeting-field issue from 2026-06-02).

The fix style is the one already used for issue_number to item_number, category_id to category, and the name-on-create_check_run cases: an explicit "this field is named X, NOT Y" note in the field description.

Summary

Tool Agent sent Schema expects Type Source
create_code_scanning_alert level severity wrong field Smoke Claude (test)
push_to_pull_request_branch commit_message message wrong field Smoke Claude (test)
noop structured metric fields message (string) missing required field PR Sous Chef (prod)
create_discussion body over 10 KB body 10 KB or less undocumented constraint 2 prod report workflows

All six agents received an instructive error and, except the noop case, recovered. So this is about cutting avoidable round-trips and the one noop run that ended on the rejection, not about hard failures.

Honest scoping note

Two of the four (level, commit_message) come from Smoke Claude, a test harness that deliberately exercises every safe-output tool with dummy data, so they are single-run, test-context evidence. They are included because the field-name choice was the agent own decision (the prompt does not dictate it), which is exactly the disambiguation signal we act on. The noop and create_discussion gaps are from production workflows and are the higher-priority items.

Error Pattern Details and Evidence

Pattern 1 - create_code_scanning_alert: level used instead of severity. Run 27067065704 (https://github.com/github/gh-aw/actions/runs/27067065704, Smoke Claude, claude). Sent file=README.md, level=warning, line=1, message=dummy. Server returned: Invalid arguments: missing or empty severity. The word level is a near-universal synonym for severity (Python logging, syslog, most linters); the severity field description lists the enum but does not warn against level.

Pattern 2 - push_to_pull_request_branch: commit_message used instead of message. Run 27067065704 (same run). Sent commit_message=test add smoke test file, pr_number=37338. Server returned: Invalid arguments: missing or empty message. The field is named message but its description reads "Commit message describing the changes", so the agent reaches for commit_message (also the git and GitHub API convention).

Pattern 3 - noop: structured summary fields instead of the required message string. Run 27067988983 (https://github.com/github/gh-aw/actions/runs/27067988983, PR Sous Chef, copilot/gpt-5-mini). Sent branch_update_attempts, formatter_pushes, nudged_other, nudged_review_comments, processed, skipped, and more, with no message. Server returned: Invalid arguments: missing or empty message. The same workflow in run 27073954344 (https://github.com/github/gh-aw/actions/runs/27073954344) did it correctly by serializing the summary into the message string. So the tool works fine when the agent serializes; a description nudge should close the gap.

Pattern 4 - create_discussion: body exceeds the undocumented 10 KB limit. Two distinct production report workflows in the same window: run 27070604637 (https://github.com/github/gh-aw/actions/runs/27070604637, Copilot Agent PR Analysis, claude) body 13712 bytes; run 27067333745 (https://github.com/github/gh-aw/actions/runs/27067333745, Daily Security Observability Report, copilot/claude-sonnet-4.6) body 10620 bytes. Server returned: Input string parameter(s) exceed the 10 KB limit for tool create_discussion: body N bytes. The create_discussion body field documents no size limit, whereas add_comment documents its 65536-character limit inline. Report-generating workflows naturally produce bodies over 10 KB.

Recommended Improvements

All edits in pkg/workflow/js/safe_outputs_tools.json, then propagate the identical change to the runtime copy actions/setup/js/safe_outputs_tools.json (per the 2026-05-30 deployment-gap lesson, both copies must stay in sync).

  1. create_code_scanning_alert.severity - append: This field is named severity, NOT level.
  2. push_to_pull_request_branch.message - append: This field is named message, NOT commit_message.
  3. noop.message - append: This is the only content field noop accepts. Serialize any metrics or structured run summary into this single string; additional named fields (for example processed, skipped) are not accepted and cause a missing-message error.
  4. create_discussion.body - append: Maximum 10 KB (10240 bytes). If your content is larger, trim it, link out to a gist or artifact, or attach it via upload_asset rather than inlining. Mirror the inline-limit style already used by add_comment.

Root Cause

Each gap is the same class: the description omits the one disambiguation or constraint the agent then violates. The level and commit_message synonyms and the absent size limit are all predictable from common API conventions, and the established remediation (explicit named-X-not-Y notes) has worked for the prior issue_number, category_id, and name cases.

Implementation Checklist

  • Update the 4 field descriptions in pkg/workflow/js/safe_outputs_tools.json
  • Propagate identical changes to actions/setup/js/safe_outputs_tools.json
  • Run make build and make recompile
  • Run make test (including the tools-JSON sync test)
  • Monitor rpc-messages.jsonl rejections for these 4 tools over the next 2-3 days

Notes and Out of Scope

  • submit_pull_request_review empty-body rejection (Matt Pocock Skills Reviewer, run 27068395228) - existing ERR_VALIDATION message is already clear; tracked, no change.
  • Empty-argument discovery probes (PR Code Quality Reviewer, run 27066992596) - known probe pattern; message already optimal; not actionable.
  • mcpscripts query-script failures (run 27073816278) - command failures, not safe-output schema errors; out of scope.

References: run 27067988983, run 27070604637, run 27067065704.

Generated by ⚡ Daily Safe Output Tool Optimizer · 606 AIC · ⌖ 32.7 AIC · ⊞ 10.5K ambient context ·

  • expires on Jun 8, 2026, 9:34 PM UTC

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions