fix: DM conversation naming issue for one-way single-participant conversations#4
Merged
ChristopherJHart merged 5 commits intomainfrom Aug 6, 2025
Merged
Conversation
* Added a client parameter to `build_dm_conversation`, `group_dm_conversations`, and `group_all_conversations` functions to allow fetching room memberships. * Implemented logic to retrieve the other participant from room memberships if not found in messages, improving conversation accuracy.
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.
Problem
Previously, when a DM conversation contained only messages from the authenticated user (i.e., the user sent a message but received no reply within the conversation window), the conversation would be named with a generic identifier like
dm-unknown-1instead of showing the actual target recipient's name. This made it difficult to identify which person the conversation was with.Root Cause
The issue occurred in the
build_dm_conversationfunction, which determined conversation participants solely from message senders. When only the authenticated user had sent messages, the function couldn't identify the "other participant" and defaulted to using "unknown" in the conversation ID.Solution
This PR enhances the DM conversation building logic to fetch room membership information from the Webex API when message senders alone don't provide sufficient participant information.
Changes Made
Core Logic Enhancement (
summarizer/grouping.py)build_dm_conversationfunction: Added optionalWebexAPIclient parameter and fallback logic to fetch room memberships when the other participant cannot be identified from messagesgroup_dm_conversationsandgroup_all_conversationsto accept and pass through the WebexAPI clientWebexAPI Client Access (
summarizer/webex.py)clientproperty: Exposed the underlyingWebexAPIinstance through a public property onWebexClientfor use in conversation grouping logicIntegration (
summarizer/runner.py)group_all_conversationsto pass the WebexAPI client instanceType Safety (
webexpythonsdk-stubs/)membershipsproperty andMembershipsAPIclassMembershipclass stub with required properties (id,roomId,personId,personEmail,isModerator)How It Works
safe_get_personfunction to get the person's display nameResults
After this fix, DM conversations now display meaningful names even when only the authenticated user has sent messages:
Before:
After:
Testing
Impact