Skip to content

Archived session loses messages and becomes inaccessible when interacted with #16030

Description

@BYK

Bug description

When navigating to an archived session (e.g. via URL) and sending a prompt, two things break:

  1. "Unable to retrieve session" toast — the session disappears from the reactive store, so the prompt input can't find it
  2. Messages vanish — the entire message history, parts, diffs, todos, permissions, and questions are deleted from the UI store

Steps to reproduce

  1. Archive a session (via sidebar context menu)
  2. Navigate back to it (e.g. via browser URL/history)
  3. Session loads correctly — messages visible
  4. Send a prompt
  5. Messages disappear and toast shows "Unable to retrieve session"

Root cause

Session.touch() (called during prompting via SessionPrompt.prompt()) publishes an SSE session.updated event with the full session info — including time.archived still set. The frontend event-reducer.ts session.updated handler sees info.time.archived as truthy and unconditionally:

  • Removes the session from store.session (sidebar list)
  • Calls cleanupSessionCaches() which deletes all messages, parts, diffs, todos, permissions, questions, and session_status

This makes sync.session.get(id) return undefinedsubmit.ts shows the error toast. And since messages are deleted from the store, the timeline goes blank.

Expected behavior

Interacting with an archived session should unarchive it and place it back in the sessions sidebar. Message caches should not be destroyed when a session is archived since archive is reversible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions