feat(web): queue messages while a chat is running (outbox parity with mobile) - #26
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
radroid
force-pushed
the
t3code/web-message-queue
branch
from
July 27, 2026 14:54
2bd9ee1 to
bb89478
Compare
Port the mobile "thread outbox" to the web app: submitting while a thread is busy or disconnected enqueues the message instead of erroring, and a drain sends the queue FIFO once the thread is idle and connected. The composer's primary action becomes "Queue" (Stop demoted to a secondary control) while busy; queued messages are editable/removable above the composer and persist across reloads via localStorage. Scope matches mobile except: image attachments are not queued (blob previews can't survive a localStorage reload) and offline new-thread creation is out of scope for v1. Includes fixes from an adversarial pre-land review: - Purge an environment's queued messages when it is removed, so they can't resurrect and auto-send if the same server is re-added (ports clearEnvironment; wires it into EnvironmentOwnedDataCleanup). - Never queue an image-only submit (it would enqueue a prompt claiming images are attached while carrying none, and discard the image); warn and keep the composer intact instead. - Show the "images aren't queued" warning only after a successful enqueue so a failed enqueue can't misinform. - Heartbeat the drain while messages are queued so a head held back only by the time-based idle-gate is delivered promptly. Known v1 limitation: no cross-tab reconciliation — two open tabs run independent drains over the same localStorage queue. Closes #20 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
radroid
force-pushed
the
t3code/web-message-queue
branch
from
July 27, 2026 15:11
bb89478 to
3cced85
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #20.
Ports the mobile thread outbox to the web app. Submitting while a thread is busy or disconnected queues the message instead of erroring; a drain sends the queue FIFO once the thread is idle and connected.
What's included
useThreadOutboxDrain) — a single global in-flight lock, one send at a time,canSettleidle-gate (survives a just-adopted turn), settings-sync before start-turn, transient-vs-deterministic retry classification with backoff.localStoragekey per queued message ("skip invalid, never fatal"); all mutations serialized through a FIFO promise chain (storage-first, then atom).client-runtimethread-settled predicates and environment scoping — no forked logic.Scope (matches mobile except)
localStoragereload).Pre-land adversarial review — fixed here
A 4-lens adversarial review + refutation pass found 6 findings (2 medium, 4 low). Fixed:
clearEnvironment, wired intoEnvironmentOwnedDataCleanup), so they can't linger and auto-send if the same server is re-added. Covered by a new regression test (incl. the persisted-only "zombie" case).Known v1 limitation (deferred)
localStoragequeue (no mobile parity source; narrow scenario). Documented for a follow-up.Verification
tsgo --noEmit(web): 0 errors.vp test run src/outbox: 19 passed.