DamianEdwards / DamianEdwards/copilotd
Use GitHub issue events API to detect rule re-match within a single poll cycle
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 60
- Forks
- 9
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 1
Description
Currently, if a copilot session explicitly completes itself (via copilotd session complete), the CompletedBySession flag prevents re-dispatch. The flag is cleared when the daemon detects the issue no longer matches rules during a poll cycle. If a user toggles the issue state (e.g., removes and re-adds a label) within a single poll interval, the daemon never sees the 'unmatched' intermediate state and the flag remains set.
Proposed enhancement: During reconciliation, for Completed sessions with CompletedBySession = true that still match rules, use the GitHub issue events API (gh api repos/{owner}/{repo}/issues/{number}/events) to check for relevant state changes since the session's CompletedAt timestamp. Relevant events include:
unlabeledfollowed bylabeled(for label-based rules)unassignedfollowed byassigned(for user-based rules)demilestonedfollowed bymilestoned(for milestone-based rules)closedfollowed byreopened
If such a sequence is detected, clear the CompletedBySession flag and allow re-dispatch, even if both changes occurred within the same poll cycle.
Tradeoff: One additional gh api call per completed-but-still-matching session per poll cycle. In practice this should be a small number of sessions.
Current workarounds:
copilotd session reset <issue>— immediate manual reset- Toggle the issue and wait at least one poll interval between changes
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the reconciliation path for Completed sessions where CompletedBySession and CompletedAt are checked. Read the GitHub issue events endpoint response and determine how to identify the listed change sequences after CompletedAt. Done means a relevant sequence clears the flag and permits re-dispatch while ordinary matching sessions remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, github
- Domain
- api, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100