Skip to content

Conversation

@AdityaHegde
Copy link
Collaborator

We manage the cache manually for chat conversations. This means that if backend updates some field and doesnt notify in the stream then we do not get the updated.

In a fresh project and a fresh chat this leads to us not populating the title of the conversation. This leads to empty dropdown in the chat history.

This PR is a hotfix that invalidates the conversations list query.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!
@AdityaHegde AdityaHegde added the blocker A release blocker issue that should be resolved before a new release label Dec 3, 2025
@ericpgreen2
Copy link
Contributor

Code Review

Developed in collaboration with Claude Code and Eric.

Issues

  1. Fires on every message: The invalidation happens in sendMessage() completion, triggering an extra network request on every message - not just new conversations.

  2. Redundant client-side logic: updateConversationListCache() with generateConversationTitle() duplicates server-side title generation logic. This will break when AI-generated titles are introduced.

Recommended Changes

  1. Move invalidation to handleConversationCreated() - only fire the request for new conversations:
// conversation-manager.ts
private handleConversationCreated(conversationId: string): void {
  this.rotateNewConversation(conversationId);
  this.conversationSelector.selectConversation(conversationId);
  // Let the server be the source of truth for title
  void invalidateConversationsList(this.instanceId);
}
  1. Remove updateConversationListCache() entirely - the invalidation will fetch fresh data including the correct title from the server.

  2. Remove generateConversationTitle() - no longer needed once we rely on server-provided titles.

Benefits

  • Single network request only when a conversation is created (not every message)
  • Server remains single source of truth for titles
  • Simpler code that won't break with AI-generated titles
  • Removes ~60 lines of client-side title generation logic
Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

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

In general, I like this approach. It's simpler than the existing client-side cache management, which, given the regression, was clearly was a bit too complex.

But see the Claude Code comment above. We need to:

  1. Scope the invalidation so it doesn't fire on every message
  2. Remove the old List Conversation cache management logic that this PR makes obsolete
@AdityaHegde
Copy link
Collaborator Author

@ericpgreen2 I have removed the unnecessary code and added invalidation in handleConversationCreated. But we cannot remove it from handleMessage. From my testing title is not yet updated when handleConversationCreated is called. So lets get a better solution in the future.

@AdityaHegde AdityaHegde merged commit 6391fe5 into main Dec 4, 2025
16 of 18 checks passed
@AdityaHegde AdityaHegde deleted the fix/new-conversation-data-invalidation branch December 4, 2025 04:21
AdityaHegde added a commit that referenced this pull request Dec 4, 2025
* fix: new conversation data not updating in the history dropdown

* Invalidate in ConversationManager as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker A release blocker issue that should be resolved before a new release

4 participants