Skip to content

Comments

fix: chat history title generation updated#721

Merged
Avijit-Microsoft merged 2 commits intodevfrom
rc-chathistorybug
Feb 20, 2026
Merged

fix: chat history title generation updated#721
Avijit-Microsoft merged 2 commits intodevfrom
rc-chathistorybug

Conversation

@Ragini-Microsoft
Copy link
Contributor

Purpose

This pull request introduces AI-powered, concise conversation title generation for chat conversations. The backend now generates a short title (up to four words) for each new conversation using an Azure OpenAI agent, and the frontend displays these generated titles in the chat history and UI. The implementation ensures that custom titles always take precedence, and fallback logic is provided if AI title generation fails.

The most important changes are:

Backend: Title Generation and Persistence

  • Added a new TitleService (title_service.py) that generates a 4-word or less title for conversations using Azure OpenAI, with fallback to the first four words of the message if AI is unavailable.
  • Updated the chat and brief parsing endpoints (app.py) to generate and store a conversation title for new conversations, passing the generated title through the API responses. [1] [2] [3] [4] [5] [6]
  • Enhanced CosmosDB service methods to store and merge generated and custom titles in conversation metadata, and to ensure generated titles are only set if no custom or previous generated title exists. [1] [2] [3] [4]
  • Improved the conversation listing logic to use the generated title when available, falling back to custom title, brief overview, or the first four words of the user's message.

Frontend: Title Handling and Display

  • Added conversationTitle state to App.tsx, updated it when a new title is generated or a conversation is loaded, and passed it to the ChatHistory component. [1] [2] [3] [4] [5] [6]
  • Updated ChatHistory to accept and display the current conversation title, using it for the current session summary instead of a message substring. [1] [2] [3]
  • Extended the API response type for brief parsing to include the generated title.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

@Ragini-Microsoft Ragini-Microsoft marked this pull request as draft February 19, 2026 12:45
@Avijit-Microsoft Avijit-Microsoft merged commit 709dcd9 into dev Feb 20, 2026
5 of 7 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.2.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants