-
Notifications
You must be signed in to change notification settings - Fork 34
Add minimize-comment safe output type for GraphQL-based comment moderation #5911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Updated JSON schema with MinimizeCommentOutput definition - Added TypeScript types for MinimizeCommentItem - Updated safe_outputs_tools.json with minimize_comment tool signature - Created minimize_comment.cjs JavaScript implementation with GraphQL mutation - Created minimize_comment.test.cjs with comprehensive tests - Added MinimizeCommentConfig to Go types - Created minimize_comment.go with job builder - Updated safe_outputs.go to include minimize_comment in enabledTools and HasSafeOutputsEnabled - Updated compiler_jobs.go to build minimize_comment job - Integrated minimize_comment parser in extractSafeOutputsConfig Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Added minimize_comment to expectedTools list in safe_outputs_tools_test.go - Fixed script registration in scripts.go - All tests now passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Updated main_workflow_schema.json with minimize-comment configuration - Created test workflows for copilot, claude, and codex engines - All tests passing - Workflows compile successfully Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Remove unused getRepositoryUrl import from minimize_comment.cjs - Add support for numeric comment_id values (convert to string for GraphQL) - Improve error messages to be more descriptive - All tests still passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
|
- Changed from NewPermissionsContentsReadIssuesWrite() to NewPermissionsContentsReadIssuesWritePRWriteDiscussionsWrite() - Matches broader scope of minimize_comment (works on issues, PRs, and discussions) - Aligns with add_comment permissions pattern Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Changed comment_id from (number|string) to string only in all schemas - GraphQL node IDs are always strings (e.g., 'IC_kwDOABCD123456') - Numeric REST API comment IDs cannot be converted to GraphQL node IDs - Updated error message to clarify GraphQL node ID requirement - Updated tool description to emphasize GraphQL node ID vs REST comment ID - All tests still passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add minimize comment functionality with GraphQL
Add minimize-comment safe output type for GraphQL-based comment moderation
Dec 8, 2025
- Added minimize-comment safe output to smoke-codex.md - Recompiled smoke-codex.lock.yml with minimize_comment job - All test workflows already created in pkg/cli/workflows - ScriptRegistry already has minimize_comment registered Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done in commit decede3:
|
github-actions bot
added a commit
that referenced
this pull request
Dec 9, 2025
Added documentation for two new user-facing features merged in the last 24 hours: 1. Workflow labels field (PR #5912) - Added `labels` field documentation to frontmatter.md - Documented `--label` flag for status command in cli.md - Labels enable workflow categorization and filtering 2. Minimize-comment safe output (PR #5911) - Added `minimize-comment` to safe-outputs.md table - Created detailed section with usage, requirements, and examples - Documents GraphQL node ID requirement and SPAM classification 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements
minimize-commentsafe output allowing AI agents to hide comments on issues/PRs/discussions via GraphQL'sminimizeCommentmutation.Implementation
Schema & Types
MinimizeCommentOutputwith stringcomment_id(GraphQL node IDs only)minimize-commentconfiguration (max, target-repo, github-token)MinimizeCommentIteminterfaceJavaScript Implementation
Go Integration
MinimizeCommentConfig, uses shared config types andbuildSafeOutputJobhelperMinimizeCommenttoSafeOutputsConfigTest Workflows
Permissions
Uses
NewPermissionsContentsReadIssuesWritePRWriteDiscussionsWrite()matching the full scope (issues, PRs, discussions).Usage
Key Design Decisions
String-only comment_id: GraphQL node IDs are always strings (e.g.,
IC_kwDOABCD123456). Numeric REST API comment IDs cannot be converted to GraphQL node IDs, so schema explicitly rejects numbers to prevent confusion.SPAM classifier: Uses
SPAMclassifier for theminimizeCommentmutation, appropriate for moderation use cases.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.