Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

The agentic maintenance job (agentics-maintenance.yml) runs every 2 hours to close expired issues, discussions, and PRs. Issues created with the legacy expiration format were not being detected and closed.

Root Cause

searchEntitiesWithExpiration only checked for the new format with HTML comment:

> - [x] expires <!-- gh-aw-expires: 2026-01-31T06:04:00.000Z --> on Jan 31, 2026, 6:04 AM UTC

Issues created with the legacy format were missed:

> - [x] expires  on Jan 31, 2026, 6:04 AM UTC

While extractExpirationDate (used to parse dates) supports both formats, the search filter only used EXPIRATION_PATTERN.

Changes

expired_entity_search_helpers.cjs

  • Import both EXPIRATION_PATTERN and LEGACY_EXPIRATION_PATTERN
  • Check for both patterns when filtering entities
  • Log which format matched for debugging

expired_entity_search_helpers.test.cjs

  • Add test case for legacy format detection
  • Update logging assertion to handle format indicator

The search now finds both format variants, ensuring all expired ephemeral issues/discussions/PRs are closed regardless of creation date.

Original prompt

Investigate why the agentic maintenance job has not yet closed this issue which should have been expired already #12667

See ephemerals.js


💡 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.

…formats

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review February 2, 2026 15:17
Copilot AI changed the title [WIP] Investigate closure issue for agentic maintenance job Fix ephemeral issue search to support legacy expiration format Feb 2, 2026
Copilot AI requested a review from pelikhan February 2, 2026 15:20
@pelikhan pelikhan merged commit 392d71d into main Feb 2, 2026
91 checks passed
@pelikhan pelikhan deleted the copilot/investigate-agentic-maintenance-issue branch February 2, 2026 15:25
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