Pearl th-248f33: th code speaks the canonical operator protocol — parity with Big Smooth - #287
Merged
Merged
Conversation
th code sent TaskStart and waited for a bespoke `Connected` event from smooth-bigsmooth — a crate deleted with the microVM stack. Big Smooth hosts smooth-operator's canonical schema-driven WS, so every turn timed out. th code is now a first-class canonical client like the web SPA: create_conversation_session on connect (its reply IS the connection signal and carries the session id), send_message per turn, streaming via stream_token/stream_chunk. Same daemon, conversations, sessions and tools — different interface. Translation lives at the edge of client.rs onto the TUI's existing internal events, so app.rs/render.rs are untouched. Learned from operator.ts rather than guessed: toolCall AND toolResult both nest under rawResponse (reading state.toolResult strands every tool on "running"); stream_reasoning is dropped so chain-of-thought never renders as the answer; cancel/steer have no canonical verb so they emit nothing instead of a rejected frame. 262 tests green (8 new covering the translation contract; the pre-existing send test now asserts the canonical shape). Verified end-to-end: a real turn against the live daemon streams a reply. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TwUg6nyMqXHzFDsibzTKmp
🦋 Changeset detectedLatest commit: a4aeb1e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
The problem
th codespoke a protocol whose server no longer exists. It sentTaskStartand waited for aConnectedevent fromsmooth-bigsmooth— a crate deleted with the microVM stack (th-f4a801). Big Smooth now hosts smooth-operator's canonical, schema-driven WS, so nothing had spokenth code's dialect in months. Every turn died on "Timed out waiting for Connected event" (surfaced once the 401 was fixed in #281).The fix — another interface, not another protocol
th codeis now a first-class canonical client, exactly like the web SPA (crates/smooth-web/web/src/operator.ts): same daemon, same conversations, same sessions, same tools — just a terminal instead of a browser.create_conversation_sessionon connect; its reply is the connection signal and carries the session id.send_messageper turn; streaming back overstream_token/stream_chunk.Translation happens at the edge of
client.rs, mapping canonical frames onto the TUI's existing internal event vocabulary — soapp.rsandrender.rsare untouched. That keeps this a focused change instead of a TUI rewrite.Details taken from the shipped client, not guessed
rawResponse.operator.tsdocuments that readingstate.toolResultleaves every tool chip stuck "running" forever — I'd have walked straight into it.stream_reasoningis dropped, never merged into the answer stream (th-4d8682, and the persona's no-chain-of-thought rule).Verification
262 tests green. 8 new ones cover the translation contract (session-reply→connected, non-session
immediate_responsemust not be mistaken for the handshake, token/tool/reasoning mapping, no-invented-verbs). The pre-existing send test asserted the dead bespoke shape and now asserts the canonical one.End-to-end against the live daemon — a real turn streams a reply:
🤖 Generated with Claude Code