The Work Beyond Chat: Terminals, Devices, Git, and Pull Requests

T3 Code’s control-plane model becomes easiest to test when an agent’s answer is no longer enough. A real task may need a terminal command, a mobile simulator, a branch, a pull request, and a review that continues after the browser closes. This chapter follows that path from a thread and workspace to reviewable delivery. It also shows why terminals, devices, and source-control actions remain environment-owned: richer surfaces add more state and credentials, rather than eliminating the need for boundaries.

One task, several kinds of evidence

Consider an agent asked to fix a mobile screen. The thread supplies the task and the project supplies the workspace. The agent edits files in the environment’s checkout, runs tests in a server-owned terminal, and may open a simulator or emulator to inspect the result. The user watches the device from a desktop or phone, then asks the agent to adjust the implementation. When the change is ready, the thread’s branch becomes a pull request that other people can review. A server-side watcher can continue checking that pull request even when no client window is open.

This is not a collection of unrelated integrations. It is one chain in which each surface produces a different kind of evidence. The conversation records intent and decisions. The terminal shows commands and outcomes. A device shows behavior in a running app. Git records the changed files and branch. A pull request makes the change available for review. Settlement connects the final state of that delivery process back to the thread.

flowchart LR T["Thread and project"] --> A["Agent turn"] A --> X["Server-owned terminal or device"] X --> B["Worktree, branch, and diff"] B --> P["Pull request"] P --> R["Review and checks"] R --> S["Server watch and settlement"] S --> C["Web, desktop, and mobile views"] C --> T

The environment is the connective tissue. A client can render a terminal or device stream, but the PTY, simulator, emulator, helper process, and project files remain on the environment host or on a configured device host reached through it. A pull request action uses the hosting credentials available to the server that performs the operation. The client supplies intent and displays results; it does not become the place where those results are generated.

Terminals and devices extend the same boundary

A terminal is a tempting place to forget the architecture because its text looks like a local command line. In T3 Code, the environment server owns the PTY, session lifetime, and retained output. Every client attaches through the environment connection, which allows a user to reconnect to a running session or view it from more than one surface. The client can choose how to draw and interact with the terminal, but those presentation choices do not move the shell or change its contract.

Retained output illustrates why server ownership matters. The server keeps bounded terminal history, while a client may display less of it. Incremental persistence lets new chunks be appended without copying the entire scrollback on every callback. When a user reconnects, the environment can restore the retained tail rather than asking the mobile or browser client to remember a session it did not create.