Skip to content

Instant message echo + strict send ordering (connects move to beforeTurn) - #14

Merged
DIodide merged 1 commit into
mainfrom
fix/send-feedback-ordering
Aug 31, 2026
Merged

DIodide merged 1 commit into
mainfrom
fix/send-feedback-ordering

Conversation

@DIodide

@DIodide DIodide commented Aug 31, 2026

Copy link
Copy Markdown
Member

Fixes the vanishing-message feel (send awaited a 1–3s MCP connect before echoing) and the out-of-order sends it caused (a fast second setup could overtake a slow first one). Connections open server-side in beforeTurn, which merges the fresh MCP tools into the turn; client sends immediately and serializes through a chain.

Note: the main-branch deploy job will fail until the CLOUDFLARE_API_TOKEN repo secret is refreshed (token expired 2026-08-29).

https://claude.ai/code/session_01MKLJUWk6biNAKXupHTTWn5

Since the hibernation fix, send() awaited a setup(connect) round-trip
(DO wake + engine MCP connect, 1-3s) before sendMessage — so a sent
message vanished from the composer with nothing echoed on screen, and
two quick sends could invert: the first paid the slow connect while the
second found connections open and overtook it on the wire.

Connections now open server-side in Think's beforeTurn (which returns
the freshly connected MCP tools to merge into the turn, since Think
assembles its automatic toolset before the hook while nothing is
connected). The client sends immediately; sends are additionally
serialized through a promise chain so ordering can never invert, with
the first-message settings push bounded at 4s so it can't swallow a
message. Retry no longer needs a pre-connect either, and plain settings
pushes on chats skip Google entirely (the consent flow is desk-only).

Claude-Session: https://claude.ai/code/session_01MKLJUWk6biNAKXupHTTWn5
@DIodide
DIodide merged commit efe8c3f into main Aug 31, 2026
2 checks passed
@DIodide
DIodide deleted the fix/send-feedback-ordering branch August 31, 2026 20:58
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