Skip to content

Make imported chat persist - #331738

Open
cab14bacc (Cab14bacc) wants to merge 2 commits into
microsoft:mainfrom
Cab14bacc:fix/chat-import-persistence
Open

Make imported chat persist#331738
cab14bacc (Cab14bacc) wants to merge 2 commits into
microsoft:mainfrom
Cab14bacc:fix/chat-import-persistence

Conversation

@Cab14bacc

@Cab14bacc cab14bacc (Cab14bacc) commented Aug 20, 2026

Copy link
Copy Markdown

Fixes #291986

This PR fixes the issue where imported chats are not kept. Importing a chat (via workbench.action.chat.import) opens it in a tab, but it was marked as isImported and excluded from persistence, so it never appeared in the Sessions list and was lost once the tab was closed.

Fix

In chatImportExport.ts, upgrade the imported export data into full ISerializableChatData with a fresh sessionId and creationDate before loading — the same pattern the fork action (chatForkActions.ts) already uses. The imported chat then becomes a persistent local session.

Changes

  • chat/browser/actions/chatImportExport.ts – build full serializable data for imported sessions.
  • chat/test/common/model/chatModel.test.ts – add a test verifying upgraded import data yields isImported === false. The existing "exported data only" test still confirms bare export data is isImported === true.

Verify

  1. Create a chat in a workspace and export it to e.g. foo.json.
  2. In another workspace, use Import Chat... to load foo.json.
  3. The imported chat now appear alongside newer chats.
  4. Close the imported chat's tab — it should remain in the Sessions list.

Discussion

I am not sure if isImported is now obsolete or not, it does still prevent exportable data from being persistent. However, it might need a rename as imported data is now persistent.

Copilot AI balanced review requested due to automatic review settings August 20, 2026 01:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Cab14bacc cab14bacc (Cab14bacc) changed the title Make imported chat persist and appear in history Make imported chat persist Aug 20, 2026
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.

GitHub Copilot imported chat is not kept

3 participants