feat: Add get_thread to BaseGroupChat - #8011
Open
MOHAMMED WASIM KHAN (wasim-builds) wants to merge 4 commits into
Open
feat: Add get_thread to BaseGroupChat#8011MOHAMMED WASIM KHAN (wasim-builds) wants to merge 4 commits into
MOHAMMED WASIM KHAN (wasim-builds) wants to merge 4 commits into
Conversation
Move stream_queue.put_nowait(None) into a finally block so the stream always terminates, even when asyncio.gather is cancelled. Previously, cancellation during tool execution left the stream_queue without its sentinel, causing the consumer to block forever. Fixes microsoft#7956
Adds a test that cancels a tool mid-execution and asserts the stream terminates within a 5-second timeout — regression coverage for microsoft#7956. Prior to the finally-block fix in _execute_tool_calls, the stream terminator was never enqueued on cancellation, causing on_messages_stream to hang forever. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Resolves #6085
Summary
Add
get_thread()toBaseGroupChatto safely retrieve message history through the group chat manager.Changes
_base_group_chat.py: addget_thread()method with async RPC semantics_base_group_chat_manager.py: add handler/dispatch for thread retrieval_events.py: add new event types for thread access_assistant_agent.py: minor alignment with new thread APItest_group_chat.pyandtest_assistant_agent.pyVerification
Thread history can be retrieved asynchronously without breaking existing chat flow.