Skip to content

Conversation

@moonbox3
Copy link
Contributor

Motivation and Context

While running the ChatKit sample, it was noticed that we do not hold on to the thread as the convo continues. The introduces some disjointed chats with the LLM as we don't carry the context. Additionally, the thread names were left as "New Thread." Introduce a quick method to make a cheap call to get the context for the thread.

Description

Fixes. Other fixes, outside of app, are formatting / lint / package reordering.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@moonbox3 moonbox3 self-assigned this Nov 13, 2025
Copilot AI review requested due to automatic review settings November 13, 2025 08:44
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Nov 13, 2025
Copilot finished reviewing on behalf of moonbox3 November 13, 2025 08:46
@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL14665212385% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
2028 129 💤 0 ❌ 0 🔥 41.567s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes critical context retention issues in the ChatKit integration sample by ensuring the agent maintains conversation history throughout the chat session. Previously, only the most recent user message was being passed to the agent, causing disjointed conversations.

Key Changes

  • Modified the respond method to load full thread history before processing each message, ensuring conversation context is maintained
  • Added automatic thread title generation using LLM-based summarization
  • Applied code formatting fixes including import reordering and whitespace cleanup

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
python/samples/demos/chatkit-integration/app.py Core fix: loads full thread history for context retention; adds LLM-based thread title generation; reorganizes imports
python/packages/chatkit/README.md Updates documentation example to show loading full thread history instead of just the current message
python/samples/demos/chatkit-integration/store.py Formatting changes: reorders imports alphabetically, reformats multi-line statements
python/samples/demos/chatkit-integration/attachment_store.py Formatting changes: reorders TYPE_CHECKING import, removes trailing whitespace
python/samples/demos/chatkit-integration/weather_widget.py Formatting: removes extra blank line

@moonbox3 moonbox3 added this pull request to the merge queue Nov 13, 2025
Merged via the queue into microsoft:main with commit a75590e Nov 13, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants