Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

providers-opencode.md

75 lines3.5 KB

1# OpenCode
2​
3Install and authenticate OpenCode on the machine running your environment, then
4enable it in **Settings > Providers**. See [provider setup](./install.md#providers).
5T3 Code requires OpenCode 1.14.19 or newer, including when you connect an existing
6OpenCode server.
7​
8## OpenCode 2
9​
10T3 Code supports OpenCode 2.0.18 and newer. It detects the version on its own, so
11the same provider settings work for OpenCode 1.x and 2.x. OpenCode 1.x shows
12**Limited support** in its provider settings.
13​
14OpenCode 2 is a separate package, `@opencode/cli`. To move from 1.x, install it
15yourself, for example `npm install -g @opencode/cli`. Then refresh provider status.
16T3 Code's update button updates whichever package you have installed. It never
17switches a 1.x install to 2.x.
18​
19OpenCode 2 converts the shared OpenCode database to its own format the first time it
20runs. Don't run OpenCode 1.x and 2.x side by side on the same machine. Threads you
21started on 1.x continue on 2.x.
22​
23Plan mode uses OpenCode's `plan` agent.
24​
25## Compaction
26​
27OpenCode compacts long conversations itself, and T3 Code has no setting for it. On
28OpenCode 2, change it under `compaction` in an OpenCode configuration file, such as
29`opencode.json`: `auto` turns
30automatic compaction on or off, `buffer` sets the token headroom, and `keep.tokens`
31sets how much recent context stays. OpenCode 1.x configures compaction differently.
32Send `/compact` to compact a thread yourself.
33​
34## Local or external server
35​
36Leave **Server URL** empty to let T3 Code start OpenCode locally. A password in
37provider settings applies to both that server and T3 Code's connection. With no
38password setting, the local server uses `OPENCODE_SERVER_PASSWORD` from its
39environment.
40​
41To use an existing OpenCode server, set **Server URL** and its password in provider
42settings. T3 Code uses only that configured password for an external server; it
43does not forward a local `OPENCODE_SERVER_PASSWORD`. If connection or version checks
44fail, check the URL, credentials, and OpenCode version, then refresh provider status.
45​
46After a lost connection, send another prompt to reconnect to the same OpenCode
47session.
48​
49## Approvals
50​
51OpenCode follows the shared [permission modes](./permission-modes.md). **Auto** has
52the same rules as **Supervised** because OpenCode has no AI approval reviewer.
53Environment files such as `.env` and `.env.local` need approval in restricted
54modes even though normal file reads do not; `.env.example` is allowed.
55​
56**Allow for workspace** applies to matching requests in other OpenCode sessions
57using the same workspace. It is broader than the current thread, especially on a
58shared external server. Use **Allow once** for a single request. Denying an action
59does not stop the whole turn.
60​
61## Refresh models, commands, and skills
62​
63After changing an OpenCode login or configuration, use **Refresh provider status**
64in **Settings > Providers** for that environment. On mobile, use **Refresh models**
65in the thread settings. Reconnecting also refreshes the catalog; periodic provider
66health checks do not.
67​
68Credential changes are read on refresh. Native OpenCode configuration can remain
69cached while the local helper is running. Let it sit for 30 seconds without model
70refreshes or text-generation work, then refresh again to reload the files. Repeated
71refreshes keep the helper alive. An external server may need its own reload or
72restart before T3 Code can see configuration changes.
73​
74Existing threads keep their selected model and options even when it disappears
75from the catalog. If OpenCode rejects that model, select an available one and retry.