Add closed session status on GitHub issue closure#269
Merged
nicobistolfi merged 2 commits intomainfrom Mar 20, 2026
Conversation
…es session Introduce SessionStatusClosed as a distinct terminal state that records when a successful session has been fully finalized because its GitHub issue was closed. The transition happens automatically in cleanupClosedIssueSessions after cleanup succeeds — PR merge alone does not trigger it, and cleanup failure leaves the session as success. Status consumers (groupSessions, desiredSessionLabels, telemetry, sessionSupportsIteration) handle the new status explicitly so closed sessions appear in the completed group, get the done label, emit a closed transition event, and are excluded from iteration. Closes #263 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Closed
6 tasks
Closed sessions are fully finalized and should not trigger GitHub API calls for comment polling. processGitHubCleanupRequests was the only scan function that iterated all sessions without a status filter, causing unnecessary API calls for closed sessions on every scan cycle. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SessionStatusClosedto the session status enum as a distinct terminal state that means "successful work + GitHub issue closed + finalization complete"closedautomatically incleanupClosedIssueSessionsonly after cleanup succeeds and the GitHub issue is detected as closedclosedexplicitlyclosedtransition; cleanup failure leaves the session assuccessclosedsessions inprocessGitHubCleanupRequeststo avoid unnecessary GitHub API calls for comment polling on finalized sessionsTest plan
go vet ./...passesgo test ./...passes (all 17 packages)TestSessionStatusClosedRoundTrips— enum serializes/deserializes correctly in sessions.jsonTestGroupSessionsClosedInCompletedGroup— closed sessions appear in the "Completed / failed" status groupTestScanOnceCleansUpClosedIssueSession— now asserts status transitions toclosedTestScanOnceKeepsSuccessStatusForOpenIssue— success session stayssuccesswhile issue is openTestScanOnceDoesNotMarkClosedOnCleanupFailure— cleanup failure does not falsely markclosedTestScanOncePRMergeAloneDoesNotTransitionToClosed— merged PR with open issue stayssuccessTestScanOnceSkipsClosedSessionsForCleanupCommentPolling— closed sessions are not polled for cleanup commentsCloses #263
🤖 Generated with Claude Code