feat(megazord): atomic thread-turn round-trip for thin clients - #5
Merged
iB2 merged 1 commit intoSep 13, 2026
Merged
Conversation
A thin client (WhatsApp bridge, T3 GUI, another machine) appends a turn to
the single owner-hosted orchestrator session and needs the answer back in one
call. Today that is two calls (`t3-dispatch --thread` then `t3-thread-wait`),
with the caller computing its own `since` — a race that can latch onto the
previous turn's answer.
Add `MegazordT3DispatchClient.sendTurnAndAwait`: capture `since` BEFORE the
turn is sent, compose `dispatch({threadId})` (turn.start only, never
thread.create) with `awaitTurn`, and return the assistant reply tagged with
the account that ran it. Ships `bin/t3-thread-turn.mjs` (one-shot CLI) and
unit tests (injected fetch): continues the existing thread, reads the reply,
refuses a missing threadId before any I/O.
Extends the existing dispatch stack; no duplication of dispatch/awaitTurn.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
See branch commit for details. Adds MegazordT3DispatchClient.sendTurnAndAwait() + bin/t3-thread-turn.mjs (atomic send-turn-and-read-response) + unit tests (38 passed). Companion to whatsapp-claude-bridge PR pingdotgg#16 (live proof: thread 96021b02-9e5b-412b-b47e-51abeca4a51b recalled 7431 across turns). Base is the integration branch feat/megazord-cockpit-bidirectional (dispatch stack not yet on main).
Generated with Claude Code.