Add LOW_QUALITY support to comment minimization reasons across safe outputs#27397
Add LOW_QUALITY support to comment minimization reasons across safe outputs#27397
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/8ada22c3-9cef-4ad6-9c14-56b0a96dbc07 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
🧪 Test Quality Sentinel ReportTest Quality Score: 50/100🔶 Needs Improvement
Test Classification Details
Flagged Tests — Requires Review
|
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for GitHub’s new LOW_QUALITY hide-comment classifier across gh-aw safe outputs (validation/runtime contract, schemas, tool definitions, types, docs, and regenerated lock workflows).
Changes:
- Extended
hide_comment.reasonvalidation to allowLOW_QUALITYin the safe-outputs runtime validation config. - Updated both safe-output tool definition JSONs, workflow/frontmatter schema enums, and JS type definitions to include the new classifier.
- Updated docs and regenerated affected workflow lock artifacts; added a JS unit test covering
LOW_QUALITY.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/safe_outputs_validation_config.go | Allows LOW_QUALITY in runtime validation for hide_comment.reason. |
| pkg/workflow/js/safe_outputs_tools.json | Updates hide_comment tool schema/description to include LOW_QUALITY (note: formatting issue flagged). |
| pkg/parser/schemas/main_workflow_schema.json | Extends safe-outputs.hide-comment.allowed-reasons enum/docs to include low_quality. |
| docs/src/content/docs/reference/safe-outputs.md | Documents low_quality as a hide-comment reason. |
| docs/src/content/docs/reference/frontmatter-full.md | Updates frontmatter reference comments to include low_quality. |
| actions/setup/js/types/safe-outputs.d.ts | Extends HideCommentItem.reason union with LOW_QUALITY. |
| actions/setup/js/safe_outputs_tools.json | Extends tool schema enum/description with LOW_QUALITY. |
| actions/setup/js/hide_comment.test.cjs | Adds test ensuring low_quality maps through to LOW_QUALITY. |
| .github/workflows/smoke-codex.lock.yml | Regenerated lock artifact reflecting updated tool enum. |
| .github/workflows/ai-moderator.lock.yml | Regenerated lock artifact reflecting updated tool enum. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 9/10 changed files
- Comments generated: 3
| { | ||
| "name": "hide_comment", | ||
| "description": "Hide a comment on a GitHub issue, pull request, or discussion. This collapses the comment and marks it as spam, abuse, off-topic, outdated, or resolved. Use this for inappropriate, off-topic, or outdated comments. The comment_id must be a GraphQL node ID (string like 'IC_kwDOABCD123456'), not a numeric REST API comment ID. NOTE: By default, this tool requires discussions:write permission. If your GitHub App lacks Discussions permission, set 'discussions: false' in the workflow's safe-outputs.hide-comment configuration to exclude this permission.", | ||
| "description": "Hide a comment on a GitHub issue, pull request, or discussion. This collapses the comment and marks it as spam, abuse, off-topic, outdated, resolved, or low-quality. Use this for inappropriate, off-topic, or outdated comments. The comment_id must be a GraphQL node ID (string like 'IC_kwDOABCD123456'), not a numeric REST API comment ID. NOTE: By default, this tool requires discussions:write permission. If your GitHub App lacks Discussions permission, set 'discussions: false' in the workflow's safe-outputs.hide-comment configuration to exclude this permission.", |
There was a problem hiding this comment.
In pkg/workflow/js/safe_outputs_tools.json, the hide_comment tool entry has inconsistent indentation for the "description" key compared to the rest of the file (it’s indented far deeper than "name" and the other tool entries). Even though it’s valid JSON, this looks like an accidental formatting artifact and makes future diffs/noise more likely—please reformat this object to match the surrounding style (align "description" with "name").
| "description": "Hide a comment on a GitHub issue, pull request, or discussion. This collapses the comment and marks it as spam, abuse, off-topic, outdated, resolved, or low-quality. Use this for inappropriate, off-topic, or outdated comments. The comment_id must be a GraphQL node ID (string like 'IC_kwDOABCD123456'), not a numeric REST API comment ID. NOTE: By default, this tool requires discussions:write permission. If your GitHub App lacks Discussions permission, set 'discussions: false' in the workflow's safe-outputs.hide-comment configuration to exclude this permission.", | |
| "description": "Hide a comment on a GitHub issue, pull request, or discussion. This collapses the comment and marks it as spam, abuse, off-topic, outdated, resolved, or low-quality. Use this for inappropriate, off-topic, or outdated comments. The comment_id must be a GraphQL node ID (string like 'IC_kwDOABCD123456'), not a numeric REST API comment ID. NOTE: By default, this tool requires discussions:write permission. If your GitHub App lacks Discussions permission, set 'discussions: false' in the workflow's safe-outputs.hide-comment configuration to exclude this permission.", |
| "allowed-reasons": { | ||
| "type": "array", | ||
| "description": "List of allowed reasons for hiding comments. Default: all reasons allowed (spam, abuse, off_topic, outdated, resolved).", | ||
| "description": "List of allowed reasons for hiding comments. Default: all reasons allowed (spam, abuse, off_topic, outdated, resolved, low_quality).", | ||
| "items": { | ||
| "type": "string", | ||
| "enum": ["spam", "abuse", "off_topic", "outdated", "resolved"] | ||
| "enum": ["spam", "abuse", "off_topic", "outdated", "resolved", "low_quality"] | ||
| } |
There was a problem hiding this comment.
The schema update adds low_quality for safe-outputs.hide-comment.allowed-reasons, but safe-outputs.add-comment.allowed-reasons (used for hide-older-comments minimization reasons) still only allows [spam, abuse, off_topic, outdated, resolved]. Since add_comment’s hide-older-comments path also calls GitHub’s minimizeComment with ReportedContentClassifiers, it should accept LOW_QUALITY too for consistency/end-to-end support. Please extend the add-comment.allowed-reasons enum + description accordingly.
| ### Hide Comment (`hide-comment:`) | ||
|
|
||
| Collapses comments in GitHub UI with reason. Requires GraphQL node IDs (e.g., `IC_kwDOABCD123456`), not REST numeric IDs. Reasons: `spam`, `abuse`, `off_topic`, `outdated`, `resolved`. | ||
| Collapses comments in GitHub UI with reason. Requires GraphQL node IDs (e.g., `IC_kwDOABCD123456`), not REST numeric IDs. Reasons: `spam`, `abuse`, `off_topic`, `outdated`, `resolved`, `low_quality`. |
There was a problem hiding this comment.
Docs update the hide-comment reasons list to include low_quality, but the earlier “Hide Older Comments” section (add-comment.hide-older-comments) still lists allowed reasons without low_quality. Since the implementation uppercases and forwards the classifier to minimizeComment, LOW_QUALITY is supported there too—please update the hide-older-comments reason list to keep docs consistent.
There was a problem hiding this comment.
✅ Test Quality Sentinel: 50/100. Test quality is acceptable — 0% of new tests are implementation tests (threshold: 30%). The single new test correctly covers the LOW_QUALITY behavioral contract. See the comment above for suggestions to strengthen coverage with return-value assertions and an error/edge case.
|
@copilot review all comments |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/932321fa-7ac4-4180-a18b-b3bae4f4959b Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done — I addressed the review comments in ee9671f. Changes included:
Validation:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Hey The PR is thorough: runtime validation, both tool definition JSONs, the frontmatter schema, TypeScript types, reference docs, and the two regenerated lock files are all updated consistently. The new test in One minor nit worth a follow-up: in This looks ready for maintainer review! 🟢
|
GitHub added a new comment minimization classifier (
LOW_QUALITY) in the moderation menu. This PR updates gh-aw safe outputs so workflows and emitted actions can use that classifier consistently end-to-end.Runtime + validation contract
LOW_QUALITYtohide_comment.reasonvalidation in safe output runtime config.Schema + tool definition updates
safe-outputs.hide-comment.allowed-reasonssafe-outputs.add-comment.allowed-reasons(forhide-older-comments)low_quality.Type surface updates
HideCommentItem.reasonto includeLOW_QUALITY.Docs + generated workflow artifacts
pkg/workflow/js/safe_outputs_tools.jsonfor thehide_commenttool entry.{ "type": "hide_comment", "comment_id": "IC_kwDOABCD123456", "reason": "LOW_QUALITY" }