Skip to content

fix(desktop): keep unsent prompts across restarts - #15

Merged
kitlangton merged 2 commits into
mainfrom
outbox
Nov 8, 2026
Merged

kitlangton merged 2 commits into
mainfrom
outbox

Conversation

@kitlangton

@kitlangton kitlangton commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Sending a prompt no longer depends on the connection surviving the next frame. Enter saves the prompt and shows its bubble. A timeout checks whether it arrived; a rejection keeps the words editable.

🔍 Origin: reported messages disappearing while the desktop app reconnected.

sequenceDiagram
    participant App
    participant Disk
    participant Server
    App->>Disk: Save prompt and ID before clearing composer
    App->>Server: Admit prompt under that ID
    opt Reply lost or app restarted
        App->>Server: Check inbox, then exact message
        Server-->>App: Present, absent, or unknown
        App->>Server: Resend only if absent, with original ID
    end
Loading
- clear composer after handing the prompt to a worker; keep receipt in memory
+ save the request, then clear; keep the bubble through restart
+ check a lost reply before retrying, editing, or dropping the prompt
Local mock Before After
First event-stream retry after a 503 2,090 ms 251 ms
Startup inventory, 50 ms per read 776 ms 330 ms

The server accepted a POST and closed the socket before replying in the restart test. The reopened app checked its receipt and did not POST again. Focus and network-change signals interrupted a sleeping retry in under 1 ms on loopback. These are mock timings, not measurements of the reported outage.

↩️ Undo: an older build cannot read the new outbox. Let pending messages finish before downgrading.

👀 Read: apps/desktop/src/send_failed/outbox.rs stores the original request, including attachments and delivery mode. Ordinary prompts reuse their admission ID. Worktree creation and rewind are not blindly replayed after an ambiguous result. Shell and slash commands are not offline prompt admissions.

Checks run
  • cargo test --locked -p opencode-desktop -- send_failed:: new_session::tests reconnect::tests: 34 passed. A separate busy-steer rejection test passed for seven 4xx responses.
  • Targeted client reconnect and first-prompt rejection tests passed. cargo check --locked -p session-view --examples passed.
  • Measured the startup inventory separately and inspected a dark headless fixture still.
  • Broader launch filter found one idle allocation rather than zero; also one on clean main at the same base commit. Folder-shape already reports two errors on the base branch.

@kitlangton
kitlangton merged commit 0c48a41 into main Nov 8, 2026
kitlangton added a commit that referenced this pull request Nov 10, 2026
…s with them, not above them (t1361, t1501) (#73)

Since the outbox admits one prompt at a time (#15), a steer sent while another was
in flight showed as its bubble in the timeline, above the steers the server would
deliver first; when they landed it jumped below them ([p1 p4 p5 p2 p3]). It now
waits in the inbox behind them, as a fresh send after a stop does (#347).
Hona added a commit that referenced this pull request Nov 11, 2026
… start edge, as Desktop's aside's do. The side region's slot clipped the card's elevation (outside its box) at its start, so the 0.5 pt ring and its shadow were missing down the card's left side; a clip 4 pt wider on that side lets them show while the region is open or sliding, and none once it rests shut. At 1x the card's start edge now reads #f9 #f8 #e6 | #ff in light and #8 #7 #15 | #16 in dark, Desktop's #f9 #f8 #e6 | #ff and #8 #7 #16 | #16, where it read #fa #fa #fa | #ff.
kommander pushed a commit that referenced this pull request Nov 22, 2026
…elude of opencode 60732569a

translate.functions: mark (#17) and the heap cap's top-level counting (#15). The prelude builds trees with a copy per changed node only (3fd76d3b6), and has native mode. A function marker reads as JSON leaves a function out.
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.

1 participant