From 74d4375016e43345891b14da41a27c869e7f8ac9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 15:26:17 +0000 Subject: [PATCH 1/2] feat: add LOW_QUALITY support for hide_comment reasons 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> --- .github/workflows/ai-moderator.lock.yml | 3 ++- .github/workflows/smoke-codex.lock.yml | 3 ++- actions/setup/js/hide_comment.test.cjs | 9 +++++++++ actions/setup/js/safe_outputs_tools.json | 6 +++--- actions/setup/js/types/safe-outputs.d.ts | 2 +- docs/src/content/docs/reference/frontmatter-full.md | 2 +- docs/src/content/docs/reference/safe-outputs.md | 2 +- pkg/parser/schemas/main_workflow_schema.json | 4 ++-- pkg/workflow/js/safe_outputs_tools.json | 7 ++++--- pkg/workflow/safe_outputs_validation_config.go | 2 +- 10 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ai-moderator.lock.yml b/.github/workflows/ai-moderator.lock.yml index d7219d2aecd..7e8551a43b9 100644 --- a/.github/workflows/ai-moderator.lock.yml +++ b/.github/workflows/ai-moderator.lock.yml @@ -504,7 +504,8 @@ jobs: "ABUSE", "OFF_TOPIC", "OUTDATED", - "RESOLVED" + "RESOLVED", + "LOW_QUALITY" ] }, "repo": { diff --git a/.github/workflows/smoke-codex.lock.yml b/.github/workflows/smoke-codex.lock.yml index ade71dd91d6..64cc46f9a38 100644 --- a/.github/workflows/smoke-codex.lock.yml +++ b/.github/workflows/smoke-codex.lock.yml @@ -679,7 +679,8 @@ jobs: "ABUSE", "OFF_TOPIC", "OUTDATED", - "RESOLVED" + "RESOLVED", + "LOW_QUALITY" ] }, "repo": { diff --git a/actions/setup/js/hide_comment.test.cjs b/actions/setup/js/hide_comment.test.cjs index b4dbf3d809d..d51abca7e00 100644 --- a/actions/setup/js/hide_comment.test.cjs +++ b/actions/setup/js/hide_comment.test.cjs @@ -89,6 +89,15 @@ describe("hide_comment.cjs", () => { expect(mockGithub.graphql).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({ classifier: "ABUSE" })); }); + it("should pass through LOW_QUALITY reason", async () => { + const { main } = await loadModule(); + const handler = await main(); + + await handler({ comment_id: "IC_kwDOABCD123456", reason: "low_quality" }, {}); + + expect(mockGithub.graphql).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({ classifier: "LOW_QUALITY" })); + }); + it("should fail when comment_id is missing", async () => { const { main } = await loadModule(); const handler = await main(); diff --git a/actions/setup/js/safe_outputs_tools.json b/actions/setup/js/safe_outputs_tools.json index 51594c0c98a..e6c0cc60e06 100644 --- a/actions/setup/js/safe_outputs_tools.json +++ b/actions/setup/js/safe_outputs_tools.json @@ -1024,7 +1024,7 @@ }, { "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.", + "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.", "inputSchema": { "type": "object", "required": ["comment_id"], @@ -1035,8 +1035,8 @@ }, "reason": { "type": "string", - "enum": ["SPAM", "ABUSE", "OFF_TOPIC", "OUTDATED", "RESOLVED"], - "description": "Optional reason for hiding the comment. Defaults to SPAM if not provided. Valid values: SPAM (spam content), ABUSE (abusive/harassment content), OFF_TOPIC (not relevant to discussion), OUTDATED (no longer applicable), RESOLVED (issue/question has been resolved)." + "enum": ["SPAM", "ABUSE", "OFF_TOPIC", "OUTDATED", "RESOLVED", "LOW_QUALITY"], + "description": "Optional reason for hiding the comment. Defaults to SPAM if not provided. Valid values: SPAM (spam content), ABUSE (abusive/harassment content), OFF_TOPIC (not relevant to discussion), OUTDATED (no longer applicable), RESOLVED (issue/question has been resolved), LOW_QUALITY (low-quality content)." }, "secrecy": { "type": "string", diff --git a/actions/setup/js/types/safe-outputs.d.ts b/actions/setup/js/types/safe-outputs.d.ts index d509c4e7f4c..e2be3a74a1a 100644 --- a/actions/setup/js/types/safe-outputs.d.ts +++ b/actions/setup/js/types/safe-outputs.d.ts @@ -352,7 +352,7 @@ interface HideCommentItem extends BaseSafeOutputItem { /** GraphQL node ID of the comment to hide (e.g., 'IC_kwDOABCD123456') */ comment_id: string; /** Optional reason for hiding the comment (default: SPAM) */ - reason?: "SPAM" | "ABUSE" | "OFF_TOPIC" | "OUTDATED" | "RESOLVED"; + reason?: "SPAM" | "ABUSE" | "OFF_TOPIC" | "OUTDATED" | "RESOLVED" | "LOW_QUALITY"; } /** diff --git a/docs/src/content/docs/reference/frontmatter-full.md b/docs/src/content/docs/reference/frontmatter-full.md index 8647effe0f4..f8e0b3ca6d2 100644 --- a/docs/src/content/docs/reference/frontmatter-full.md +++ b/docs/src/content/docs/reference/frontmatter-full.md @@ -4768,7 +4768,7 @@ safe-outputs: target-repo: "example-value" # List of allowed reasons for hiding comments. Default: all reasons allowed (spam, - # abuse, off_topic, outdated, resolved). + # abuse, off_topic, outdated, resolved, low_quality). # (optional) allowed-reasons: [] # Array of strings diff --git a/docs/src/content/docs/reference/safe-outputs.md b/docs/src/content/docs/reference/safe-outputs.md index 644d5ebeee6..9138cc05999 100644 --- a/docs/src/content/docs/reference/safe-outputs.md +++ b/docs/src/content/docs/reference/safe-outputs.md @@ -261,7 +261,7 @@ When enabled, the workflow completion notifier creates a new comment instead of ### 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`. ```yaml wrap safe-outputs: diff --git a/pkg/parser/schemas/main_workflow_schema.json b/pkg/parser/schemas/main_workflow_schema.json index 09c87aa5414..05f24ae538f 100644 --- a/pkg/parser/schemas/main_workflow_schema.json +++ b/pkg/parser/schemas/main_workflow_schema.json @@ -7215,10 +7215,10 @@ }, "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"] } }, "discussions": { diff --git a/pkg/workflow/js/safe_outputs_tools.json b/pkg/workflow/js/safe_outputs_tools.json index f8428359712..fca2ca4a913 100644 --- a/pkg/workflow/js/safe_outputs_tools.json +++ b/pkg/workflow/js/safe_outputs_tools.json @@ -1159,7 +1159,7 @@ }, { "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.", "inputSchema": { "type": "object", "required": [ @@ -1177,9 +1177,10 @@ "ABUSE", "OFF_TOPIC", "OUTDATED", - "RESOLVED" + "RESOLVED", + "LOW_QUALITY" ], - "description": "Optional reason for hiding the comment. Defaults to SPAM if not provided. Valid values: SPAM (spam content), ABUSE (abusive/harassment content), OFF_TOPIC (not relevant to discussion), OUTDATED (no longer applicable), RESOLVED (issue/question has been resolved)." + "description": "Optional reason for hiding the comment. Defaults to SPAM if not provided. Valid values: SPAM (spam content), ABUSE (abusive/harassment content), OFF_TOPIC (not relevant to discussion), OUTDATED (no longer applicable), RESOLVED (issue/question has been resolved), LOW_QUALITY (low-quality content)." }, "secrecy": { "type": "string", diff --git a/pkg/workflow/safe_outputs_validation_config.go b/pkg/workflow/safe_outputs_validation_config.go index 88751ca7ebb..422198507dc 100644 --- a/pkg/workflow/safe_outputs_validation_config.go +++ b/pkg/workflow/safe_outputs_validation_config.go @@ -354,7 +354,7 @@ var ValidationConfig = map[string]TypeValidationConfig{ DefaultMax: 5, Fields: map[string]FieldValidation{ "comment_id": {Required: true, Type: "string", MaxLength: 256}, - "reason": {Type: "string", Enum: []string{"SPAM", "ABUSE", "OFF_TOPIC", "OUTDATED", "RESOLVED"}}, + "reason": {Type: "string", Enum: []string{"SPAM", "ABUSE", "OFF_TOPIC", "OUTDATED", "RESOLVED", "LOW_QUALITY"}}, "repo": {Type: "string", MaxLength: 256}, // Optional: target repository in format "owner/repo" }, }, From ee9671f5e10b9e40f71ce5e68d8a95db1cdf5a96 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 17:20:39 +0000 Subject: [PATCH 2/2] fix: address follow-up review comments for low_quality reasons 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> --- docs/src/content/docs/guides/ephemerals.md | 2 +- docs/src/content/docs/reference/frontmatter-full.md | 2 +- docs/src/content/docs/reference/safe-outputs.md | 2 +- pkg/parser/schemas/main_workflow_schema.json | 4 ++-- pkg/workflow/js/safe_outputs_tools.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/src/content/docs/guides/ephemerals.md b/docs/src/content/docs/guides/ephemerals.md index 7975b45985c..def487ef571 100644 --- a/docs/src/content/docs/guides/ephemerals.md +++ b/docs/src/content/docs/guides/ephemerals.md @@ -181,7 +181,7 @@ safe-outputs: allowed-reasons: [outdated] # Optional: restrict hiding reasons ``` -Before posting, the system finds and minimizes previous comments from the same workflow (identified by `GITHUB_WORKFLOW`). Comments are hidden, not deleted. Use `allowed-reasons` to restrict which minimization reason is applied: `spam`, `abuse`, `off_topic`, `outdated` (default), or `resolved`. Useful for status updates, build notifications, and health checks where only the latest result matters. +Before posting, the system finds and minimizes previous comments from the same workflow (identified by `GITHUB_WORKFLOW`). Comments are hidden, not deleted. Use `allowed-reasons` to restrict which minimization reason is applied: `spam`, `abuse`, `off_topic`, `outdated` (default), `resolved`, or `low_quality`. Useful for status updates, build notifications, and health checks where only the latest result matters. See [Safe Outputs Reference](/gh-aw/reference/safe-outputs/#hide-older-comments) for complete documentation. diff --git a/docs/src/content/docs/reference/frontmatter-full.md b/docs/src/content/docs/reference/frontmatter-full.md index f8e0b3ca6d2..63b18513156 100644 --- a/docs/src/content/docs/reference/frontmatter-full.md +++ b/docs/src/content/docs/reference/frontmatter-full.md @@ -3322,7 +3322,7 @@ safe-outputs: # List of allowed reasons for hiding older comments when hide-older-comments is # enabled. Default: all reasons allowed (spam, abuse, off_topic, outdated, - # resolved). + # resolved, low_quality). # (optional) allowed-reasons: [] # Array of strings diff --git a/docs/src/content/docs/reference/safe-outputs.md b/docs/src/content/docs/reference/safe-outputs.md index 9138cc05999..cfe428926d0 100644 --- a/docs/src/content/docs/reference/safe-outputs.md +++ b/docs/src/content/docs/reference/safe-outputs.md @@ -243,7 +243,7 @@ The author of the parent issue, PR, or discussion receiving the comment is autom #### Hide Older Comments -Set `hide-older-comments: true` to minimize previous comments from the same workflow (identified by `GITHUB_WORKFLOW`) before posting new ones. Useful for status updates. Allowed reasons: `spam`, `abuse`, `off_topic`, `outdated` (default), `resolved`. +Set `hide-older-comments: true` to minimize previous comments from the same workflow (identified by `GITHUB_WORKFLOW`) before posting new ones. Useful for status updates. Allowed reasons: `spam`, `abuse`, `off_topic`, `outdated` (default), `resolved`, `low_quality`. #### Append-Only Status Comments diff --git a/pkg/parser/schemas/main_workflow_schema.json b/pkg/parser/schemas/main_workflow_schema.json index 05f24ae538f..6bb93eb9f87 100644 --- a/pkg/parser/schemas/main_workflow_schema.json +++ b/pkg/parser/schemas/main_workflow_schema.json @@ -5672,10 +5672,10 @@ }, "allowed-reasons": { "type": "array", - "description": "List of allowed reasons for hiding older comments when hide-older-comments is enabled. Default: all reasons allowed (spam, abuse, off_topic, outdated, resolved).", + "description": "List of allowed reasons for hiding older comments when hide-older-comments is enabled. 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"] } }, "discussions": { diff --git a/pkg/workflow/js/safe_outputs_tools.json b/pkg/workflow/js/safe_outputs_tools.json index fca2ca4a913..49927b89377 100644 --- a/pkg/workflow/js/safe_outputs_tools.json +++ b/pkg/workflow/js/safe_outputs_tools.json @@ -1159,7 +1159,7 @@ }, { "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, 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.", "inputSchema": { "type": "object", "required": [