Repository navigation
Inbox: start new agents in T3 Code, as in Rex - #3595
Merged
Merged
Conversation
New message → To → New T3 Code session in a project that is a git repository runs T3's host command, t3 thread start . - --worktree <branch> --title <name> --json, in the project's folder. T3 Code makes the thread in a new worktree from the branch the folder has checked out; the message (the T3 wake's own text for it) is the first turn on stdin and is recorded as delivered, so replies go in through the existing T3 wake once. T3 Code is offered only where a t3 is found and only in projects that are git repositories (starts_in, worktree in the launch block); no scratch, other folder or clone. When T3 refuses, the run line quotes T3's reason with Try again. The thread is T3's: no Stop, and routines don't offer it.
…n Settings → Agents T3 Code not open (no server, or one not answering) and a folder T3 doesn't know get the host's own sentence; no answer in 30 seconds keeps its own. Any other failure shows T3's last line as a fallback, with each absolute path cut to its last name. The Settings → Agents launch row lists T3 Code, which its switch now also governs.
…3 launch
- The To line's model button lists T3's agents and models ("Claude Code · opus"),
from orchestrator_capabilities when signed in, else the pairs T3 threads used
(thread list), else Default only. A pick passes --provider/--model and
--option=effort=; Default passes none. The last pick is kept per machine.
- After the start, thread show names what T3 runs it on, in the thread's header
and the agent row's card.
- The T3 wake never takes the launch: placeholder for a T3 thread.
- One store write moves the root, marks it delivered and re-addresses replies
written during the start.
- Try again adopts the thread a timed-out or cut start made (thread list by
title), with plain words for an Inbox restart mid-start.
- The not-connected line after 10 minutes with nothing heard from the thread.
- The server refuses Stop for a T3 launch, and T3 Code for routines.
- Every flag in the --name=value form. T3 not open names the machine.
- A dotfiles repository at home does not make every folder a git project.
- A two-Inbox test for T3 on a linked machine.
…d line - Try again adopts a T3 thread only after an uncertain start (timeout, a start that named no thread, an Inbox restart during it), never after T3 refused, never one made before the start or already tied to another launch or Inbox thread. Two messages with the same title no longer share a thread, and a first message is never marked delivered into the wrong one. - The not-connected line asks T3 first (thread show: status, activeRunId, pendingRequestCount) and shows only once the turn ended or T3 can't be asked; the 10 minutes count from the Inbox's own start when later. For T3 the line has no Try again, the server refuses one in plain words, and a T3 launch is never respawned, so it never reads "stopped". - A last model T3 no longer lists falls back to Default, and a Send or Try again with it is refused in words; T3's own refusal words show otherwise. - The T3 MCP connect has a time limit. - Tests: the reviewer's same-title scenario, long turns and restarts, the no-retry line, routines refusing T3 on create and edit, the test-run t3 lookup, and the real first-turn text in unit tests.
…ce a turn ended - "T3 Code doesn't list <agent> · <model>." (was "no longer lists", false for a model that was never listed). Refused only on a signed-in T3's capabilities, never on the "already used" list; tested both ways. - Once T3 said a thread's turn ended, the not-connected line no longer runs `t3 thread show` each minute. - Docs: the follow-ups C2, C3 and C4.
backnotprop
marked this pull request as ready for review
November 17, 2026 16:34
…rted here The not-open line named this machine even in its own window (on a CI box, a raw host name). It now names the machine only for a launch another linked machine sent here, with the name linked machines know it by, as the engine's own not-ready line does; a launch started here reads "this computer".
ComposeDialog grew past its size ceiling with the T3 Code launch. The start a pick makes (another folder, the scratch folder, a project, T3 Code's own projects and worktree) and Add agent's default start are now pure functions in compose/model.ts (`composeStartOf`, `addAgentStart`), with a unit test, and the dialog calls them. ComposeDialog is 1883 lines, and its ceiling follows it down.
…ct by itself, then start the thread
… first model To lists; plain words when none is
Settings → Agents' "Start new agents in" gains T3 Code. A Send starts the person's Claude Code, Codex, OpenCode or Pi as a T3 thread on the model T3 last ran that agent on in the project, else T3's own first model for it, read once with a one-minute read-only token T3 issues and revoked after. When T3 Code isn't open or says no, the agent starts in the background and its line says why. T3 Code is no longer an agent in To, and the Inbox never opens T3's app.
Every start makes the Inbox's folder a T3 project of its own first, so T3 never runs the thread in a project that holds it or in another checkout. The model picked in New message goes to T3 with its effort, as Rex does; only with none picked does the project's newest thread or T3's list (the token) decide. A model T3 refuses gets one more start on T3's own, and the line says what T3 refused. A run T3 says failed shows its line at once. Clones wait for the agent's own trust; the Agents hover says T3 Code; Stop, Open and Try again refuse with launch_in_t3. Early replies move only for a start that took the first turn, and the effort check is main's again.
A folder the agent doesn't trust yet, such as a clone that brings hooks, now waits for its own Trust folder before the T3 start, as Rex's start does, and Trust folder saves that trust and starts it in T3. An effort T3 refuses gets one more start on the person's model without it, and the line and header name the effort, not the model.
…-work # Conflicts: # apps/mobile/contract/generated/swift/Wire.swift # apps/mobile/contract/parity/ledger.json # docs/agent-guides/inbox-launch.md # docs/agent-guides/server-and-storage.md # packages/inbox/components/Thread.tsx # packages/server/inbox-agents-list.ts # packages/server/inbox-launch.ts
…-work # Conflicts: # apps/mobile/contract/parity/ledger.json
…-work # Conflicts: # apps/mobile/contract/parity/ledger.json # packages/inbox/agents/model.ts
…n Try again
Only Claude Code in a T3 thread reaches the Inbox as the thread (T3 gives
T3CODE_THREAD_ID only to its Claude). Codex, OpenCode and Pi write under
their own session ids, so after the ten-minute wait their run line said
"hasn't connected" even when they had answered. Now an agent counts as
connected once it writes in the launch's own thread: a session of the
launch's agent (or the T3 thread), since the start, whose first message in
this Inbox is in that thread, that no person brought in before it wrote,
and that is no other launch's.
Adoption on Try again skipped any T3 thread whose session the Inbox knew,
including this launch's own once its agent had written, so a start the
Inbox closed during could make a second thread and deliver the message
twice. It now skips only threads that are another launch's or another
Inbox thread's, takes exactly one candidate, and works with no list before
the start (by T3's createdAt). A start whose agent already wrote never
starts anything new, here or in the background; such a launch settles on
its thread by itself. When T3 can't list the threads at Try again after an
uncertain start, nothing new starts and the line stays.
A T3 whose CLI has no --option ("Unrecognized flag: --option") is read as
the effort not taken, not the model.
… the test can't pass on timing
- Two or more threads that a cut-short start may have made: Try again takes none and starts no new thread; the line stays (t3MadeOf). - A T3 thread's words count as the launch's agent only for a Claude Code launch; settleWritten takes a Claude writer's thread only once T3 lists it under the launch's title. - While another start of the same title in the same folder is running, its thread is never taken by this launch's Try again. - A start whose named thread another launch already holds settles on neither: the uncertain line, and Try again takes that thread once it is free, never a new one.
# Conflicts: # apps/mobile/contract/parity/ledger.json # packages/inbox/components/RunLine.tsx
The T3 spec's launch helper read the Send's answer with waitForResponse(...).json(), DevTools' copy of the body. Chromium sometimes keeps none for an answer the window reads as a stream (microsoft/playwright#42742), so the second test failed with "No data found for resource with given identifier" though the window read the answer. Read it as the other launch specs do since acd07ad: from a copy of the window's own Response (page-answer.ts nextPostAnswer).
DuongCoder04
pushed a commit
to DuongCoder04/plannotator
that referenced
this pull request
Nov 29, 2026
Move the marker from f00a501 to b74c769 and list the additive ./inbox-* changes core 0.25.37 carries from backnotprop#4161, backnotprop#4172, backnotprop#4194, backnotprop#3595, backnotprop#4186, backnotprop#3676 and backnotprop#3598.
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.
This push: fixes from the independent review (F1, F3, F4; F2's classification)
Merged main at
cd9066c76d(clean). No words a person reads changed: every line below uses strings this PR already had.F1: Codex, OpenCode and Pi in T3 Code were never seen as connected. T3 gives its thread id (
T3CODE_THREAD_ID) only to the Claude it runs, so only Claude reaches the Inbox as the T3 thread. Codex, OpenCode and Pi write under their own session ids, and nothingt3 thread show/listprints names those ids. So ten minutes after the start, their run line said " opened in T3 Code but hasn't connected to the Inbox", even when the agent had already answered.t3LaunchWriterOf,heardFrom). The writer must meet all of these:t3 thread sendinto the same T3 thread). OpenCode and Pi get it through their own Inbox client. The T3 wake leaves it alone, so the reply is delivered once.F3: an Inbox restart could lead to a second thread and a double delivery. On Try again, adoption skipped every T3 thread whose session the Inbox knew. That included the launch's own thread once its agent had written in it.
sessionElsewhere). It takes a thread only when exactly one candidate fits.start(…, { wrote })).settleWritten). For Claude, the thread is the session that wrote, oncethread listshows it under the launch's title. For the other agents, the thread is found withthread list.F4: Try again after a start whose thread list had failed. The start record now keeps
listed: falseand how the start ended. On Try again, the Inbox lists the threads again and takes the thread by its title and T3'screatedAt. If T3 still can't list the threads after an uncertain start, nothing new starts and the line stays as it was.F2 (classification only): a T3 whose CLI has no
--optionrefuses the flag with Effect's CLI parser words, "Unrecognized flag: --option in command …". That refusal is now handled as the existing "didn't take the effort" case: one more start on the person's model without the effort. Before, it was recorded as "T3 Code didn't take the model". The words come from T3's vendoredeffect/cliin an older T3 source than the installed 0.1.9.Tests (stand-in
t3only, in a scratch home; nothing fakes "heard", and each agent writes under the identity its own Inbox client would have inside T3):inbox-launch-t3-agentsinbox-launch-t3inbox-t3-localinbox-launch-t3-readyinbox-launch-t3-rexagentsModelinbox-structuretscis clean for server, shared, inbox and the hook server.Known, not fixed
--option=effort=…at all. Only a real T3 can answer that.run(). T3 attempts can use it up before the fallback to the agent's own host.t3 project add, so each folder becomes a permanent T3 project. This is the owner's decision.--option, on the person's pick, is recorded asdeclined=<model>.wrotecan be true with nothing pending (an untrusted folder waiting for Trust folder, or a same-agent writer), so the line keeps "The Inbox closed while T3 Code was starting" and Try again never starts anything.Earlier push (merge of main, no feature change)
dc0fbb8d7e(merge commit4891917a74). Main had moved by 384 commits. Nothing a person sees or reads changed beyond what this PR already did.packages/inbox/agents/model.ts. Main (Inbox: name sessions started in Oh My Pi "Oh My Pi" (#3443, part 1) #4075, the Oh My Pi name) replacedINBOX_HOST_NAMESwithinboxHostName(host, runtime), and the hover card now callsagentHostName(agent.host, agent.runtime). This branch adds the T3 inner-agent words ("T3 Code (Claude Code · opus)"). The resolution keeps both: the host name comes from main's runtime-aware helper, and the T3 wrapper goes around it as before.apps/mobile/contract/parity/ledger.json. Took main's copy, then regenerated it withbun scripts/mobile/all.ts, which put back this branch's T3 wire fields.bun scripts/mobile/check.tspasses.bun.lock: regenerated bybun install. Against main, only workspace versions change (0.29.5 to 0.29.6). Main's own lock was behind its package.json.inbox-types,AgentsSection,Thread,inbox-agents-list,config,store,inbox.tsand the docs.inboxLaunchStops) still gets the T3 flag.Verified / not verified
Verified on this head (locally):
tscis clean for core, shared, server, inbox, apps/inbox and the hook server.Tests, each run on its own:
inbox-launch-t3inbox-launch-t3-rexinbox-launch-t3-readyinbox-t3-localagentsModelohMyPiNameagentsSettingsremoteLaunchThreadinbox-structuredom-test-allowlistagents-md-sizeA sandboxed Inbox built from this head, with a
t3that does nothing and T3 not running:t3_here: true,t3_open: falseandt3_agentsClaude Code, Pi, Codex and OpenCode.Left to CI: the two-Inbox test
inbox-remote-launch-t3.test.tsand the browser spectests/e2e/inbox-launch-t3.spec.ts. Both start Inboxes.Only from the stand-in T3 (
tests/helpers/fake-t3.ts), never a real T3 Code:t3 thread startt3 thread sendSeen against a real T3 Code (0.1.9, 2026-11-18, on an earlier head of this PR, no thread made):
t3 thread start . - --title=… --jsonparsed as far as T3's project check.t3 project add <folder>adds the folder (0.25 s).Not verified at all:
--subject=mcp-client --ttl=1mand--provider/--model.What a person can do now
Settings → Agents → Start new agents in now offers T3 Code, beside "In the background" and "Rex". The option shows when T3 Code's
t3is on this computer, or when it is already the choice. This follows the Rex setting. T3 Code is not an agent in To. The person picks Claude Code (or Codex, OpenCode, Pi) in New message and presses Send, as before. The agent then starts as a new T3 thread on that agent, in exactly the Inbox's folder, and the message is its first turn. The model and effort picked in New message are used, as Rex uses them. With none picked, T3's own model is used. There is no other step.Where it runs
Every start first runs
t3 project add <folder>. "Already exists" counts as done. T3 runs.in the deepest project that holds the folder, or, when no project holds it, in another git checkout of the same repository (T3'sresolveProjectincli/thread.ts). Without the add, a folder inside another T3 project, or a git worktree of a repository T3 has, would run in that other folder. The stand-in now resolves projects the same way, and a test covers both cases.How the model is picked
--provider=<the agent's T3 instance> --model=<pick> [--option=effort=<v>].t3 thread list --json. T3's own CLI reads it under its own session, so the Inbox needs no credential.orchestrator_capabilitieson T3's loopback/mcp, under a token that the person's own T3 issues for this one read (see Security below). This is the only case that uses a token.No simpler route exists for step 3. T3's CLI has no command that prints the models or the default.
thread startwith no model fails on a project that has no default. The defaults are kept behind T3's auth.When T3 Code can't take it
The agent starts in the background, the same as without the setting, and the line says why. This is the Rex behaviour:
launch.t3.unavailable)launch.t3.refused), and the line says what it refused:declined)why: "no_model"; this also covers a T3 too old to issue the token)declined_effort)why: "project")Every string, and the Rex string it mirrors
409 launch_in_t3, as Rex'slaunch_in_rex)Security review: the token for the model list
t3 auth session issue --scope=orchestration:read --subject=mcp-client --ttl=1m --label="Plannotator Inbox" --json.orchestration:readis T3's own scope for a read-only MCP client (mcpClientScopes("read-only")).mcp-clientis the only subject that T3's/mcpaccepts.t3 auth session revoke <sessionId>right after the one call, whatever the call returned.t3AskModels(packages/server/inbox-launch-t3.ts), read only by the T3 client's token getter for oneorchestrator_capabilitiescall. The variable is cleared infinally, and the client is closed.server-runtime.json. Anhttps:or non-loopback origin gets no token, and no token is asked for.packages/server/inbox-launch-t3.test.ts, "no thread on that agent yet…". It runs the engine with the Inbox's debug log on, at<dataDir>/inbox/debug.log, then greps every file under the data folder: debug.log, start.log, the store and t3-start.json. It also greps every logged line and everyt3argv and env that the stand-in recorded. The random token appears in none of them.t3CLI and T3 home, which any process running as that user already has.t3itself.apps/pi-extensionneeds no twin.What the stand-in proves, and what only the real T3 can
tests/helpers/fake-t3.tsnow answersauth session issue(pretty JSON, as T3'sformatIssuedSessionprints it) andauth session revoke. It records the flags but never the token. Its MCP server accepts only the issued token.The tests prove:
Only a real T3 can prove:
--subject=mcp-clientand--ttl=1mare accepted by the installed T3 version;claudeAgenttakes the Inbox's model ids (for examplesonnet);orchestrator_capabilitiesanswers with that token;thread startwith no--worktreemakes the thread where T3's New thread would.A minimal real check is written for the owner.
Other changes the review asked for
Tests
tests/helpers/t3-launch.ts, the engine with the setting, against the stand-in, with the agents' own hosts as stand-ins.packages/server/inbox-launch-t3.test.tsinbox-launch-t3-ready.test.tsinbox-launch-t3-rex.test.tsinbox-remote-launch-t3.test.ts(two Inboxes; CI only)packages/inbox/remoteLaunchThread.test.tsxpackages/inbox/agentsSettings.test.tsxtests/e2e/inbox-launch-t3.spec.ts