Cleanup session files on get message or session deleted error#4551
Merged
luketomlinson merged 2 commits intoJul 16, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures the listener cleans up local runner configuration when the server indicates the runner registration no longer exists—either during session creation (registration deleted) or while retrieving messages (not found).
Changes:
- Add a new
CreateSessionResult.RunnerRegistrationDeletedoutcome and return it fromMessageListener/BrokerMessageListenerwhen the service reportsinvalid_client. - Handle
RunnerRegistrationDeletedinRunner.RunAsyncby deleting local runner config and exiting with a terminated error code. - Catch
TaskAgentNotFoundException/RunnerNotFoundExceptionduring message retrieval to delete local runner config and exit the run loop cleanly; add L0 coverage for the new behaviors.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Test/L0/Listener/RunnerL0.cs | Adds L0 tests covering config cleanup (or non-cleanup) for session conflict, registration-deleted during session creation, and not-found during message retrieval. |
| src/Runner.Listener/Runner.cs | Adds handling to delete local runner config on registration-deleted and on not-found exceptions while polling messages. |
| src/Runner.Listener/MessageListener.cs | Extends CreateSessionResult and returns RunnerRegistrationDeleted when session creation fails due to deleted registration (invalid_client). |
| src/Runner.Listener/BrokerMessageListener.cs | Mirrors RunnerRegistrationDeleted handling for the broker listener’s session creation path. |
nikola-jokic
force-pushed
the
nikola-jokic/cleanup-get-message-404
branch
from
July 16, 2026 12:02
7b741db to
6cb57e4
Compare
nikola-jokic
force-pushed
the
nikola-jokic/cleanup-get-message-404
branch
from
July 16, 2026 12:29
6cb57e4 to
e6a062e
Compare
rentziass
approved these changes
Jul 16, 2026
luketomlinson
approved these changes
Jul 16, 2026
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.
No description provided.