Summary
Vigilante can get stuck replaying historical @vigilanteai ... iteration comments on open issues, causing repeated Iteration Ignored comments and unnecessary redispatch attempts. The comment-claim cursor for iteration requests needs monotonic semantics so older comments are treated as already consumed once a newer comment has been claimed.
Problem
FindIterationComment currently skips only the exact last claimed comment ID, then returns the next older matching iteration comment.
- On the next scan, Vigilante can reprocess a historical iteration comment instead of stopping at the claimed cursor.
- When the issue has no current assignees, each replayed historical comment fails the assignee check and produces a fresh
Iteration Ignored comment.
- This creates sustained GitHub issue noise and can trigger unnecessary follow-up session starts after the relevant work already completed.
Context
Desired Outcome
Implementation Notes
- Update iteration comment selection so comments at or before the stored claim cursor are considered consumed.
- Use a monotonic comparison based on comment timestamp and ID, rather than exact-ID equality only.
- A reasonable implementation is to consider only comments newer than
LastIterationCommentAt, with ID as a tie-breaker if needed.
- Preserve the ability to detect genuinely new iteration comments that arrive after the stored cursor.
- Audit any similar command-claim helpers for
resume, cleanup, or recreate to confirm they do not have the same replay behavior.
- Keep the fix narrow: the primary problem is historical iteration comment replay, not the broader session lifecycle.
Acceptance Criteria
Testing Expectations
- Add regression tests for a session with multiple historical iteration comments where only the newest unclaimed comment should be considered.
- Add coverage for repeated scans after an ignored iteration request to verify that older comments are not replayed.
- Add coverage for the positive case where a new iteration comment arrives after the stored cursor and is correctly detected.
- Verify the assignee-mismatch path does not produce repeated
Iteration Ignored comments for older history.
Operational / UX Considerations
- The fix should reduce GitHub issue noise and avoid confusing operators with repeated rejection comments for stale history.
- Preserve compatibility with existing persisted session state that already contains
last_iteration_comment_id and last_iteration_comment_at.
- If the implementation changes cursor semantics, make the behavior explicit in logs so future comment-processing bugs are easier to diagnose.
Summary
Vigilante can get stuck replaying historical
@vigilanteai ...iteration comments on open issues, causing repeatedIteration Ignoredcomments and unnecessary redispatch attempts. The comment-claim cursor for iteration requests needs monotonic semantics so older comments are treated as already consumed once a newer comment has been claimed.Problem
FindIterationCommentcurrently skips only the exact last claimed comment ID, then returns the next older matching iteration comment.Iteration Ignoredcomment.Context
aliengiraffe/vigilanteIteration Ignoredcomments between2026-03-28T18:45:42Zand2026-03-28T19:15:42Z.Iteration Ignoredcomments between2026-03-28T18:53:46Zand2026-03-28T19:59:46Z.last_iteration_comment_idmetadata.internal/github/github.gotreats the cursor as “skip this exact comment ID” instead of “everything at or before this point is already consumed”.internal/app/app.gothen turns each replayed historical comment into a newIteration Ignoredcomment.Desired Outcome
Iteration Ignoredcomments from old history.Implementation Notes
LastIterationCommentAt, with ID as a tie-breaker if needed.resume,cleanup, orrecreateto confirm they do not have the same replay behavior.Acceptance Criteria
@vigilanteai ...iteration comments does not emit repeatedIteration Ignoredcomments one per scan.Testing Expectations
Iteration Ignoredcomments for older history.Operational / UX Considerations
last_iteration_comment_idandlast_iteration_comment_at.