Skip to content

feat: Add get_thread to BaseGroupChat - #8011

Open
MOHAMMED WASIM KHAN (wasim-builds) wants to merge 4 commits into
microsoft:mainfrom
wasim-builds:issue-6085
Open

feat: Add get_thread to BaseGroupChat#8011
MOHAMMED WASIM KHAN (wasim-builds) wants to merge 4 commits into
microsoft:mainfrom
wasim-builds:issue-6085

Conversation

@wasim-builds

@wasim-builds MOHAMMED WASIM KHAN (wasim-builds) commented Jul 30, 2026

Copy link
Copy Markdown

Resolves #6085

Summary

Add get_thread() to BaseGroupChat to safely retrieve message history through the group chat manager.

Changes

  • _base_group_chat.py: add get_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 API
  • Tests in test_group_chat.py and test_assistant_agent.py

Verification

Thread history can be retrieved asynchronously without breaking existing chat flow.

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>
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.

Get current message thread from a group chat team.

1 participant