Skip to content

Session restoration can attach messages to a non-existent or wrong conversation task #11769

Open

Description

@seemeroland

Summary

Session restoration can fail with an error like tried to add messages to non-existent task. In at least one case, starting a new conversation appeared to continue an old conversation instead of creating an isolated new one. Another reproducible case loses conversations after restarting Warp.

Internal report

Observed behavior

  • Warp may attempt to add restored messages to a non-existent task.
  • A newly started conversation may continue an older conversation.
  • Conversations can be lost after restarting Warp.

Expected behavior

Restored conversations should remain associated with the correct existing conversation/task, and starting a new conversation should not continue an unrelated older conversation.

Activity

  1. added
    warp:internal-report
    on May 27, 2026
  2. warp-for-oss commented on May 27, 2026

    @warp-for-oss
    Contributor

    @seemeroland

    Here's what I found while triaging this issue:

    This appears to be an agent session-restoration routing bug. I found related restored-conversation issues, but this report has a distinct task-ID/conversation-association failure mode, so it should stay separate for now.

    I have a few follow-up questions before I can narrow this down:

    1. Can you attach a redacted screenshot or short recording showing the restored pane when the new or wrong conversation appears?
    2. What minimal sequence reliably triggers the tried to add messages to non-existent task error after restarting Warp?

    Reply in-thread with those details and the triage workflow will automatically re-evaluate the issue and update the diagnosis, labels, and next steps.

    Maintainer details

    I concluded that restored agent conversations can route follow-up or replay messages to a stale/mismatched task or conversation after restart, causing missing restored conversations, wrong-conversation continuation, or task-not-found failures..

    Triage summary

    This looks like an agent conversation/session-restoration bug, not a shell or terminal-emulation issue. The report combines three related symptoms: restored messages can target a missing task, a new conversation can appear to continue an older one, and conversations can disappear after restart.

    Code-path notes

    The most relevant restore flow is:

    • app/src/pane_group/pane/terminal_pane.rs snapshots conversation_ids_to_restore and an optional fullscreen active_conversation_id.
    • app/src/persistence/sqlite.rs persists and reloads those terminal-pane conversation IDs.
    • app/src/ai/restored_conversations.rs stores restored conversations by AIConversationId, then app/src/pane_group/mod.rs consumes them while recreating terminal panes.
    • app/src/terminal/view/load_ai_conversation.rs restores AI blocks and calls BlocklistAIHistoryModel::restore_conversations; it currently picks the active conversation from the last restored AI block, while the saved fullscreen Agent View conversation is restored later.
    • app/src/ai/blocklist/history_model.rs routes response/client actions by active conversation, response stream, and task ID.
    • app/src/ai/agent/conversation.rs handles AddMessagesToTask by removing/updating the exact task ID from TaskStore.
    • app/src/ai/agent/task_store.rs has an optimistic_root_task_id alias so get() can resolve a stale optimistic root ID after root-task upgrade, but paths like remove(&task_id) do not appear to apply that alias. A delayed/restored AddMessagesToTask that still references the old root task ID can therefore become TaskNotFound.
    • Shared-session/ambient restore adds another routing surface: app/src/ai/blocklist/controller/shared_session.rs can reuse a selected empty conversation for an incoming stream and can rebind forked conversation tokens, while app/src/terminal/shared_session/replay_agent_conversations.rs reconstructs CreateTask and AddMessagesToTask events for replay.

    Likely root cause

    Medium confidence: restored or replayed agent client actions are being associated with stale task IDs or with a conversation selected/restored out of order. The task-not-found symptom is consistent with the current TaskStore alias only being honored by lookup paths, not by the remove/update path used when adding messages. The wrong-conversation symptom is also consistent with startup restore choosing one active conversation from restored block order while Agent View and shared-session token binding can later select or rebind a different conversation.

    Duplicate check

    I enumerated all open issues and recent closed issues. Related issues include #11751 and #11252, but I did not mark this as a duplicate because this issue is specifically about task-ID/conversation routing during restore and includes the non-existent task failure mode.

    Question reasoning

    1. Can you attach a redacted screenshot or short recording showing the restored pane when the new or wrong conversation appears? — The report describes visible restored-conversation state, and visual evidence would help distinguish a display-only Agent View selection problem from messages actually attaching to the wrong conversation.
    2. What minimal sequence reliably triggers the tried to add messages to non-existent task error after restarting Warp? — A minimal sequence is needed to know whether the failing path is normal app startup restore, update/restart restore, shared-session replay, fork/resume, or Agent View fullscreen restoration.

    This is my automated analysis and may be incorrect. A maintainer will verify the details.

    Powered by Oz

  3. added
    area:agent
    area:window-tabs-panes
    bug
    needs-info
    repro:medium
    triaged
    on May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentarea:window-tabs-panesbugneeds-inforepro:mediumtriagedwarp:internal-report

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions