Open History to see the last commit
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. Servers that need
20a manual update are not included. Use the notice or **Settings → Connections**
21for those.
22
23The confirmation counts the running threads that the restarts will interrupt,
24and how many can resume afterwards. See **Continue threads after restarts**
25below.
26
27## Before you update
28
29Server updates restart the connection and can interrupt active agents and
30terminal commands. Saved threads, settings, and project files remain.
31
32**Settings → General → Continue threads after restarts** is on by default.
33It resumes supported active threads after an update, crash, or machine
34restart. Changes are saved to connected environments that support this setting;
35update older servers first. If a supported environment was offline or has a
36different value, use **Apply to all** in Settings after it connects.
37T3 Code must start again on that machine;
38the setting does not enable automatic startup. Terminal commands may still be
39interrupted, and threads without saved provider resume state need a new message.
40A thread is not resumed while it waits for your approval, answer, or secret, or
41while it is archived, snoozed, or settled. After three automatic resumes in a row,
42the thread waits for your next message.
43
44Updates from the previous orchestration system preserve conversation transcripts but cannot carry
45every kind of runtime history forward. Read [Threads from older T3 Code versions](./thread-migration.md)
46before continuing an important older thread.
47
48## When versions don't match
49
50A client and server must speak the same orchestration protocol. If they do not, the connection is
51refused rather than running half-upgraded:
52
53- An app newer than the server is blocked before connecting, with a notice telling you to update
54 T3 Code on the machine named in the notice.
55- A server newer than your app refuses the connection with an update message.
56
57Update the side the notice names, then reconnect.
58
59## Update a connected server
60
61The offered action depends on how the server runs:
62
63| Action | What to do |
64| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
65| **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. |
66| **Update the desktop app** | Update the desktop app on the machine running the server, then reopen it if needed. |
67| **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. |
68| **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. |
69
70On the host, run:
71
72```sh
73t3 update <client-version>
74```
75
76Replace `<client-version>` with the version shown in the notice. The command
77asks before restarting the background service; if you decline, run
78`t3 service restart` when you are ready. For a server you started by hand,
79stop it and start it again afterwards with your usual options such as `--host`
80or `--tailscale-serve`.
81
82If you run the server with `npx` rather than an installed `t3`, there is
83nothing to update on the host: stop the server and relaunch it as
84`npx t3@<client-version>` with the same subcommand and options.
85
86## If an update fails
87
88Keep the client open until it reconnects or reports a failure. A failed service
89update can roll back to the previous version. If the update still fails:
90
911. Retry the offered action once.
922. Check that you updated the server's machine, not only the device you are using.
933. For a command-line server, stop it and relaunch the exact version shown in the notice.
94
95## Update providers
96
97**Settings → Providers** shows provider updates for the selected environment.
98**Update all** updates every outdated provider on every connected environment
99at once. Hover it to see which providers it will update. Providers that only
100offer a manual update command are not included.
101
102## Mobile updates
103
104To update an environment from your phone, open **Settings → Environments** and
105select it. **Check for updates** finds the latest release on that environment's
106current release channel. Keep the app open while the environment updates and
107reconnects. Hosts that cannot update remotely show instructions for updating on
108the machine instead.
109
110The same page lets you refresh provider status and update supported providers.
111These controls require a connected environment and permission to operate it.
112Provider update checks and restart continuation preferences are in
113**Settings → Maintenance**. If provider update checks are disabled, enable them
114there before refreshing to find newer versions.
115
116Install App Store or Google Play releases as usual. The mobile app can also
117download updates in the background and apply them when you next leave the app.
118It saves drafts and queued messages before restarting. If you keep the app open
119for a long time, it may ask to install immediately; choosing **Later** leaves the
120update queued for the next suitable moment.