1# Updating T3 Code
2
3The app you use and the server running your agents can be on different machines.
4When a server is behind your web or desktop app, an update notice appears in the
5conversation and **Settings → Connections**. Update the machine named in that
6notice.
7
8## Update everything at once
9
10The update button at the bottom of the sidebar updates every connected machine
11in one step. It updates outdated providers, then servers that are behind, then
12the desktop app you are using, which restarts last. Servers move to the
13version your desktop app is installing, or to your web app's version. A
14background service stays on its current release channel. A remote desktop app
15installs the latest release from its own channel. Hover the button to see what
16it will update.
17
18Server updates appear only after that version is published to npm. Remote
19desktop apps do not wait for npm. The confirmation lists each machine it skips
20and why, such as a machine that is offline or needs a manual update. Use the
21notice or **Settings → Connections** for those.
22
23If a desktop app restarts on its old version, T3 Code tells you the update did
24not apply. It does not install that version again on its own, even when another
25device asks. Use the update button on that machine to retry.
26
27The confirmation counts the running threads that the restarts will interrupt,
28and how many can resume afterwards. See **Continue threads after restarts**
29below.
30
31## Before you update
32
33Server updates restart the connection and can interrupt active agents and
34terminal commands. Saved threads, settings, and project files remain.
35
36**Settings → General → Continue threads after restarts** is on by default.
37It resumes supported active threads after an update, crash, or machine
38restart. Changes are saved to connected environments that support this setting;
39update older servers first. If a supported environment was offline or has a
40different value, use **Apply to all** in Settings after it connects.
41T3 Code must start again on that machine;
42the setting does not enable automatic startup. Terminal commands may still be
43interrupted, and threads without saved provider resume state need a new message.
44A thread that finished its turn to wait on a monitor, subagent, or background task
45is woken and told that this work stopped. A background shell, such as a dev server,
46does not wake it; the thread learns about it with your next message.
47A thread is not resumed while it waits for your approval, answer, or secret, or
48while it is archived, snoozed, or settled. After three automatic resumes in a row,
49the thread waits for your next message.
50
51Updates from the previous orchestration system preserve conversation transcripts but cannot carry
52every kind of runtime history forward. Read [Threads from older T3 Code versions](./thread-migration.md)
53before continuing an important older thread.
54
55## When versions don't match
56
57A client and server must speak the same orchestration protocol. If they do not, the connection is
58refused rather than running half-upgraded:
59
60- An app newer than the server is blocked before connecting, with a notice telling you to update
61 T3 Code on the machine named in the notice.
62- A server newer than your app refuses the connection with an update message.
63
64Update the side the notice names, then reconnect.
65
66## Update a connected server
67
68The offered action depends on how the server runs:
69
70| Action | What to do |
71| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
72| **Update server** | Keep the client open while it installs and reconnects. Supported background services update remotely. For a desktop-hosted server, this also closes and relaunches the desktop app on the host. |
73| **Update the desktop app** | Update the desktop app on the machine running the server, then reopen it if needed. |
74| **Copy update command** | Run the command on the named host to update the detected global npm install, then restart the server with your usual options. |
75| **Copy relaunch command** | Stop the command-line server on its host and relaunch with the copied command, keeping your usual subcommand and options. This does not update an installed `t3` command. |
76
77On the host, run:
78
79```sh
80t3 update <client-version>
81```
82
83Replace `<client-version>` with the version shown in the notice. The command
84asks before restarting the background service; if you decline, run
85`t3 service restart` when you are ready. For a server you started by hand,
86stop it and start it again afterwards with your usual options such as `--host`
87or `--tailscale-serve`.
88
89If you run the server with `npx` rather than an installed `t3`, there is
90nothing to update on the host: stop the server and relaunch it as
91`npx t3@<client-version>` with the same subcommand and options.
92
93## If an update fails
94
95Keep the client open until it reconnects or reports a failure. A failed service
96update can roll back to the previous version. If the update still fails:
97
981. Retry the offered action once.
992. Check that you updated the server's machine, not only the device you are using.
1003. For a command-line server, stop it and relaunch the exact version shown in the notice.
101
102Only one server can use a T3 home directory at a time. If startup reports that
103another server owns it, stop that server before retrying, or use a separate home
104directory and pair with the running server.
105
106## Update providers
107
108**Settings → Providers** shows provider updates for the selected environment.
109**Update all** updates every outdated provider on every connected environment
110at once. Hover it to see which providers it will update. Providers that only
111offer a manual update command are not included.
112
113## Mobile updates
114
115To update an environment from your phone, open **Settings → Environments** and
116select it. **Check for updates** finds the latest release on that environment's
117current release channel. Keep the app open while the environment updates and
118reconnects. Hosts that cannot update remotely show instructions for updating on
119the machine instead.
120
121The same page lets you refresh provider status and update supported providers.
122These controls require a connected environment and permission to operate it.
123Provider update checks and restart continuation preferences are in
124**Settings → Maintenance**. If provider update checks are disabled, enable them
125there before refreshing to find newer versions. The same setting controls whether
126T3 Code downloads model catalog updates, so with it off new models may not appear
127until you enable it and refresh provider status.
128
129Install App Store or Google Play releases as usual. The mobile app can also
130download updates in the background and apply them when you next leave the app.
131It saves drafts and queued messages before restarting. If you keep the app open
132for a long time, it may ask to install immediately; choosing **Later** leaves the
133update queued for the next suitable moment.