Skip to content

Cleanup session files on get message or session deleted error#4551

Open
nikola-jokic wants to merge 2 commits into
actions:mainfrom
nikola-jokic:nikola-jokic/cleanup-get-message-404
Open

Cleanup session files on get message or session deleted error#4551
nikola-jokic wants to merge 2 commits into
actions:mainfrom
nikola-jokic:nikola-jokic/cleanup-get-message-404

Conversation

@nikola-jokic

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 10, 2026 16:43
@nikola-jokic nikola-jokic requested a review from a team as a code owner July 10, 2026 16:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.RunnerRegistrationDeleted outcome and return it from MessageListener/BrokerMessageListener when the service reports invalid_client.
  • Handle RunnerRegistrationDeleted in Runner.RunAsync by deleting local runner config and exiting with a terminated error code.
  • Catch TaskAgentNotFoundException/RunnerNotFoundException during 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants