Skip to content

Chat history incorrectly shared across different URLs within the same tab #188

@Youpen-y

Description

@Youpen-y

Problem

When users navigate to different URLs within the same browser tab, the chat history is shared across all URLs. This causes conversations from one page to incorrectly appear on a different page.

Reproduction Steps

  1. Open a URL (e.g., github.com/user/home)
  2. Start a chat conversation in the side panel
  3. Navigate to a different URL in the same tab (e.g., github.com/user/repos)
  4. Open the side panel - the previous page"s chat history is displayed

Expected Behavior

Each URL should have its own isolated chat history. When navigating to a different URL, the chat should be empty or show that URL"s specific history.

Root Cause

The chat history storage uses chat:tab:{tabId} as the storage key, which doesn"t include the URL. This means all URLs in the same tab share the same chat history storage.

Proposed Solution

Use chat:tab:{tabId}:{normalizedUrl} as the storage key to isolate chat history by URL.

Workaround

Users can manually clear chat history when switching pages, but this is not ideal.

Affected Files

  • apps/chrome-extension/src/entrypoints/sidepanel/chat-history-store.ts
  • apps/chrome-extension/src/entrypoints/sidepanel/chat-history-runtime.ts
  • apps/chrome-extension/src/entrypoints/sidepanel/main.ts
  • apps/chrome-extension/src/entrypoints/sidepanel/ui-state-runtime.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions