fix: prevent cleanup from removing sessions with open PRs#283
Closed
bhavikprit wants to merge 2 commits intoComposioHQ:mainfrom
Closed
fix: prevent cleanup from removing sessions with open PRs#283bhavikprit wants to merge 2 commits intoComposioHQ:mainfrom
bhavikprit wants to merge 2 commits intoComposioHQ:mainfrom
Conversation
Before this fix, cleanup would kill sessions with dead runtimes regardless of whether they had an open PR. This caused orphaned PRs where no session owned them anymore. Now when cleanup detects a dead runtime, it checks if the session has an associated PR that is still open. If so, the session is skipped (preserved for human attention) rather than silently removed. Conservative fallback: if the PR state check fails (API error), the session is also preserved to avoid data loss. Added two regression tests: - Dead runtime + open PR → session skipped - Dead runtime + PR check fails → session conservatively skipped Closes ComposioHQ#146
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
When session.pr exists but plugins.scm is null (SCM plugin not configured or not loaded), the cleanup code now assumes the PR is open instead of killing the session. This prevents accidentally removing sessions with open PRs when the SCM plugin is unavailable.
Author
|
Closing — superseded by upstream #453 (fix: protect orchestrators from session cleanup), merged Mar 13. The session cleanup logic has been significantly refactored and our PR's hasOpenPR guard pattern no longer matches the current codebase. |
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.
Before this fix, cleanup would kill sessions with dead runtimes regardless of whether they had an open PR. This caused orphaned PRs where no session owned them anymore.
Now when cleanup detects a dead runtime, it checks if the session has an associated PR that is still open. If so, the session is skipped (preserved for human attention) rather than silently removed.
Conservative fallback: if the PR state check fails (API error), the session is also preserved to avoid data loss.
Added two regression tests:
Closes #146