-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
ref(ai-monitoring): Align list titles with detail selection #121053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -592,17 +592,27 @@ def _apply_titles( | |
| conversations_map: dict[str, dict[str, Any]], | ||
| project_ids_by_conversation: Mapping[str, set[int]], | ||
| ) -> None: | ||
| """Attach stored conversation titles, leaving `title` as None when we have none.""" | ||
| """Set each conversation's `title` from storage when present. | ||
|
|
||
| On lookup failure, log and leave titles unset so the list response still succeeds. | ||
| """ | ||
| sorted_project_ids = { | ||
| conv_id: sorted(project_ids_by_conversation.get(conv_id, ())) | ||
| for conv_id in conversations_map | ||
| } | ||
| titles = fetch_conversation_titles( | ||
| [ | ||
| (conv_id, project_id) | ||
| for conv_id, project_ids in sorted_project_ids.items() | ||
| for project_id in project_ids | ||
| ] | ||
| ) | ||
| pairs = [ | ||
| (conv_id, project_id) | ||
| for conv_id, project_ids in sorted_project_ids.items() | ||
| for project_id in project_ids | ||
| ] | ||
| try: | ||
| titles = fetch_conversation_titles(pairs) | ||
| except Exception: | ||
| logger.exception( | ||
| "Failed to resolve titles for AI conversations", | ||
| extra={"project_ids": sorted({project_id for _, project_id in pairs})}, | ||
| ) | ||
| return | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. List title selection still misalignedMedium Severity The list path still resolves titles through Additional Locations (2)Reviewed by Cursor Bugbot for commit 87c8f81. Configure here. |
||
| for conv_id, conversation in conversations_map.items(): | ||
| conversation["title"] = _first_title(titles, conv_id, sorted_project_ids[conv_id]) | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The conversation list view incorrectly picks a title by lowest
project_id, while the detail view uses the earliesttitle_source_timestamp, causing title inconsistency between views.Severity: MEDIUM
Suggested Fix
Update the list view's data fetching logic, specifically
fetch_conversation_titles(), to order results bytitle_source_timestampand thenproject_id. This will align its title selection mechanism with the detail view'sfetch_conversation_title()and ensure both views display the same title consistently.Prompt for AI Agent
Also affects:
src/sentry/api/endpoints/organization_ai_conversations.py:592~618Did we get this right? 👍 / 👎 to inform future reviews.