th-d9fa29: talk to your Smooth Operator again — rewire over the SEP WebSocket#249
Merged
Conversation
…WebSocket
POST /organizations/{org}/smooth-operator/chat was DELETED upstream
(SMOODEV-2673), so ask_business (Claude Desktop/Cursor) and the CLI both 404'd
against a route that is never coming back.
Add smooai::smooth_operator_ws::operator_turn — mint a short-lived ES256 socket
token from api-prime, connect wss://smooth-operator.smoo.ai/ws,
create_conversation_session (resume by conversationId) -> send_message ->
buffer frames until eventual_response. Hand-rolled: the smooth-operator crates
are server-side and ship no Rust client, so this matches the wire shapes in
smooth-operator-server's protocol.rs / handler.rs.
Confirmation is now INLINE — the socket parks the turn on
write_confirmation_required and takes confirm_tool_action on the same
connection. So approval is a flag (ask_business approve=true / chat --confirm)
rather than a second round-trip; without it the action is declined and
surfaced, never silently run. Retires `th api smooth-operator confirm` (now
explains the change) and deletes the dead REST turn types/helpers.
Verified LIVE against production on both surfaces: ask_business returned a real
operator reply + conversation id over MCP, and `th api smooth-operator chat`
round-tripped over the socket. 375 tests pass; clippy clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ZctFb4oiWoJraHN2db1nX
🦋 Changeset detectedLatest commit: 68294ff 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 |
brentrager
enabled auto-merge (squash)
July 23, 2026 22:17
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.
Problem
POST /organizations/{org}/smooth-operator/chatwas deleted upstream (SMOODEV-2673, PR #3171) along with the wholerun_turnpath — it is not coming back. So both surfaces that talk to the org agent were pointed at a dead route and 404'd:ask_business— the MCP tool Claude Desktop / Cursor / VS Code useth api smooth-operator chat— the CLIFix
New
smooai::smooth_operator_ws::operator_turndrives the supported SEP WebSocket transport:POST /organizations/{org}/smooth-operator/tokenwss://smooth-operator.smoo.ai/ws?token=…create_conversation_session(passconversationIdto resume) →send_message {stream:true}eventual_responseHand-rolled deliberately: the
smooth-operatorcrates are server-side only and ship no Rust client, so this matches the wire shapes insmooth-operator-server'sprotocol.rs/handler.rs. Addstokio-tungstenite+futures-util.Approval model got better
Confirmation is now inline: the socket parks the turn on
write_confirmation_requiredand takesconfirm_tool_actionon the same connection. So approval is a flag (approve: true/--confirm) instead of a second round-trip. Without it, the destructive action is declined and reported ("I did NOT do this without your approval"), never silently run. The oldth api smooth-operator confirmsubcommand is retired with an explanation, and the dead REST turn types/helpers are deleted.Verification — live against production, both surfaces
ask_businessover MCP → real operator reply + threadedconversation_id.th api smooth-operator chat→ round-tripped over the socket.Unblocks the "talk to your business from Claude Desktop / Cursor / the CLI, authed via
th auth login" story end-to-end (epic th-093ce3).🤖 Generated with Claude Code