Skip to content

Comments

fix: added test coverage for bug 34655 fix#728

Merged
Avijit-Microsoft merged 9 commits intodevfrom
psl-chathistorythreadname
Feb 20, 2026
Merged

fix: added test coverage for bug 34655 fix#728
Avijit-Microsoft merged 9 commits intodevfrom
psl-chathistorythreadname

Conversation

@Shubhangi-Microsoft
Copy link
Contributor

This pull request introduces automatic, AI-generated conversation titles for chat sessions, enhancing both the backend and frontend to support, store, and display these titles. The changes ensure that new conversations are given concise, meaningful titles based on the user's first message, and that these titles are consistently used and preserved throughout the application.

Backend: AI Title Generation and Storage

  • Added a new TitleService (title_service.py) that uses Azure OpenAI to generate concise, 4-word-or-less titles for conversations based on the initial user message, with robust fallback logic if the AI is unavailable.
  • Updated backend endpoints (app.py) to call the title service when a new conversation is started or when a brief is parsed, storing the generated title in the conversation metadata only if no custom or existing generated title is present. [1] [2] [3] [4] [5] [6]
  • Modified the CosmosDB service (cosmos_service.py) to merge and preserve both generated and custom titles in conversation metadata, and to only set a generated title if one does not already exist. [1] [2] [3] [4]
  • Improved conversation listing logic to prioritize displaying custom titles, then generated titles, and finally a fallback using the first four words of the brief or user message if no title is available.

Frontend: Title Usage and Display

  • Updated the React app (App.tsx) to track and update the current conversation title, retrieving it from the backend and passing it to the chat history component for display. [1] [2] [3] [4] [5] [6]
  • Modified the chat history component (ChatHistory.tsx) to accept and display the current conversation title, using it in the conversation summary if available. [1] [2] [3]
  • Extended the parsed brief response type to include the generated title, ensuring type safety and clarity in frontend-backend communication.## Purpose
  • ...

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.

What to Check

Verify that the following are valid

  • ...

Other Information

[Copilot is generating a summary...]

Ragini-Microsoft and others added 9 commits February 19, 2026 17:36
- test_title_service.py: 21 tests covering fallback title, AI-generated title,
  singleton factory, edge cases (empty/None/whitespace, agent errors)
- test_cosmos_service.py: 21 tests covering add_message generated_title handling,
  metadata merge preserving titles, title resolution priority chain,
  rename_conversation, delete_all_conversations
- test_app_endpoints.py: 15 tests covering /api/brief/parse and /api/chat title
  generation flow, conversation CRUD (list/rename/delete/delete-all)
- conftest.py: test configuration with env vars setup and sys.path for CI
@Avijit-Microsoft Avijit-Microsoft merged commit 334fc59 into dev Feb 20, 2026
5 checks passed
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.

3 participants