feat(server): add t3 wake command to send a message to an existing thread - #6
Conversation
- Sends a message to a running server or desktop app and requests a turn, using the thread's existing provider, model, and modes - Extracts shared running-server discovery from t3 pair into cli/runningServer.ts - Never starts a server; fails cleanly when none is running
- Set the thread ID env var across Claude, Codex, Cursor, Grok, OpenCode, OhMyPi, and Antigravity sessions, including Codex shell tools and ACP child commands - Document the variable and its limits in docs/user/composer.md
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a05cb11d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What Changed
Adds a
t3 wake <thread-id> <message>CLI command that sends a message to an existing thread and requests a turn through the running server, without minting new state or touching the persisted thread. Discovery of a running server (state file lookup, pid liveness, well-known descriptor probe) was extracted fromt3 pairinto a sharedcli/runningServer.tsmodule, andwakereuses it.The command:
PROVIDER_SEND_TURN_MAX_INPUT_CHARS) before touching any server state.T3CODE_HOMEprecedence ast3 pair.thread.turn.startcarrying the message and the thread's current runtime and interaction modes, revoking the session afterwards.Also: agent subprocesses now receive
T3CODE_THREAD_IDin their environment across all providers (Codex, Claude, Cursor, Grok, OpenCode, Antigravity, OhMyPi), so spawned agent tooling can identify the thread it is driving.Why
Waking an existing thread currently requires the web/mobile client. A CLI entry point lets scripts and other agents push a follow-up message into a thread from the terminal or automation, which pairs naturally with the new
T3CODE_THREAD_IDenvironment variable — an agent running inside a thread can wake another thread (or be woken) without human intervention.Extracting server discovery from
pair.tskeepspairunchanged behaviorally while givingwake(and future commands) one correct implementation of "find the running server," including the stale-state and port-reuse guards.UI Changes
Not applicable — CLI only.
Checklist