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