Skip to content

feat(megazord): atomic thread-turn round-trip for thin clients - #5

Merged
iB2 merged 1 commit into
feat/megazord-cockpit-bidirectionalfrom
feat/worker-spike-thread-turn
Sep 13, 2026
Merged

iB2 merged 1 commit into
feat/megazord-cockpit-bidirectionalfrom
feat/worker-spike-thread-turn

Conversation

@iB2

@iB2 iB2 commented Sep 13, 2026

Copy link
Copy Markdown
Owner

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.

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>
@iB2
iB2 merged commit c5dde05 into feat/megazord-cockpit-bidirectional Sep 13, 2026
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