Skip to content

Chat history not reloaded after re-authentication, causing new conversations to be invisible in UI #8544

@pppqwe52

Description

@pppqwe52

Problem

After logging out and logging back in (re-authentication), new conversations created before logout are not visible in the chat history list, even though they exist in the database file.

Steps to reproduce

  1. Log in to Amazon Q
  2. Start a new conversation and complete it
  3. Log out from Amazon Q (sign out)
  4. Log back in with the same account
  5. Open chat history panel
  6. Observe: The conversation created in step 2 is missing from the list

Expected behavior

The chat history list should display all conversations, including those created before re-authentication. The history should be reloaded from the database when logging back in.

Actual behavior

  • New conversations created before logout are not visible in the UI history list
  • However, the conversations do exist in the database file (~/.aws/amazonq/history/chat-history-*.json)
  • The UI only shows conversations that were already in memory from the previous session
  • Workaround: Restarting VS Code forces the history to reload correctly

Log evidence:

  • First login: amazonq_loadHistory telemetry event is emitted ✓
  • Re-login: amazonq_loadHistory telemetry event is not emitted ✗

Root cause analysis

The issue appears to be that:

  1. When logging out, the database connection is not properly closed/flushed
  2. When logging back in with a new connection ID, the in-memory history index is not reloaded
  3. The LSP server continues using the old in-memory index from before logout

Relevant log snippet:

13:39 First login
[2026-01-30T05:39:34.054Z] lserver: Initializing database at .../chat-history-b4dbba750d99ad0770122316d2f020bb.json
[VSCode Telemetry] Emitting amazonq_loadHistory telemetry

13:41 Re-login (after logout)
[Info - 1:41:17 PM] Runtime: Successfully saved bearer credentials
# ← No database initialization or amazonq_loadHistory telemetry!

Workaround

Restart VS Code after re-authentication to force history reload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugWe can reproduce the issue and confirmed it is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions