Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ai-moderator.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .github/workflows/smoke-codex.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions actions/setup/js/hide_comment.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions actions/setup/js/safe_outputs_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion actions/setup/js/types/safe-outputs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/guides/ephemerals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/reference/frontmatter-full.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/reference/safe-outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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`.
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

```yaml wrap
safe-outputs:
Expand Down
8 changes: 4 additions & 4 deletions pkg/parser/schemas/main_workflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"]
}
Comment on lines 7216 to 7222
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
},
"discussions": {
Expand Down
7 changes: 4 additions & 3 deletions pkg/workflow/js/safe_outputs_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/safe_outputs_validation_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
},
Expand Down