Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

The agentic maintenance workflow's expired entity detection needs to identify issues created by agentic workflows. Based on code review feedback, this now uses XML comment markers instead of text pattern matching.

Change

Updated detection logic in expired_entity_search_helpers.cjs to use XML comment markers:

// Before: text pattern matching
const agenticPattern = /^> AI generated by/m;
const isAgenticWorkflow = entity.body && agenticPattern.test(entity.body);

// After: XML comment marker detection
const hasWorkflowId = entity.body && entity.body.includes("gh-aw-workflow-id:");
const hasAgenticWorkflow = entity.body && entity.body.includes("gh-aw-agentic-workflow:");
const isAgenticWorkflow = hasWorkflowId || hasAgenticWorkflow;

This approach is more reliable and consistent with other workflow detection patterns in the codebase (e.g., close_older_issues.cjs).

Why This Matters

XML comment markers (<!-- gh-aw-workflow-id: ... --> or <!-- gh-aw-agentic-workflow: ... -->) are the authoritative identifiers for agentic workflow-generated content. Issues without these markers are not managed by agentic workflows and should not be auto-closed.

Tests Updated

  • Added XML comment markers to all existing test cases
  • Added test confirming issues without XML markers are correctly filtered out
  • Added specific tests for both gh-aw-workflow-id and gh-aw-agentic-workflow marker types

Issue #12669 Context

Issue #12669 was not detected because it lacks XML comment markers. This is correct behavior - without these markers, the issue is not managed by an agentic workflow and should not be auto-closed.

Original prompt

Investigate why this issue was not detected and closed by the agentic maintenance workflow.

#12669

See ephemerals.cjs

Add test with this issue markdown. It is expired.


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

- Updated expired_entity_search_helpers.cjs to match both "> AI generated by" and "> Workflow:" patterns
- Added test for issue #12669 with Workflow prefix format
- Added test to verify ephemerals.extractExpirationDate handles issue #12669 format
- All JavaScript tests pass (3276 tests)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review February 2, 2026 15:50
Copilot AI changed the title [WIP] Investigate undetected issue in agentic maintenance workflow Fix expired entity detection to include "> Workflow:" prefix Feb 2, 2026
Copilot AI requested a review from pelikhan February 2, 2026 15:52
const agenticPattern = /^> AI generated by/m;
// Check if created by an agentic workflow
// Matches either "> AI generated by" or "> Workflow:" at start of line
const agenticPattern = /^> (?:AI generated by|Workflow:)/m;
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot use the XML comment with workflow id or workflow name instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use XML comment markers (gh-aw-workflow-id: or gh-aw-agentic-workflow:) instead of text patterns. This matches the pattern used in other parts of the codebase like close_older_issues.cjs. Changed in commit 0566d31.

@pelikhan
Copy link
Contributor

pelikhan commented Feb 2, 2026

@copilot the helper to detect if a text is agentically generated should be based on xml comments and it should be a helper function in the JavaScript file that creates the xml comment. Add tests.

Changed detection from text patterns ("> AI generated by" or "> Workflow:") to
XML comment markers (gh-aw-workflow-id or gh-aw-agentic-workflow). This is more
reliable and consistent with other workflow detection in the codebase.

Updated tests to:
- Add XML markers to all test cases
- Test issue #12669 correctly NOT being found (lacks XML markers)
- Add new tests for both gh-aw-workflow-id and gh-aw-agentic-workflow markers

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Fix expired entity detection to include "> Workflow:" prefix Use XML comment markers for agentic workflow detection Feb 2, 2026
Copilot AI requested a review from pelikhan February 2, 2026 16:02
@pelikhan pelikhan merged commit 8e16fd8 into main Feb 2, 2026
117 of 119 checks passed
@pelikhan pelikhan deleted the copilot/investigate-agentic-maintenance-issue branch February 2, 2026 16:04
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

Smoke Test: Claude - 21597335533

Last 2 Merged PRs:

Test Results:
✅ GitHub MCP Testing
✅ Safe Inputs GH CLI Testing
✅ Serena MCP Testing
✅ Make Build Testing
✅ Playwright Testing
✅ Tavily Web Search Testing
✅ File Writing Testing
✅ Bash Tool Testing
✅ Discussion Interaction Testing

Overall Status: PASS

AI generated by Smoke Claude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants