Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

Implementation Complete: Parent Issue Sub-Issue Limit (64 max) ✅

Summary

Implemented automatic parent issue rotation when sub-issue count reaches 64, preventing GitHub API limits and maintaining clean issue organization. When a parent issue reaches capacity, it remains open and a new parent is created with a reference to the full parent.

Behavior

When a parent issue reaches 64 sub-issues:

  • ✅ Old parent remains open with all its sub-issues visible
  • ✅ New parent is created automatically
  • ✅ New parent's description includes: > **Note:** This is a continuation parent issue. The previous parent issue #X reached the maximum of 64 sub-issues.
  • ✅ Users can navigate between related parent issues to see full history

Implementation Details

Shared Helper (sub_issue_helpers.cjs):

  • Exports MAX_SUB_ISSUES constant (64)
  • Exports getSubIssueCount() - queries GraphQL for sub-issue counts
  • Used by both workflow failure tracking and issue grouping features

Core Logic (handle_agent_failure.cjs):

  • Imports from sub_issue_helpers.cjs
  • Modified ensureParentIssue() - checks count before linking, creates new parent when limit reached (keeps old one open)
  • New parent description includes reference to previous parent issue

Issue Grouping (create_issue.cjs):

  • Imports from sub_issue_helpers.cjs
  • Uses shared constant MAX_SUB_ISSUES instead of local constant

Test Coverage

  • ✅ All 20 tests in handle_agent_failure.test.cjs passing
  • ✅ All 9 tests in create_issue_group.test.cjs passing
  • ✅ All 6 tests in sub_issue_helpers.test.cjs passing
  • ✅ 2,807+ total tests passing

Validation

  • ✅ Code review: All feedback addressed
  • ✅ Security: CodeQL found no issues
  • ✅ Tests: All passing
  • ✅ Formatting: All files formatted with prettier
Original prompt

At @copilot, you're going to review the code that adds an issue when a workflow fails. And we're going to update the logic to check the parent issue. The parent issue cannot have more than 64 sub-issues, and if it does, you should close it and create a new one.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits January 18, 2026 19:08
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…unnecessary throw

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update logic for handling parent issue and sub-issues Add 64 sub-issue limit with automatic parent rotation Jan 18, 2026
Copilot AI requested a review from pelikhan January 18, 2026 19:30
@pelikhan
Copy link
Contributor

@copilot move helper to helper file and reuse in create-issue group as well

@pelikhan
Copy link
Contributor

@copilot do not close filled up parent, just create a new one and mention the old one in the description

…both files

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

Copilot AI commented Jan 18, 2026

@copilot move helper to helper file and reuse in create-issue group as well

Done! Created sub_issue_helpers.cjs with shared getSubIssueCount() and MAX_SUB_ISSUES constant. Both handle_agent_failure.cjs and create_issue.cjs now import from this helper file, eliminating code duplication. (commit: 8e64cdd)

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

Copilot AI commented Jan 18, 2026

@copilot do not close filled up parent, just create a new one and mention the old one in the description

Done! Changed behavior to keep full parent issues open instead of closing them. When a parent reaches 64 sub-issues, a new parent is created with a note in the description referencing the previous parent: > **Note:** This is a continuation parent issue. The previous parent issue #X reached the maximum of 64 sub-issues. (commit: 2951039)

Copilot AI changed the title Add 64 sub-issue limit with automatic parent rotation Add 64 sub-issue limit with automatic parent rotation (keeps old parents open) Jan 18, 2026
@pelikhan pelikhan marked this pull request as ready for review January 18, 2026 23:37
@pelikhan pelikhan merged commit 0c1ec8a into main Jan 18, 2026
@pelikhan pelikhan deleted the copilot/update-issue-creation-logic branch January 18, 2026 23:37
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.

2 participants