Skip to content

Conversation

@mike-deem-uipath
Copy link
Contributor

@mike-deem-uipath mike-deem-uipath commented Jan 16, 2026

socket.io send and disconnect are both background operations even when you await on the api calls. This allows the final "endExchange" event to go unsent if the process exits too quickly when the agent terminates. The fix is to wait for the disconnect to complete.

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Jan 16, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a race condition where the "endExchange" event was not being sent before process termination. The issue occurred because socket.io's send() and disconnect() operations are asynchronous background tasks, allowing the process to exit before pending messages were transmitted.

Changes:

  • Added await self._client.wait() after disconnect() to ensure all pending socket.io operations complete before cleanup
  • Added explanatory comment documenting the race condition and fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cristipufu cristipufu force-pushed the fix/end-exchange-not-sent branch from 5b6c26f to 91a52dd Compare January 17, 2026 08:41
@cristipufu cristipufu merged commit 127ef08 into main Jan 17, 2026
89 checks passed
@cristipufu cristipufu deleted the fix/end-exchange-not-sent branch January 17, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants