Skip to content

Fix close_discussion category validation and move required_category to create-discussion#10295

Merged
pelikhan merged 5 commits intomainfrom
copilot/fix-close-discussion-error
Jan 16, 2026
Merged

Fix close_discussion category validation and move required_category to create-discussion#10295
pelikhan merged 5 commits intomainfrom
copilot/fix-close-discussion-error

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Fix close_discussion category validation and move required_category to create-discussion

  • Remove category validation from close_discussion handler
  • Add RequiredCategory field to CreateDiscussionsConfig
  • Update compiler to pass required_category to create_discussion handler when close-older-discussions is enabled
  • Remove RequiredCategory from being passed to close_discussion handler config
  • Add logging for the field
  • Address code review feedback
  • Format code
  • Run linter
  • Perform code review
  • Recompile workflows

Summary

The required_category field has been moved from close-discussion configuration to create-discussion configuration where it logically belongs. This field is used for filtering discussions when the close-older-discussions feature is enabled, not for the standalone close_discussion safe output handler.

All formatting, linting, and code review checks have passed. Workflows have been recompiled to reflect the configuration changes.

Original prompt

This section details on the original issue you should resolve

<issue_title>close_discussion failed: Category doesn't match "Ideas""</issue_title>
<issue_description>Noticed in this an error when "close_discussion" ran: https://github.com/githubnext/gh-aw/actions/runs/21068212538

"✗ Message 7 (close_discussion) failed: Category doesn't match "Ideas""

My understanding is we shouldn't be checking for a category match in close_discussion</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

The close_discussion handler was incorrectly validating the
required_category configuration option, causing it to reject closing
discussions that didn't match the specified category. This was an
incorrect behavior - when the agent explicitly specifies which
discussion to close, the category filter should not be applied.

The required_category option is only used in close_older_discussions
where it acts as a search filter to find discussions to close.

Fixes the error: "Category doesn't match 'Ideas'" seen in workflow runs.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix category match error in close_discussion Remove category validation from close_discussion handler Jan 16, 2026
Copilot AI requested a review from mnkiefer January 16, 2026 14:26
@pelikhan
Copy link
Contributor

@copilot the required_category field should be under the close_older_discussions field to represent the dependency.

@pelikhan
Copy link
Contributor

@copilot work

Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

@copilot work

Moving required_category to be under create-discussion for use with close-older-discussions. The field will be removed from close-discussion configuration.

@copilot work

Moved required_category to create-discussion configuration in commit d3426bd. The field is now properly scoped for use with close-older-discussions.

Copilot AI and others added 2 commits January 16, 2026 19:43
Moved required_category field from close-discussion to create-discussion
configuration where it belongs. This field is used for filtering when
close-older-discussions is enabled, not for the standalone close_discussion
safe output.

Changes:
- Added RequiredCategory field to CreateDiscussionsConfig
- Updated compiler to pass required_category to create_discussion handler
- Removed required_category from close_discussion handler config
- Added logging for the new field

This addresses the PR comment requesting that required_category be
under close_older_discussions to represent the dependency correctly.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Improved documentation and logging for RequiredCategory field:
- Clarified comment to indicate field is only used when close-older-discussions is enabled
- Made logging conditional on CloseOlderDiscussions flag

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Remove category validation from close_discussion handler Fix close_discussion category validation and move required_category to create-discussion Jan 16, 2026
@pelikhan
Copy link
Contributor

@copilot format, lint, review code

After removing required_category from close_discussion handler config,
the plan.lock.yml needed to be recompiled to remove the field from
the compiled workflow configuration.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

@copilot format, lint, review code

Completed in commit 4ab194e:

  • ✓ Format: All files properly formatted
  • ✓ Lint: All validations passed (0 issues)
  • ✓ Code review: Completed - recompiled plan.lock.yml to remove required_category from close_discussion config

@pelikhan pelikhan marked this pull request as ready for review January 16, 2026 21:09
@pelikhan pelikhan merged commit 2ef5abe into main Jan 16, 2026
@pelikhan pelikhan deleted the copilot/fix-close-discussion-error branch January 16, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

close_discussion failed: Category doesn't match "Ideas""

3 participants