Skip to content

Persist unsent desktop Chat drafts and attachments across restarts #22699

Closed

Description

@lurunzi

Problem

An unsent desktop Chat message should survive restarting or updating Orca. Losing a long prompt and its attachment selection makes switching sessions or restarting unexpectedly expensive.

Proposed behavior

  • Restore the unsent editor document and attachment references for the same workspace, tab and pane.
  • Keep drafts isolated between sessions and split panes, including folder workspaces.
  • Clear only the draft that was actually sent; preserve edits typed while a send is pending.
  • Handle unavailable attachments or storage failures without preventing typing or sending.
  • Avoid serializing and writing the same full draft twice on each editor transaction.

Existing prototype / scope

I have a desktop prototype in my fork: draft persistence and pane isolation coverage. It needs review of retention, attachment lifetime and write frequency before submission; this is not a claim that those design questions are settled. The repeated-write concern comes from code inspection, not a performance measurement.

This request is for desktop Chat. Mobile is outside this proposal. Codex helped prepare this issue.

Activity

  1. AmethystLiang commented on Sep 26, 2026

    @AmethystLiang
    Contributor

    thanks for the feedback! we're looking into it.

  2. nwparker commented on Oct 22, 2026

    @nwparker
    Contributor

    Closing as completed after checking the full request against current main (4dd97f02d5e2).

    Desktop Chat now persists the editor document, text, attachment references, and workspace/host ownership in IndexedDB. Terminal-backed drafts use stable tab/pane keys; structured chats use conversation keys. The store restores them at startup, including folder workspaces. Missing attachments become explicit reattach placeholders, and storage failures keep the draft editable in memory with an unsaved indication and retry.

    Send handling clears only the submitted snapshot and preserves later edits/attachments. Draft updates share one store, deduplicate unchanged values, and coalesce typing writes for 250 ms, with an unload journal for unconfirmed changes.

    Evidence: the implementation landed in #25078, with later send handling in #25959 and attachment lifetime work in #30413; all are merged into main. I inspected the current draft storage/store/persistence, startup, composer, and workspace ownership paths and ran the five draft-store, IndexedDB, lifecycle, hook, and workspace-removal test files: 76 tests passed. Those cover reloads of documents and images, pending-send races, failed storage, missing attachments, and git/folder workspace ownership.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions