Skip to content

fix(inbox): a Send always ends, clears on the answer, and is safe to retry - #2459

Closed
backnotprop wants to merge 3 commits into
mainfrom
fix/inbox-send-stuck
Closed

backnotprop wants to merge 3 commits into
mainfrom
fix/inbox-send-stuck

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Why

The owner, on a phone: Send turns dim after pressing and never sends, until a refresh. No write in the Send chain had a time limit, so a request dropped on the way (no reset, no answer) held Send for good. The owner's real list is 396 kB and answers in 18 ms, so the list is a smaller factor: a slow link was slow, not stuck.

What changed

  • Every step of a Send has a limit. 20 s for a write, 8 s for a small read. A timeout shows a line near Send and gives Send back. The draft and the key are kept.
  • A retry does not double. A POST with no answer is looked for by key. The next Send reads the thread first, from the foot too.
  • Send clears on the reply's answer, not after the thread and list re-reads.
  • One list read at a time per window, one queued after it, and the list is gzipped through the tailnet listener. Loopback stays plain.
  • Same limits for New message, compose, Send to another session, Send now, Re-ask and Decision Mode.
  • Reload cases. The key and typed words now live on the device until confirmed (sendKeys.ts, unsavedWords.ts).

No new setting, shortcut or visible state. The guide is docs/agent-guides/inbox-messages.md ("A Send always ends").

Tests

Bun 1.4.4 CI lanes: dom-1 to dom-4 and unit-1 to unit-3 pass. The heavy lanes were not run, because they drive real agent processes.

Playwright on Bun 1.3.14, compiled binary:

  • inbox-send-stall-webkit.spec.ts (new, 11 scenarios) passes, including a connection that dies silently mid-request through a TCP relay, with the reply landed or not. That scenario fails on the unfixed binary.
  • Reply drafts, draft after Send, Decision Mode, compose, New message, Re-ask and Send now pass on this head. An earlier run before the Decision Mode commit also covered picks composing, tailscale, thread foot, tag handoff, live reconnect, refresh, open questions and mobile.

Shaped link, real list size (407 kB), seconds to Send cleared, before then after:

Link h1 busy h2 busy
5 Mbit/s 10.4 to 0.45 11.8 to 2.7
2 Mbit/s 40.0 to 0.42 48.1 to 12.2

Most list reads open at once went from 10 to 1.

What remains

  • Real iOS and a real tailnet are untested. The cause on the phone is inferred, not caught.
  • Compose and New message keys live in the page, so a reload there makes a new message.
  • A new agent message between two tries takes a new key, so only the read-back stops a double words reply.
  • Send to another session and Send now keep their "try again" lines on a timeout.
  • A session mismatch still needs its reload.
  • Comments, the thumbs-up and uploads have no limit. They hold no Send.
  • The foot shows no text while busy. That is left for a decision.

…retry

A request dropped on the way, with no reset and no answer, held Send dim for good: nothing in its chain had a time limit. Every step now has one; a timeout shows a line near Send and gives Send back with the draft and the key kept, and the next Send reads the thread first. Send clears on the reply's answer, not after the re-reads. The list is one read at a time, and gzipped through the tailnet listener. Keys and unsaved words survive a reload on the device.
Its pick chain and fresh reads get the same limits, and a write that timed out says it may have gone.
@backnotprop

Copy link
Copy Markdown
Owner Author

Replaced by #4158, which merged the same goal (a Send always ends, and a retry reuses its key so a reply is not stored twice) on current main, after two independent reads.

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