CLI: add --mode to `t3 thread send` (auto | queue | steer | restart)
t3_thread_send accepts mode: "auto" | "queue" | "steer" | "restart", but t3 thread send always sends mode: "queue" (apps/server/src/cli/thread.ts, threadSendCommand). Scripts that drive T3 from outside can therefore only queue a new turn; they cannot steer a running one.
Use case. We bridge Slack threads to T3 threads: a daemon runs t3 thread send <id> --wait - for each new message in a bound Slack thread. When someone adds a correction while the agent is mid-turn ("actually, check staging, not prod"), queueing makes the agent finish the wrong turn first. auto (start if idle, steer if running) is the behaviour we want, and the server already implements it.
Proposal. A --mode <auto|queue|steer|restart> flag on t3 thread send, defaulting to queue so current behaviour is unchanged, passed through to t3_thread_send. With --wait, wait on the runId the send returns (for steer that is the running turn), as today.
Related: #29863 (--effort on start/send).
Same need here, from a Telegram bridge. A small gateway runs t3 thread send <id> - --wait --json for each incoming chat message. Chat messages often come in quick bursts, so the second and third messages arrive while the first turn is running. Today the gateway holds and merges them itself, but anything that lands after the turn starts becomes a separate queued turn and the user gets two replies. --mode auto would match the phone composer.
Two details that matter for a bridge:
--waitwithsteer: waiting on the run the send returns, as the issue proposes, works for us as long as the reply printed (or shown afterwards bythread show) is the final assistant message of that run, including the steered part.- Pending requests (#26841): if a steer cancels a pending question or approval,
autowould hit this every time the agent is waiting on the user. It would help ifautoqueued instead of steering while the run has a pending request, or if the CLI documented that it doesn't.
Seen on 0.1.7 (macOS, launchd service); threadSendCommand still hard-codes mode: "queue" on main (9e85538535).
Same need from a Google Chat bridge. A small forwarder service passes each Chat message to the T3 thread for that conversation with t3 thread send <id> -. When people reply while the agent is mid-turn, each reply waits as a separate queued turn. The agent finishes its current answer without the new context, then answers each queued message on its own.
t3_thread_send already supports auto, so passing a --mode auto flag through would let the bridge behave like Send now. A default of queue would keep current scripts unchanged.
We have the same Slack use-case!
+1 for this!
Slack support would be very handy!
Same need from a Slack bridge. Two findings from working around it that may help whoever picks this up:
- The MCP workaround is closed to headless scripts too. A script can mint its own MCP session with
t3 auth session issue --subject mcp-client --scope orchestration:read --scope orchestration:operateand callt3_thread_sendwithmode: "auto"at/mcp. That session has noruntimeModeCeiling, though, soclientModeCeilingtreats it asapproval-required. Against a full-access thread,t3_thread_send(any mode) andt3_queuepromote_to_steerare both refused withruntime_mode_escalation_denied("Child runtime mode full-access is broader than parent mode approval-required"). The only way to raise the ceiling is the OAuth approval flow, and that token lasts 30 days with no refresh. The CLI itself gets around this because it callsissueMcpClientSession({ access: "full-access" })in-process, so a--modeflag ont3 thread sendwould close the gap without a new auth path. (An--accessoption ont3 auth session issue --subject mcp-clientwould be a second way.) - What a bridge has to handle once steering works: when a queued message is promoted to steer, its own queued run ends
cancelledand the message moves into the active run (inputIntent: "promoted_queued_to_steer", samemessageId). A bridge that waits on therunIdreturned by the original send will report a cancelled run instead of the answer. With--wait --mode auto(orsteer), it would help if--waitfollowed the message to the run that answers it, as the issue proposes, including when the message is promoted later from the UI rather than by the send itself.
+1, with the same need: a Google Chat bridge relays people's replies into the T3 thread that asked them, and it has to use the CLI, so a correction sent mid-turn waits until the turn ends. We'd use --mode auto for every relayed message. Filed #34503 for a T3-wide default so all agent-to-agent messages (not only the CLI) can follow the user's queue/steer choice.
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.