@markusylisiurunen/tau 0.3.98 → 0.3.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/code_mode/agents.js +2 -0
- package/dist/core/code_mode/agents.js.map +1 -1
- package/dist/core/code_mode/history.js +7 -0
- package/dist/core/code_mode/history.js.map +1 -1
- package/dist/core/code_mode/models.js.map +1 -1
- package/dist/core/code_mode/web.js.map +1 -1
- package/dist/core/config/content_loader.js.map +1 -1
- package/dist/core/config/index.js +2 -1
- package/dist/core/config/index.js.map +1 -1
- package/dist/core/config/ownership.js +71 -0
- package/dist/core/config/ownership.js.map +1 -0
- package/dist/core/config/runtime.js +22 -10
- package/dist/core/config/runtime.js.map +1 -1
- package/dist/core/config/runtime_config_snapshot.js +2 -2
- package/dist/core/config/runtime_config_snapshot.js.map +1 -1
- package/dist/core/config/schema.js +3 -2
- package/dist/core/config/schema.js.map +1 -1
- package/dist/core/history/agent_history_recorder.js +64 -0
- package/dist/core/history/agent_history_recorder.js.map +1 -0
- package/dist/core/history/cli.js +2 -2
- package/dist/core/history/cli.js.map +1 -1
- package/dist/core/history/config.js.map +1 -1
- package/dist/core/history/history_manager.js +14 -29
- package/dist/core/history/history_manager.js.map +1 -1
- package/dist/core/history/local_history_store.js +43 -10
- package/dist/core/history/local_history_store.js.map +1 -1
- package/dist/core/history/migrations.js +1 -1
- package/dist/core/history/migrations.js.map +1 -1
- package/dist/core/history/remote_history_client.js +2 -0
- package/dist/core/history/remote_history_client.js.map +1 -1
- package/dist/core/history/setup.js +10 -8
- package/dist/core/history/setup.js.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/persona_selection.js +38 -0
- package/dist/core/persona_selection.js.map +1 -0
- package/dist/core/runtime/agent_model.js.map +1 -1
- package/dist/core/runtime/chat_runtime.js +1 -5
- package/dist/core/runtime/chat_runtime.js.map +1 -1
- package/dist/core/session/auto_compaction_threshold.js.map +1 -1
- package/dist/core/static/code_mode/history/documentation.md +22 -4
- package/dist/core/static/tau_docs/code-mode.md +1 -1
- package/dist/core/static/tau_docs/config-reference.md +22 -8
- package/dist/core/static/tau_docs/configuration.md +13 -2
- package/dist/core/static/tau_docs/credentials.md +1 -1
- package/dist/core/static/tau_docs/history.md +48 -5
- package/dist/core/static/tau_docs/models.md +1 -1
- package/dist/core/static/tau_docs/node-sdk.md +9 -9
- package/dist/core/static/tau_docs/ownership-and-scope.md +7 -5
- package/dist/core/static/tau_docs/personas.md +5 -5
- package/dist/core/static/tau_docs/remote-sessions.md +3 -2
- package/dist/core/static/tau_docs/security.md +11 -3
- package/dist/core/static/tau_docs/session-protocol-methods.md +15 -6
- package/dist/core/static/tau_docs/session-protocol.md +21 -11
- package/dist/core/static/tau_docs/sessions.md +9 -5
- package/dist/core/static/tau_docs/subagents.md +13 -13
- package/dist/core/static/tau_docs/telegram-projects.md +65 -10
- package/dist/core/static/tau_docs/telegram.md +60 -41
- package/dist/core/static/tau_docs/troubleshooting.md +7 -3
- package/dist/core/static/tau_docs/tui.md +24 -5
- package/dist/core/subagents/agent_supervisor.js +5 -1
- package/dist/core/subagents/agent_supervisor.js.map +1 -1
- package/dist/core/subagents/claude_code_runner.mjs +49 -49
- package/dist/core/subagents/native_subagent_runtime.js +6 -1
- package/dist/core/subagents/native_subagent_runtime.js.map +1 -1
- package/dist/core/subagents/runtime.js.map +1 -1
- package/dist/core/telegram/adapter.js +41 -59
- package/dist/core/telegram/adapter.js.map +1 -1
- package/dist/core/telegram/cli.js +24 -12
- package/dist/core/telegram/cli.js.map +1 -1
- package/dist/core/telegram/config.js +43 -58
- package/dist/core/telegram/config.js.map +1 -1
- package/dist/core/telegram/local_session_client.js +3 -3
- package/dist/core/telegram/local_session_client.js.map +1 -1
- package/dist/core/telegram/runtime.js +19 -5
- package/dist/core/telegram/runtime.js.map +1 -1
- package/dist/core/telegram/session_manager.js +18 -7
- package/dist/core/telegram/session_manager.js.map +1 -1
- package/dist/core/telegram/workspace.js +21 -0
- package/dist/core/telegram/workspace.js.map +1 -1
- package/dist/core/tools/catalog.js.map +1 -1
- package/dist/core/utils/model_notices.js.map +1 -1
- package/dist/core/utils/speech_to_text_keywords.js +10 -4
- package/dist/core/utils/speech_to_text_keywords.js.map +1 -1
- package/dist/core/version.js +2 -2
- package/dist/core/version.js.map +1 -1
- package/dist/diff_tool/app/dist/assets/{core-D8lOlLN2.js → core-3PFMkRLP.js} +1 -1
- package/dist/diff_tool/app/dist/assets/engine-oniguruma-C5P09Ghe.js +1 -0
- package/dist/diff_tool/app/dist/assets/{highlights-B80gocb2.js → highlights-Bi-VwGCO.js} +2 -2
- package/dist/diff_tool/app/dist/assets/index-DhaXI7F3.js +221 -0
- package/dist/diff_tool/app/dist/assets/langs-CDbZNx2R.js +1 -0
- package/dist/diff_tool/app/dist/assets/lib-BKZ5ZaMU.js +1 -0
- package/dist/diff_tool/app/dist/assets/shiki-BArE1NVK.js +2 -0
- package/dist/diff_tool/app/dist/assets/{stream-tokenizer-BkuDYA48.js → stream-tokenizer-DFTZfQ1S.js} +4 -4
- package/dist/diff_tool/app/dist/assets/{themes-BaMgiyFz.js → themes-Dzo-2cM5.js} +2 -2
- package/dist/diff_tool/app/dist/assets/wasm-4KdTHw0F.js +1 -0
- package/dist/diff_tool/app/dist/index.html +2 -2
- package/dist/history/worker/index.js +140 -15
- package/dist/history/worker/index.js.map +1 -1
- package/dist/history/worker/migrations/0002_parent_session.sql +3 -0
- package/dist/history/worker/viewer.css +10 -1
- package/dist/host/local_session_host.js +134 -75
- package/dist/host/local_session_host.js.map +1 -1
- package/dist/host/session_bootstrap.js +53 -0
- package/dist/host/session_bootstrap.js.map +1 -0
- package/dist/host/session_host.js.map +1 -1
- package/dist/host/session_protocol_handler.js +9 -1
- package/dist/host/session_protocol_handler.js.map +1 -1
- package/dist/main.js +48 -95
- package/dist/main.js.map +1 -1
- package/dist/protocol/environment_variables.d.ts +2 -0
- package/dist/protocol/environment_variables.js +7 -0
- package/dist/protocol/environment_variables.js.map +1 -0
- package/dist/protocol/session_protocol.d.ts +16 -4
- package/dist/protocol/session_protocol.js +35 -15
- package/dist/protocol/session_protocol.js.map +1 -1
- package/dist/sdk/client.js +2 -2
- package/dist/sdk/client.js.map +1 -1
- package/dist/sdk/local_client.d.ts +6 -2
- package/dist/sdk/local_client.js +11 -59
- package/dist/sdk/local_client.js.map +1 -1
- package/dist/sdk/session.js +4 -3
- package/dist/sdk/session.js.map +1 -1
- package/dist/sdk/types.d.ts +6 -2
- package/dist/store/session_snapshot_migrations.js +19 -1
- package/dist/store/session_snapshot_migrations.js.map +1 -1
- package/dist/tui/chat_view.js +5 -0
- package/dist/tui/chat_view.js.map +1 -1
- package/dist/tui/host_diagnostic_relay.js +44 -0
- package/dist/tui/host_diagnostic_relay.js.map +1 -0
- package/dist/tui/index.js +1 -0
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/listen_capture.js +7 -9
- package/dist/tui/listen_capture.js.map +1 -1
- package/dist/tui/session_chat_app.js +2 -2
- package/dist/tui/session_chat_app.js.map +1 -1
- package/dist/tui/session_chat_controller.js +89 -13
- package/dist/tui/session_chat_controller.js.map +1 -1
- package/dist/tui/terminal.js +13 -2
- package/dist/tui/terminal.js.map +1 -1
- package/package.json +9 -9
- package/dist/diff_tool/app/dist/assets/index-DSKn9aHV.js +0 -205
- package/dist/diff_tool/app/dist/assets/langs-Cb6u03GG.js +0 -1
- package/dist/diff_tool/app/dist/assets/lib-BFrBoEqQ.js +0 -9
- package/dist/diff_tool/app/dist/assets/shiki-DaptjTao.js +0 -2
- package/dist/diff_tool/app/dist/assets/wasm-BnjxR4X6.js +0 -1
|
@@ -35,7 +35,7 @@ Hosts emit `history_recording` diagnostics with a `delayed`, `dropped`, or `reco
|
|
|
35
35
|
|
|
36
36
|
History follows the transcript, not the model's current context.
|
|
37
37
|
|
|
38
|
-
**Rewind removes later entries.** When a session rewinds to a message, Tau deletes history from that message onward. The same deletion is queued for a configured remote collection.
|
|
38
|
+
**Rewind removes later entries.** When a session rewinds to a message, Tau deletes history from that message onward. The same deletion is queued for a configured remote collection. [Subagent sessions](#native-subagent-sessions) stay.
|
|
39
39
|
|
|
40
40
|
**Compaction keeps entries.** Compaction replaces the session's model context with a summary, but the original entries stay in history. Work from before a compaction can still be found, even though the session no longer contains it word for word.
|
|
41
41
|
|
|
@@ -43,20 +43,47 @@ History follows the transcript, not the model's current context.
|
|
|
43
43
|
|
|
44
44
|
These rules differ from how the session itself behaves. Use [sessions](sessions.md) to understand what a recovered session shows or sends to the model.
|
|
45
45
|
|
|
46
|
+
## Native subagent sessions
|
|
47
|
+
|
|
48
|
+
Each native Tau [subagent](subagents.md) has its own history session for its whole lifetime, including its assignment, later input, and all its work. The session ID is the subagent's ID from `tau.agents`. Recording happens even when no agent has the `history` tool. Claude Code subagents are not recorded.
|
|
49
|
+
|
|
50
|
+
A subagent's session is a child of the session that started it:
|
|
51
|
+
|
|
52
|
+
- `parentSessionId` names the parent. Tau sets it when it creates the child, and it never changes. Sessions without a parent do not have this field.
|
|
53
|
+
- `childCount` is the number of direct children, and every session has it.
|
|
54
|
+
- Attributes are copied from the parent, except `cwd`, which is the subagent's working directory.
|
|
55
|
+
|
|
56
|
+
Search leaves out child sessions by default, so it finds main sessions only. The `parent` option of `tau.history.search` changes this:
|
|
57
|
+
|
|
58
|
+
| `parent` | Sessions searched |
|
|
59
|
+
| ------------------- | -------------------------------- |
|
|
60
|
+
| omitted or `"none"` | Only sessions without a parent |
|
|
61
|
+
| `"any"` | All sessions, including children |
|
|
62
|
+
| `{ sessionId }` | Direct children of that session |
|
|
63
|
+
|
|
64
|
+
`tau.history.read` accepts any session ID, including a child's.
|
|
65
|
+
|
|
66
|
+
A child session stays in history after its subagent ends, even when the parent rewinds past the message that started the subagent. History cannot restore the subagent.
|
|
67
|
+
|
|
68
|
+
Child sessions replicate independently of their parents, so a shared collection can hold a child before its parent, and `childCount` can lag behind the subagents started.
|
|
69
|
+
|
|
46
70
|
## Filter by attributes
|
|
47
71
|
|
|
48
|
-
Session creation attributes are string pairs
|
|
72
|
+
Session creation attributes are string pairs recorded when a session is created, and they never change. Tau sets `machine` and `cwd`, and the client that created the session sets the others. History stores them and can filter on exact values or on case-sensitive substrings. They describe where a session came from; they are not instructions.
|
|
49
73
|
|
|
50
|
-
|
|
74
|
+
Common attributes are:
|
|
51
75
|
|
|
52
76
|
| Attribute | Meaning |
|
|
53
77
|
| --- | --- |
|
|
54
78
|
| `source` | The creating client, usually `tui`, `telegram`, or a value an SDK caller chose |
|
|
55
79
|
| `repository` | Normalized `host/owner/repository`; composite workspaces join repositories with commas |
|
|
80
|
+
| `machine` | Hostname of the execution environment |
|
|
81
|
+
| `cwd` | The session's working directory in the execution environment |
|
|
82
|
+
| `telegram_bot` | ID of the Telegram bot that owns the session, as configured under `bots` |
|
|
56
83
|
|
|
57
84
|
A local TUI usually fills in `repository` from the current Git repository or repositories directly below it. Telegram fills it in for repository projects and leaves it out for persistent-directory projects. Sessions created with `tau attach` may not have it, and SDK or protocol clients set only the attributes they choose.
|
|
58
85
|
|
|
59
|
-
Because composite values are comma-separated, a substring filter on `repository` finds both single-repository and composite sessions. Attributes may be missing, out of date, or set deliberately by a client, so confirm important facts from the transcript or the current workspace.
|
|
86
|
+
Because composite values are comma-separated, a substring filter on `repository` finds both single-repository and composite sessions. Attributes may be missing, out of date, or set deliberately by a client, so confirm important facts from the transcript or the current workspace. For example, older saved sessions may lack `machine` and `cwd`, because recovery never changes attributes.
|
|
60
87
|
|
|
61
88
|
## Agent access is explicit and read-only
|
|
62
89
|
|
|
@@ -106,7 +133,7 @@ Open the service's address, for example `https://history.example.net/`, to brows
|
|
|
106
133
|
- The password never appears in a URL, and pages are not cached by the browser.
|
|
107
134
|
- The password gives read access to transcripts, attributes, tool arguments, and tool results from every host that uses the service. Keep it private.
|
|
108
135
|
|
|
109
|
-
The index lists recently updated sessions with titles, summaries, times, and attributes, plus a search form.
|
|
136
|
+
The index lists recently updated sessions without a parent, with titles, summaries, times, and attributes, plus a search form. Its search also covers only those sessions, so open a [subagent's session](#native-subagent-sessions) through the links on its parent's page or through its `webUrl`.
|
|
110
137
|
|
|
111
138
|
- Repository and source filters match case-sensitive substrings. They combine with text search and stay active across pages.
|
|
112
139
|
- **Older sessions** loads the next page; pages never load by themselves.
|
|
@@ -114,6 +141,8 @@ The index lists recently updated sessions with titles, summaries, times, and att
|
|
|
114
141
|
|
|
115
142
|
A session page starts empty, then loads the transcript in batches and adds them in order, with no scrolling or page controls. Tool entries start collapsed. Text and metadata are shown as plain text, never as HTML or Markdown. Valid PNG, JPEG, GIF, and WebP blocks are shown as images, and other structured content as plain text.
|
|
116
143
|
|
|
144
|
+
Above the transcript, a session page links to related sessions when it has any. **Parent session** links to the parent, or shows its ID marked as not available when the service does not have that session. **Child sessions** is a nested list of the sessions below this one. It shows up to 200 sessions and 8 levels, and a note appears when the list is incomplete. When the tree is incomplete, the note links to a paginated list of all direct children. Open a child session to explore its descendants. Each link opens that session's normal page, and transcripts are never combined.
|
|
145
|
+
|
|
117
146
|
**Copy conversation** at the top works once the whole transcript has loaded. If loading fails, a retry button appears and copying stays off. The selector next to it chooses what to copy:
|
|
118
147
|
|
|
119
148
|
- **Messages only** (the default) leaves out tool entries.
|
|
@@ -147,6 +176,18 @@ If `history` is set but no key is found, the host fails to start, instead of qui
|
|
|
147
176
|
|
|
148
177
|
Restart the host after changing this block or its environment variables. `/reload` does not reload it.
|
|
149
178
|
|
|
179
|
+
## Keep the service and hosts on one version
|
|
180
|
+
|
|
181
|
+
The service and every host that uses it must run the same Tau release, because they do not negotiate versions. A mismatch has these effects:
|
|
182
|
+
|
|
183
|
+
- A service older than the host ignores fields it does not know, including parent links. It stores those child sessions without a parent, so they appear as ordinary sessions, and upgrading the service later does not restore the links. The host also rejects the older service's search and read responses.
|
|
184
|
+
- A host older than the service rejects the service's search and read responses, so its remote searches and reads fail. Replication and local recording keep working.
|
|
185
|
+
|
|
186
|
+
To upgrade without losing parent links:
|
|
187
|
+
|
|
188
|
+
1. Upgrade Tau on the machine you use for setup, then run `tau history setup` with the existing API key and viewer password. Setup deploys the Worker from the installed Tau release and applies new D1 migrations.
|
|
189
|
+
2. Upgrade and restart each host. Until a host restarts on the new release, its remote searches and reads fail.
|
|
190
|
+
|
|
150
191
|
## Replication and outages
|
|
151
192
|
|
|
152
193
|
Replication starts locally:
|
|
@@ -216,6 +257,8 @@ Cloudflare problems show up in the normal Worker logs, Cron Events, and D1 diagn
|
|
|
216
257
|
|
|
217
258
|
**A session does not appear in remote search.** Confirm the host was restarted with the remote config, the session was used while the config was active, and enough history activity has happened to send the outbox. Check host logs for `history_replication_failed`. A permanent rejection affects only the named session, while other failures are retried. Summaries are not immediate.
|
|
218
259
|
|
|
260
|
+
**Remote search or read fails with an invalid response after an upgrade.** The host and the service are on different Tau releases. [Put them on the same release](#keep-the-service-and-hosts-on-one-version).
|
|
261
|
+
|
|
219
262
|
**Local history is delayed or dropping changes.** Brief SQLite contention is retried automatically. For sustained failures, check the host's `history_recording` diagnostics, file access, free space, ownership of `~/.config/tau`, and whether another process holds a long database transaction. Fixing the underlying problem lets later writes proceed without restarting the host; dropped changes remain gaps. `tau history status` reports remote replication quarantines, not the live recording buffer. Do not edit, replace, or delete the SQLite files as a first repair, and do not inspect outbox rows or keys.
|
|
220
263
|
|
|
221
264
|
**Search finds material removed from the model's context.** This is expected after compaction. After a rewind, the removed entries should disappear; if the remote copy still has them, wait for the deletion to replicate.
|
|
@@ -12,7 +12,7 @@ The bundled catalog comes from Tau's model library, `pi-ai`. It lists known prov
|
|
|
12
12
|
|
|
13
13
|
## Remote catalog
|
|
14
14
|
|
|
15
|
-
A Tau host that runs models loads cached catalogs from `~/.config/tau/models-store.json` at startup. If the cache is older than four hours, it checks `pi.dev` in the background. This check happens only at startup; there is no recurring refresh. Set `TAU_OFFLINE` to skip it.
|
|
15
|
+
A Tau host that runs models loads cached catalogs from `~/.config/tau/models-store.json` at startup. If the cache is older than four hours, it checks `pi.dev` in the background. This check happens only at startup; there is no recurring refresh. Set `TAU_OFFLINE` to skip it, or `refreshModelCatalog: false` to skip it for one [Node SDK](node-sdk.md) client. Skipping the check does not remove an existing cache or block an explicit `tau models refresh`.
|
|
16
16
|
|
|
17
17
|
Tau requests the catalog separately for each provider that its `pi-ai` version supports. Each request has a 15-second timeout. A successful provider is cached even when another fails. A failed provider keeps its previous cached data, or the bundled data if there is none. Run `tau models refresh` on the host to refresh immediately, regardless of cache age. It keeps every successful update and exits nonzero if any provider failed.
|
|
18
18
|
|
|
@@ -50,13 +50,13 @@ type TauSdkClientOptions = {
|
|
|
50
50
|
};
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
`persona`, `reasoning`, and `noAgentContextFiles` apply to sessions created by this host. `connectTimeoutMs` defaults to 5,000 ms. Default initialization metadata is `{ client: { name: "tau-sdk", version: "1" } }`.
|
|
53
|
+
`persona`, `reasoning`, and `noAgentContextFiles` apply to sessions created by this host. `persona` (an ID, optionally with `:<reasoning>`) must exist in the new session's directory, or creation fails. Recovered sessions keep their saved settings. `connectTimeoutMs` defaults to 5,000 ms. Default initialization metadata is `{ client: { name: "tau-sdk", version: "1" } }`.
|
|
54
54
|
|
|
55
|
-
The in-process host never writes background diagnostics to stdout or stderr.
|
|
55
|
+
The in-process host never writes background diagnostics to stdout or stderr. `onDiagnostic` receives them as structured objects. `history_recording` reports delayed, dropped, or recovered local recording, with a session ID and pending operation and byte counts. `history_replication_failed` reports remote delivery failures. Neither stops agent work; see [history](history.md) for retries and durability limits. `session_config_warnings` reports `cwd` and `warnings` when the host loads a session with invalid configuration or content. The session still starts, and an error thrown by `onDiagnostic` does not block it.
|
|
56
56
|
|
|
57
|
-
By default,
|
|
57
|
+
By default, an in-process client starts one background model catalog check against `pi.dev`. Each session keeps the catalog it started with until `session.reload()`. Set `refreshModelCatalog: false` to skip this client's check, or `TAU_OFFLINE` to skip automatic checks for the whole process. See [models](models.md) and [security](security.md).
|
|
58
58
|
|
|
59
|
-
Closing this client saves live sessions
|
|
59
|
+
Closing this client saves live sessions, shuts down its host, and cancels and waits for its catalog refresh. A refresh shared with another in-process client continues until the last of them closes.
|
|
60
60
|
|
|
61
61
|
### Connect to `tau serve`
|
|
62
62
|
|
|
@@ -147,11 +147,11 @@ try {
|
|
|
147
147
|
}
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
`client.sessions.create(input)` sends `session.create
|
|
150
|
+
`client.sessions.create(input)` sends `session.create`. `client.sessions.list()` returns `{ sessionId, lifecycle }` for each session.
|
|
151
151
|
|
|
152
|
-
Creating a session requires the full execution environment and the creation attributes, which never change afterward. The `cwd` must be absolute and is a path in the chosen environment, which may not be where the SDK runs. A Fly Sprite session refers to an existing Sprite that the host is configured to reach. See [sessions](sessions.md) for creation attributes and [ownership and scope](ownership-and-scope.md) for which machine owns which paths.
|
|
152
|
+
Creating a session requires the full execution environment and the creation attributes, which never change afterward. Tau sets the `machine` and `cwd` attributes itself and replaces any values you send for them. The `cwd` of the execution environment must be absolute and is a path in the chosen environment, which may not be where the SDK runs. A Fly Sprite session refers to an existing Sprite that the host is configured to reach. See [sessions](sessions.md) for creation attributes and [ownership and scope](ownership-and-scope.md) for which machine owns which paths.
|
|
153
153
|
|
|
154
|
-
To set the main conversation's automatic-compaction threshold at creation, pass `autoCompactThresholdTokens` as a safe integer of at least 50,000. Omit it or pass `null` to use the persona default, falling back to the model's context window minus 16,384 tokens.
|
|
154
|
+
To set the main conversation's automatic-compaction threshold at creation, pass `autoCompactThresholdTokens` as a safe integer of at least 50,000. Omit it or pass `null` to use the persona default, falling back to the model's context window minus 16,384 tokens. Applying a persona resets the threshold to `null`, even when reapplying the same persona, unless the call supplies a new threshold. The effective threshold cannot exceed this model-based limit.
|
|
155
155
|
|
|
156
156
|
Use `session.setAutoCompactThreshold(50000)` to change the threshold from the next logical turn, or `session.setAutoCompactThreshold(null)` to restore the default. Snapshot `settings` contain both `autoCompactThresholdTokens` (the configured value) and `effectiveAutoCompactThresholdTokens` (the trigger for the selected model). See [automatic compaction](sessions.md#automatic-compaction) for timing, limits, and costs.
|
|
157
157
|
|
|
@@ -191,7 +191,7 @@ Each subscription returns an unsubscribe function.
|
|
|
191
191
|
| `snapshot()` | Read the complete current snapshot. |
|
|
192
192
|
| `setAutoCompactThreshold(thresholdTokens)` | Set or reset automatic compaction, starting with the next logical turn. |
|
|
193
193
|
| `setReasoning(reasoning)` | Set reasoning, starting with the next turn. |
|
|
194
|
-
| `setPersona(personaId)` |
|
|
194
|
+
| `setPersona(personaId, overrides?)` | Atomically apply a persona, with optional `{ reasoning, autoCompactThresholdTokens }` overrides, and return the updated snapshot. Pass `null` without overrides to apply the workspace default. |
|
|
195
195
|
| `resolvePrompt(promptId)` | Load a current prompt body from the execution environment. |
|
|
196
196
|
| `autocompletePaths({ query, limit })` | Get a limited list of path suggestions from the execution environment. |
|
|
197
197
|
| `reload()` | Reload the session's configuration and content. |
|
|
@@ -393,7 +393,7 @@ The SDK also exports `executeTauCodeMode` for standalone runs. The separate `@ma
|
|
|
393
393
|
|
|
394
394
|
Most turn and session-changing methods do not accept an `AbortSignal`. Call `session.interrupt()` to stop running work on the host. `session.exec()` is the exception: its optional signal cancels only that command.
|
|
395
395
|
|
|
396
|
-
`
|
|
396
|
+
`client.close()` ends the connection: it rejects open requests, aborts client tool handlers, waits for them to finish, and closes the transport. For the default in-process client, it also saves sessions and shuts down the host. Over WebSocket, the remote host and its sessions keep running.
|
|
397
397
|
|
|
398
398
|
Always close clients in `finally`. Never use a session object after `unobserve()`, or a client after `close()`.
|
|
399
399
|
|
|
@@ -16,7 +16,7 @@ The **host** creates, observes, persists, and recovers sessions. It owns model c
|
|
|
16
16
|
|
|
17
17
|
Session snapshots, authentication storage, usage logs, and the local history database live in the host user's home. Manage them with Tau commands and session operations. Do not edit their files directly.
|
|
18
18
|
|
|
19
|
-
MCP connections belong to the
|
|
19
|
+
MCP connections belong to the hosted session and end when the host unloads it. Stdio servers run on the host, with the host's credentials and access to the host's resources. They do not run in the session's execution environment. A session on a local execution environment reads its server definitions from the global and project configuration of its working directory. A session on a remote execution environment has no MCP servers.
|
|
20
20
|
|
|
21
21
|
The built-in `tau_docs` tool also belongs to the host. It reads the documentation installed with the host's Tau version.
|
|
22
22
|
|
|
@@ -54,6 +54,7 @@ A Fly Sprite puts the execution environment on another machine while the host st
|
|
|
54
54
|
| Agent `cwd`, home, repository, files, and commands | Execution environment | Use target paths in prompts, `session.create`, and agent tool calls. |
|
|
55
55
|
| `.tau/config.json`, personas, prompts, skills, and `AGENTS.md` used by a session | Execution environment | Edit them on the target and relative to the session `cwd`. |
|
|
56
56
|
| Global runtime content for a session | Execution-environment home | `~/.config/tau` is the target user's home when runtime content is collected. |
|
|
57
|
+
| MCP servers | Host, for local sessions | Define them in the session's project or global configuration. They run on the host with host credentials. Sessions on a remote execution environment have none. See [security](security.md#trust-mcp-servers). |
|
|
57
58
|
| Model and host-tool credentials | Host | Set environment secrets where the host process runs. API keys come from the host environment or private global host configuration. |
|
|
58
59
|
| Codex OAuth accounts | Host home | Run `tau auth …` on the host machine. Do not edit auth storage. |
|
|
59
60
|
| Session snapshots | Host home | Local defaults live under the host's Tau config directory. Do not edit session files. |
|
|
@@ -62,17 +63,18 @@ A Fly Sprite puts the execution environment on another machine while the host st
|
|
|
62
63
|
| `/diff` process | TUI client | Tau’s built-in browser tool runs on the client machine. Repository capture still runs through the session execution environment. |
|
|
63
64
|
| Configured command client tools | Owning client | Commands and their environment are on the client. File access they make on behalf of the session goes to the execution environment. |
|
|
64
65
|
| `/listen` and `/speak` capture or playback | TUI client | Required programs, devices, and media credentials belong on the client machine. |
|
|
66
|
+
| Speech vocabulary | Session, plus client global terms | Project terms come from the session's working directory. The transcribing client adds terms from its own global configuration. |
|
|
65
67
|
| Host execution-environment targets | Host startup | Fly Sprite connection settings must be in the host's configuration before it accepts sessions that use them. |
|
|
66
|
-
| Telegram bot token, routing, workspaces, and generated runner state | Telegram runner | Manage these through the Telegram config and runner commands, not project `config.json`. |
|
|
68
|
+
| Telegram bot token, bot environment, routing, workspaces, and generated runner state | Telegram runner | Manage these through the Telegram config and runner commands, not project `config.json`. |
|
|
67
69
|
|
|
68
70
|
## Decide where to edit configuration
|
|
69
71
|
|
|
70
72
|
Start from the behavior that consumes the setting:
|
|
71
73
|
|
|
72
|
-
1. If it changes what the agent sees or can do in the project, edit configuration or content in the execution environment's discovery path.
|
|
73
|
-
2. If it changes the TUI's theme, speech, or command client tools, edit the TUI client's configuration and restart that client.
|
|
74
|
+
1. If it changes what the agent sees or can do in the project, or the project's speech vocabulary, edit configuration or content in the execution environment's discovery path.
|
|
75
|
+
2. If it changes the TUI's theme, voice, recording shortcut, personal speech vocabulary, or command client tools, edit the TUI client's configuration and restart that client.
|
|
74
76
|
3. If it changes credentials, session storage, remote history, or hosted execution environment connections, set it for the host process and restart the host when required.
|
|
75
|
-
4. If it changes Telegram routing or workspace preparation, edit the runner's `--config-file` on the runner machine.
|
|
77
|
+
4. If it changes Telegram routing, bot startup settings, bot environments, presets, or workspace preparation, edit the runner's `--config-file` on the runner machine.
|
|
76
78
|
|
|
77
79
|
For a local `tau` session these locations are often the same home and repository. Following the ownership rule anyway means the configuration still works when the session becomes remote.
|
|
78
80
|
|
|
@@ -105,7 +105,7 @@ subagentAutoCompactThresholdTokens:
|
|
|
105
105
|
|
|
106
106
|
In `subagentAutoCompactThresholdTokens` keys, the provider is lowercased and the model ID is kept exactly as written, so `OpenAI/gpt-6.1-sol` and `openai/gpt-6.1-sol` name the same model. The provider must be known. A model ID missing from the catalog is allowed, as for `model`. Claude Code models are not allowed because Claude Code manages its own compaction.
|
|
107
107
|
|
|
108
|
-
Thresholds are capped at the selected model's context window minus 16,384 tokens. A session's `/auto-compact` override takes precedence over the persona default, and so
|
|
108
|
+
Thresholds are capped at the selected model's context window minus 16,384 tokens. A session's `/auto-compact` override takes precedence over the persona default, and so does a Telegram bot's default threshold. See [sessions](sessions.md) and [subagents](subagents.md) for inheritance and reset behavior.
|
|
109
109
|
|
|
110
110
|
Every persona can use all discovered skills. If a custom persona omits `tools`, Tau enables the standard tools and `agents`. A `tools` list without `agents` prevents the agent from starting or managing subagents. See [skills](skills.md) and [subagents](subagents.md) for those contracts.
|
|
111
111
|
|
|
@@ -115,7 +115,7 @@ The selectable tool names are:
|
|
|
115
115
|
|
|
116
116
|
Names such as `web`, `history`, `mcp`, and `models` enable capabilities inside the `code` tool, and `bash` also enables `tau.bash`. `agents` enables `tau.agents` inside `code` and the `wait_for_agents` tool. Tau builds the `code` tool from whichever of these capabilities are selected and usable.
|
|
117
117
|
|
|
118
|
-
A `tools` list replaces the defaults. Names are lowercased and duplicates removed. An unknown name makes the persona invalid. `tools: []` gives the persona none of these tools. The built-in `tau_docs` tool is always available, independent of this list. `mcp` works only when the
|
|
118
|
+
A `tools` list replaces the defaults. Names are lowercased and duplicates removed. An unknown name makes the persona invalid. `tools: []` gives the persona none of these tools. The built-in `tau_docs` tool is always available, independent of this list. `mcp` works only when the session has enabled MCP servers, which a session on a remote execution environment never has. [Tools](tools.md) explains eligibility and ownership.
|
|
119
119
|
|
|
120
120
|
## Selecting a persona
|
|
121
121
|
|
|
@@ -127,7 +127,7 @@ A `tools` list replaces the defaults. Names are lowercased and duplicates remove
|
|
|
127
127
|
}
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
The most specific `defaultPersona` wins. The ID must match exactly, including case. An unknown default produces a warning, and Tau uses the first available persona.
|
|
130
|
+
The most specific `defaultPersona` wins. The ID must match exactly, including case. An unknown default produces a warning, and Tau uses the first available persona. Telegram [workspace startup and presets](telegram.md#startup-and-presets) select the default the same way.
|
|
131
131
|
|
|
132
132
|
Override the default for one TUI launch:
|
|
133
133
|
|
|
@@ -149,7 +149,7 @@ This command matches the ID case-insensitively. `Ctrl+P` cycles through the avai
|
|
|
149
149
|
|
|
150
150
|
`reasoning` is the persona's default effort. A startup suffix, the session reasoning command, or `Shift+Tab` can override it. You can change reasoning while a turn is running, but the running turn keeps the model and tool settings it started with. The new effort applies from the next submitted or queued turn.
|
|
151
151
|
|
|
152
|
-
`allowedReasoningLevels` sets which values the TUI cycles through for the persona. It limits
|
|
152
|
+
`allowedReasoningLevels` sets which values the TUI cycles through for the persona. It also limits an effort passed to `setPersona`, including a Telegram preset's `reasoning`. TUI startup suffixes, `defaultPersona` suffixes, and `session.setReasoning` can still set other levels. When it is omitted, the TUI offers all standard levels for a model that supports reasoning. For a model whose catalog entry says `reasoning: false`, the selector shows only `none`.
|
|
153
153
|
|
|
154
154
|
An empty `allowedReasoningLevels` does not create an empty selector. The TUI uses its normal model-aware choices.
|
|
155
155
|
|
|
@@ -159,7 +159,7 @@ An empty `allowedReasoningLevels` does not create an empty selector. The TUI use
|
|
|
159
159
|
|
|
160
160
|
After editing personas, skills, or project context, run `/reload` while the session is idle. Reload finds personas again and rebuilds the session's prompt and tools.
|
|
161
161
|
|
|
162
|
-
If the current persona ID still exists, Tau applies its newly loaded definition
|
|
162
|
+
If the current persona ID still exists, Tau applies its newly loaded definition and keeps the session's current settings, including reasoning and service tier. Selecting the persona again applies its declared defaults. If the ID is gone, Tau selects the first available persona. Existing messages stay as they are; a persona change never rewrites earlier history.
|
|
163
163
|
|
|
164
164
|
The TUI refuses to reload while a turn is running. Subagents that are already running keep the setup they started with. Subagents started after the reload use the reloaded persona. See [subagents](subagents.md).
|
|
165
165
|
|
|
@@ -85,7 +85,7 @@ tau attach \
|
|
|
85
85
|
|
|
86
86
|
With the default `local` execution kind, this path is on the host machine, not the attaching machine. The directory must already exist and contain the repository or workspace you want. Tau creates only the session, not the directory or repository.
|
|
87
87
|
|
|
88
|
-
A remote `--new` sets the creation attribute `source: "tui"`. It does not look at the remote directory to fill in repository information. Clients that need it should create sessions through the SDK or protocol and send
|
|
88
|
+
A remote `--new` sets the creation attribute `source: "tui"`. It does not look at the remote directory to fill in repository information. Clients that need it should create sessions through the SDK or protocol and send `repository` themselves. The host still records `machine` and `cwd` for the session. See [sessions](sessions.md).
|
|
89
89
|
|
|
90
90
|
`tau attach` does not accept the persona flags of local startup. Set the server's default when starting the host, for example `tau serve --persona opus-5.5-coder`, or switch the new session with `/persona:<id>` after attaching.
|
|
91
91
|
|
|
@@ -158,9 +158,10 @@ Each kind of change belongs to a different process:
|
|
|
158
158
|
| Change | Action |
|
|
159
159
|
| --- | --- |
|
|
160
160
|
| Project config, personas, prompts, skills, or AGENTS.md in the execution environment | Wait for idle, then run `/reload`. |
|
|
161
|
+
| MCP server definitions | Start a new session, or reopen the session after the host has unloaded it. See [`mcpServers`](config-reference.md#mcpservers). |
|
|
161
162
|
| Global model `apiKeys` on the host | Restart the host. |
|
|
162
163
|
| Codex auth changed with `tau auth` | No restart needed; every new request reads auth storage again. |
|
|
163
|
-
| Attaching themes, speech
|
|
164
|
+
| Attaching themes, voice, recording shortcut, personal speech vocabulary, or configured client tools | Restart `tau attach`. |
|
|
164
165
|
| Host environment variables, history target, WebSocket listener, Fly Sprite connection, or host startup flags | Restart `tau serve`. |
|
|
165
166
|
| Host Tau package, built-in tools, protocol, session recovery code, or built-in documentation | Upgrade and restart the host. |
|
|
166
167
|
| TUI package, keybindings, rendering, local speech, or client-tool implementation | Upgrade and restart the attaching client. |
|
|
@@ -34,7 +34,7 @@ Trusting a repository therefore means trusting this content. Before using a repo
|
|
|
34
34
|
- `enabledClientTools`, which can turn on commands from your global configuration; and
|
|
35
35
|
- provision scripts or other repository automation used by integrations such as Telegram.
|
|
36
36
|
|
|
37
|
-
Project configuration cannot define client tool commands. It can only select commands defined in global configuration. A repository therefore cannot add a new
|
|
37
|
+
Project configuration cannot define client tool commands. It can only select commands defined in global configuration. A repository therefore cannot add a new client tool command to your machine, but a selected command can still do anything it was written to do. MCP servers follow different rules: [project configuration can define them](#trust-mcp-servers).
|
|
38
38
|
|
|
39
39
|
`--no-agent-context-files` turns off `AGENTS.md` loading and the list of nested `AGENTS.md` files. Project configuration, personas, skills, and tools still load. `--no-client-tools` turns off TUI client tools, not host tools. Neither flag is a general safe mode.
|
|
40
40
|
|
|
@@ -114,7 +114,11 @@ The `history` API is read-only, but it can see transcripts from every repository
|
|
|
114
114
|
|
|
115
115
|
## Trust MCP servers
|
|
116
116
|
|
|
117
|
-
MCP servers
|
|
117
|
+
A session on a local execution environment uses the MCP servers from the global and project configuration of its working directory, if its persona allows `mcp`. Its subagents use the same servers. Opening a session in a repository therefore lets that repository's `.tau/config.json` start commands on the host and use host credentials, with no approval step. This also applies to repositories that Telegram prepares and to directories that a WebSocket client chooses. Review a project's configuration before you open a session in it.
|
|
118
|
+
|
|
119
|
+
Anyone who can write a project's configuration can use this authority, including the agent. If the agent adds a server to `.tau/config.json`, that server becomes available the next time a session loads that configuration, for example after recovery. Tau removes secret-like variables from [Bash commands](#understand-environment-sanitization), but a stdio server inherits the full host environment. Definitions can also put any host environment variable into `env` or `headers` with `${NAME}`, and send it to the configured command or URL.
|
|
120
|
+
|
|
121
|
+
A session on a remote execution environment has no MCP servers, including servers configured on the host. Servers run on the host, so they could expose the host's files to a session that should see only its own machine, and neither the transport type nor a server's description shows whether they do. Configuration on the remote machine therefore cannot start commands on the host. The cost is that remote sessions also lose servers that only call an external service. This rule does not cover everything outside the remote machine: [Claude Code subagents](subagents.md#claude-code-subagents) use their own MCP configuration on that machine, and an attached client can still offer [command tools](client-tools.md) that run on the client's machine.
|
|
118
122
|
|
|
119
123
|
A stdio MCP server is trusted code on the host. It runs outside the code-mode sandbox with the host account's file and process permissions and its full environment, including credentials. Review the executable and arguments before configuring a server. HTTP servers receive the configured headers and the arguments sent to their tools. Use HTTPS for remote servers and give them only the access they need.
|
|
120
124
|
|
|
@@ -122,7 +126,7 @@ MCP has no confirmation step. Tools can change external systems or host resource
|
|
|
122
126
|
|
|
123
127
|
How a stdio server shuts down depends on the MCP transport. Child processes that ignore `SIGTERM` can outlive the server, so do not rely on shutdown to stop untrusted server processes.
|
|
124
128
|
|
|
125
|
-
|
|
129
|
+
A server that exposes host files or commands gives the agent that access. If that access is not acceptable, remove `mcp` from the persona or disable the server. Connections and credentials stay outside the model's JavaScript, but the server decides what its tools return.
|
|
126
130
|
|
|
127
131
|
## Protect remote session transports
|
|
128
132
|
|
|
@@ -148,12 +152,16 @@ Each bot's `allowedProjectIds` should list only the intended projects. Telegram
|
|
|
148
152
|
|
|
149
153
|
Repository and composite projects use managed workspaces and persistent bare repository caches. New or reconstructed repositories may run an executable `.tau/scripts/provision` in the background. Review that script like any other trusted project automation. Persistent-directory projects are never provisioned and never deleted by Tau.
|
|
150
154
|
|
|
155
|
+
A bot's `env` can select its own GitHub account and commit identity, but it does not isolate bots from each other. All bots run as the same operating-system user and share repository caches, so a command in one bot's session can read any credential store that user can read. Run separate runners under separate OS accounts when bots must be isolated. Tau saves `env` in each session, so it should hold paths to credential stores and no secrets. See [bot environments](telegram-projects.md#bot-environments).
|
|
156
|
+
|
|
151
157
|
Protect the runner configuration, session state, project-preference state, managed workspace root, and temporary attachment storage with a suitable OS account and file permissions. Never run two Telegram runners on the same state. Operational details are in [Telegram](telegram.md) and [Telegram projects and workspaces](telegram-projects.md).
|
|
152
158
|
|
|
153
159
|
## Know what history retains
|
|
154
160
|
|
|
155
161
|
Tau keeps a flat transcript history in the host user's home, separate from saved sessions. It contains user messages, intermediate system instructions, assistant text, and completed tool calls. The initial persona prompt is not included. Compaction does not remove entries. Rewind removes entries after the rewind point. Apart from that, entries stay; history is not a temporary cache.
|
|
156
162
|
|
|
163
|
+
History also records each native Tau subagent as its own session, whether or not any agent has the `history` tool. Rewinding the parent session does not remove these sessions, so a rewind can leave subagent transcripts in history that came from the removed work.
|
|
164
|
+
|
|
157
165
|
Without remote history, it stays in a SQLite database on the host. The `tau.history` capability can search all of it, within the persona's tools and the agent's usage rules. Protect the host account and database as you would the transcripts themselves.
|
|
158
166
|
|
|
159
167
|
With global `history` configuration, entries are still written to local SQLite first, and a persistent outbox copies them to the configured service in the background. Remote entries are limited in size, with large content truncated in the middle, but they can still contain source code, tool output, instructions, and personal data. The service also summarizes transcript content with its configured Cloudflare AI service.
|
|
@@ -79,7 +79,9 @@ result: { sessionId: string }
|
|
|
79
79
|
|
|
80
80
|
`cwd` must be an absolute path inside the chosen execution environment. A Fly Sprite must already exist, and the host must have a `flySprites` connection configured. Tau does not create the target or the repository.
|
|
81
81
|
|
|
82
|
-
`attributes` is required, even when empty.
|
|
82
|
+
`attributes` is required, even when empty. Tau adds `machine` and `cwd` from the execution environment and replaces any values the caller sends for those two keys. It stores other attributes as given and does not fill in missing ones. Attributes never change after creation. Conventional attributes and their use are covered in [sessions](sessions.md) and [history](history.md).
|
|
83
|
+
|
|
84
|
+
The final set can have at most 32 pairs, so a caller can send at most 30 attributes other than `machine` and `cwd`. Keys are 1 to 64 characters and values at most 1,024 characters. `executionEnvironment.cwd` has the same 1,024-character limit because it becomes an attribute value. A request that breaks these limits returns `invalid_params` before Tau starts the execution environment. Creation can still fail after that if Tau cannot read the hostname from the execution environment, or if the resulting `machine` or `cwd` value is too long.
|
|
83
85
|
|
|
84
86
|
A local `env` sets environment variables for the execution environment. Names must be valid variable names, values cannot contain NUL, and `HOME` is not allowed because the execution environment sets it. These variables are saved with the session, so do not put secrets there unless the session store is protected accordingly.
|
|
85
87
|
|
|
@@ -334,11 +336,11 @@ result: {
|
|
|
334
336
|
|
|
335
337
|
`thresholdTokens` must be a safe integer of at least 50,000, or `null` to remove the session override and use the default threshold. Numeric strings are rejected. Session creation accepts the same values in the optional `autoCompactThresholdTokens` field, which defaults to `null`.
|
|
336
338
|
|
|
337
|
-
The effective threshold uses the session override, then any host default (such as [Telegram bot
|
|
339
|
+
The effective threshold uses the session override, then any host default (such as a [Telegram bot's threshold](telegram.md#compaction-thresholds)), then the persona default, then the model's context window minus 16,384 tokens. It cannot exceed that model-based limit. A model with a small context window can therefore have an effective threshold below 50,000.
|
|
338
340
|
|
|
339
341
|
The host saves the setting and publishes a `settings.set` delta to observers. Changing it does not start compaction. A running turn and its steering continuations keep their original threshold.
|
|
340
342
|
|
|
341
|
-
Reloads, reasoning changes,
|
|
343
|
+
Reloads, reasoning changes, and recovery preserve the configured value. `session.setPersona` sets it to the supplied threshold, or to `null` if none is supplied, even when reapplying the current persona. The effective threshold is recalculated for the selected persona and model. Native Tau subagents launched without a model override inherit the parent's launching-turn threshold. Native launches with an explicit model use the persona's subagent threshold for that model, or the model's default. Claude Code subagents manage their own compaction. Ephemeral threads use the persona default without the main session override. See [automatic compaction](sessions.md#automatic-compaction) for request-size limits and costs.
|
|
342
344
|
|
|
343
345
|
### `session.setReasoning`
|
|
344
346
|
|
|
@@ -359,16 +361,23 @@ The change waits its turn behind other changes but does not interrupt a running
|
|
|
359
361
|
|
|
360
362
|
### `session.setPersona`
|
|
361
363
|
|
|
362
|
-
|
|
364
|
+
Applies a persona and optional settings atomically. A string `personaId` must exactly match an ID in the session catalog. `personaId: null` selects the current workspace default, including its effort suffix, and accepts no overrides. If that default names an unavailable persona, the first persona in the catalog is selected.
|
|
363
365
|
|
|
364
366
|
```ts
|
|
365
367
|
params: {
|
|
366
368
|
sessionId: string;
|
|
367
|
-
personaId: string;
|
|
369
|
+
personaId: string | null;
|
|
370
|
+
reasoning?: Reasoning;
|
|
371
|
+
autoCompactThresholdTokens?: number;
|
|
368
372
|
}
|
|
369
373
|
result: SessionProtocolSnapshot;
|
|
370
374
|
```
|
|
371
375
|
|
|
376
|
+
- `reasoning` overrides the persona's default effort. Without it, the persona's default applies.
|
|
377
|
+
- `autoCompactThresholdTokens` sets the session's compaction override, as a safe integer of at least 50,000. Without it, the override is cleared.
|
|
378
|
+
|
|
379
|
+
The `reasoning` override must be in the persona's `allowedReasoningLevels` when that list is non-empty, and a model without reasoning accepts only `none`. These limits do not apply to a workspace default's effort suffix. An unavailable persona or unsupported override fails with `invalid_request` before any setting changes.
|
|
380
|
+
|
|
372
381
|
This changes the context and waits its turn behind other changes. It interrupts a running turn and rejects pending input, then returns the new snapshot.
|
|
373
382
|
|
|
374
383
|
### `session.resolvePrompt`
|
|
@@ -414,7 +423,7 @@ result: {
|
|
|
414
423
|
}
|
|
415
424
|
```
|
|
416
425
|
|
|
417
|
-
Reload changes the context and waits its turn behind other changes. It interrupts a running turn and rejects pending input. It does not reload client themes or tools, process environment variables, or host services. See [configuration](configuration.md) for when changes apply.
|
|
426
|
+
Reload changes the context and waits its turn behind other changes. It interrupts a running turn and rejects pending input. It does not reload client themes or tools, process environment variables, or host services. MCP server definitions also stay as they were when the host loaded the session. If the definitions on disk differ, `warnings` says so. See [configuration](configuration.md) for when changes apply.
|
|
418
427
|
|
|
419
428
|
### `session.compact`
|
|
420
429
|
|
|
@@ -18,7 +18,7 @@ The server sends `ready` as its first message:
|
|
|
18
18
|
|
|
19
19
|
```json
|
|
20
20
|
{
|
|
21
|
-
"version":
|
|
21
|
+
"version": 19,
|
|
22
22
|
"type": "ready",
|
|
23
23
|
"methods": ["initialize", "session.create", "session.list"]
|
|
24
24
|
}
|
|
@@ -30,7 +30,7 @@ After `ready`, send `initialize` with non-empty client metadata:
|
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
{
|
|
33
|
-
"version":
|
|
33
|
+
"version": 19,
|
|
34
34
|
"type": "request",
|
|
35
35
|
"id": "init-1",
|
|
36
36
|
"method": "initialize",
|
|
@@ -50,7 +50,7 @@ Every request has the same envelope:
|
|
|
50
50
|
|
|
51
51
|
```json
|
|
52
52
|
{
|
|
53
|
-
"version":
|
|
53
|
+
"version": 19,
|
|
54
54
|
"type": "request",
|
|
55
55
|
"id": "req-42",
|
|
56
56
|
"method": "session.snapshot",
|
|
@@ -64,7 +64,7 @@ Successful responses echo the request id:
|
|
|
64
64
|
|
|
65
65
|
```json
|
|
66
66
|
{
|
|
67
|
-
"version":
|
|
67
|
+
"version": 19,
|
|
68
68
|
"type": "response",
|
|
69
69
|
"id": "req-42",
|
|
70
70
|
"ok": true,
|
|
@@ -101,7 +101,7 @@ Observing controls which updates you receive; it does not make you the owner. `s
|
|
|
101
101
|
| `lifecycle` | `idle` or `running`. |
|
|
102
102
|
| `agentState` | Independent agent revision, model context key, and optional usage checkpoint. |
|
|
103
103
|
| `settings`, `costTotal` | Persona, reasoning, and auto-compaction settings, and accumulated session cost. |
|
|
104
|
-
| `bootstrap`, `catalog` | Selected model and prompt metadata plus available personas, prompt metadata, skills,
|
|
104
|
+
| `bootstrap`, `catalog` | Selected model and prompt metadata plus available personas, prompt metadata, skills, MCP availability, and speech vocabulary. |
|
|
105
105
|
| `executionEnvironment` | The environment kind, identity, `cwd`, and home used for agent-visible work. |
|
|
106
106
|
| `messages`, `turns` | Messages sent to the model, and a saved record for each accepted turn. |
|
|
107
107
|
| `timeline` | Ordered active transcript placement. |
|
|
@@ -111,11 +111,21 @@ Observing controls which updates you receive; it does not make you the owner. `s
|
|
|
111
111
|
Both auto-compaction fields in `settings` are required:
|
|
112
112
|
|
|
113
113
|
- `autoCompactThresholdTokens` is the configured value: a safe integer of at least 50,000, or `null` to use the default threshold.
|
|
114
|
-
- `effectiveAutoCompactThresholdTokens` is the integer threshold clients should display. It resolves the session override, then any host default
|
|
114
|
+
- `effectiveAutoCompactThresholdTokens` is the integer threshold clients should display. It resolves the session override, then any host default (such as a Telegram bot's threshold), then the persona default, then the model's context window minus 16,384 tokens. It is capped at that model-based limit.
|
|
115
115
|
|
|
116
116
|
`bootstrap.model.contextWindow` is the full model window, regardless of the compaction threshold.
|
|
117
117
|
|
|
118
|
-
`catalog.
|
|
118
|
+
`catalog.mcp` says whether the session can use MCP. A session on a local execution environment lists its enabled servers by name, and a session on a remote execution environment has none:
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
catalog.mcp:
|
|
122
|
+
| { status: "available"; servers: string[] }
|
|
123
|
+
| { status: "unavailable"; reason: "remote-execution" };
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
A listed server may not be connected yet, because servers connect on first use. Connection settings and credentials are never included. The host sets this field when it loads the session, and it stays the same until the host loads the session again.
|
|
127
|
+
|
|
128
|
+
`catalog.speechVocabulary` holds the session's merged [`speech.vocabulary`](config-reference.md#speech) terms. The list has at most 100 terms and at most 10,000 Unicode characters in total. Each term is trimmed and non-empty, has at most 100 Unicode characters, and contains no angle brackets or line breaks. Clients that transcribe speech use these terms for this session. The host resolves them again on load, reload, and persona changes.
|
|
119
129
|
|
|
120
130
|
`bootstrap.prompt.subagentSystemPrompt` is present when subagents can be started. Each catalog persona has a `subagentLaunchModels` allowlist. Subagent records have task titles and IDs; there are no worker types.
|
|
121
131
|
|
|
@@ -141,7 +151,7 @@ Observed snapshot changes arrive as `session.delta`:
|
|
|
141
151
|
|
|
142
152
|
```json
|
|
143
153
|
{
|
|
144
|
-
"version":
|
|
154
|
+
"version": 19,
|
|
145
155
|
"type": "session.delta",
|
|
146
156
|
"sessionId": "0195d6e4-4cf9-7f44-a2d8-f8f7f49ee9d3",
|
|
147
157
|
"fromRevision": 8,
|
|
@@ -179,7 +189,7 @@ Some live state is not part of the snapshot. Each of these channels has its own
|
|
|
179
189
|
|
|
180
190
|
```json
|
|
181
191
|
{
|
|
182
|
-
"version":
|
|
192
|
+
"version": 19,
|
|
183
193
|
"type": "session.pendingUserMessages",
|
|
184
194
|
"sessionId": "...",
|
|
185
195
|
"state": {
|
|
@@ -216,7 +226,7 @@ An initialized client that advertised a tool can receive:
|
|
|
216
226
|
|
|
217
227
|
```json
|
|
218
228
|
{
|
|
219
|
-
"version":
|
|
229
|
+
"version": 19,
|
|
220
230
|
"type": "session.clientTool.call",
|
|
221
231
|
"sessionId": "...",
|
|
222
232
|
"agentId": "main",
|
|
@@ -242,7 +252,7 @@ Error responses use `ok: false`:
|
|
|
242
252
|
|
|
243
253
|
```json
|
|
244
254
|
{
|
|
245
|
-
"version":
|
|
255
|
+
"version": 19,
|
|
246
256
|
"type": "response",
|
|
247
257
|
"id": "req-42",
|
|
248
258
|
"ok": false,
|
|
@@ -10,8 +10,12 @@ A session also gets creation attributes, which never change. They are short stri
|
|
|
10
10
|
|
|
11
11
|
- `source`: the client that created the session, such as `tui` or `sdk`.
|
|
12
12
|
- `repository`: a normalized `host/owner/repository` value. Composite workspaces use a comma-separated list.
|
|
13
|
+
- `machine`: the hostname of the execution environment, which may differ from the machine that runs the client or host.
|
|
14
|
+
- `cwd`: the session's working directory in that execution environment.
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
Tau sets `machine` and `cwd` on every new session and replaces any values the client sends for those two keys. Recovering a saved session keeps its attributes unchanged, so older saved sessions may lack these two attributes.
|
|
17
|
+
|
|
18
|
+
Clients set all other attributes. A local TUI can fill in `repository` before creating the session, because it manages the local execution environment directly. A remote host never inspects a path to work out `repository`. The remote TUI sends `source: "tui"`. SDK and protocol clients should send the other attributes they need themselves.
|
|
15
19
|
|
|
16
20
|
A session's execution environment and working directory are fixed when it is created. `/new` creates another session in the same environment, with the current persona and reasoning settings. The existing session is kept, unchanged.
|
|
17
21
|
|
|
@@ -93,7 +97,7 @@ The summary aims both to let work continue right away and to keep earlier work r
|
|
|
93
97
|
Automatic compaction runs before a model call when the provider's latest token count, plus an estimate for content added since, exceeds the threshold. The threshold comes from the first of these that is set:
|
|
94
98
|
|
|
95
99
|
1. the session override;
|
|
96
|
-
2. in Telegram sessions, the bot's `
|
|
100
|
+
2. in Telegram sessions, the bot's `autoCompactThresholdTokens` (see [Telegram](telegram.md#compaction-thresholds));
|
|
97
101
|
3. the persona's `autoCompactThresholdTokens`;
|
|
98
102
|
4. the model's context window minus a fixed reserve of 16,384 tokens.
|
|
99
103
|
|
|
@@ -106,7 +110,7 @@ To compact earlier, set a token threshold for the session. The effective thresho
|
|
|
106
110
|
- With either command, use `default` to remove the session override and use the configured default again. Omit the argument to show the configured and effective thresholds.
|
|
107
111
|
- SDK and protocol inputs accept a safe integer of at least 50,000, or `null` for the default. They do not accept strings such as `50k`.
|
|
108
112
|
|
|
109
|
-
The minimum configured threshold is 50,000 tokens. The setting applies to the main conversation. It survives recovery, reloads, reasoning changes
|
|
113
|
+
The minimum configured threshold is 50,000 tokens. The setting applies to the main conversation. It survives recovery, reloads, and reasoning changes. Applying a persona clears it, even when reapplying the same persona, unless the request supplies a new threshold. Native Tau subagents launched without a model override inherit the parent launching turn's effective threshold, including its session override. Native launches with an explicit model use the persona's model-keyed subagent threshold or that model's default (see [subagents](subagents.md)). Claude Code subagents manage their own compaction. Ephemeral threads use the persona default, without the main session override; forks retain their source thread's threshold.
|
|
110
114
|
|
|
111
115
|
Changing the setting does not start compaction. The new threshold applies from the next logical turn. A running turn and its steering continuations keep their original threshold.
|
|
112
116
|
|
|
@@ -165,7 +169,7 @@ Compaction keeps searchable history, while rewind cuts it back to the rewind poi
|
|
|
165
169
|
|
|
166
170
|
Run `/reload` in the TUI while the session is idle. The host reads configuration, personas, prompts, skills, and `AGENTS.md` context again from the session's working directory. It keeps the current persona if its ID still exists, and otherwise selects the first available persona. Warnings appear in the transcript.
|
|
167
171
|
|
|
168
|
-
Reload affects later turns. It never changes the saved conversation or the execution environment. It does not reload anything owned by the client, such as themes,
|
|
172
|
+
Reload affects later turns. It never changes the saved conversation or the execution environment. It does not change the session's MCP servers, which stay as loaded; see [`mcpServers`](config-reference.md#mcpservers). It does not reload anything owned by the client, such as themes, voice, or client tools; restart the TUI for those. Codex auth storage is read again on every new request. Restart the host after changing its environment variables, `apiKeys`, listener settings, hosted environment settings, or the Tau version. [Credentials](credentials.md) and [remote sessions](remote-sessions.md) describe where each setting belongs.
|
|
169
173
|
|
|
170
174
|
Protocol clients can request changes directly, but should still wait for an idle session. Some changes interrupt running work and reject pending messages, so the session ends up with one consistent configuration.
|
|
171
175
|
|
|
@@ -176,7 +180,7 @@ Tau keeps two separate records for different purposes:
|
|
|
176
180
|
- The saved session is what Tau uses to continue one conversation. It contains the model's current context and the session state you see.
|
|
177
181
|
- Searchable history is a flat list of user messages, intermediate system instructions, assistant text, and finished tool calls, used to search and read across sessions. It is stored in the host's history database and can also be copied to a configured history service.
|
|
178
182
|
|
|
179
|
-
Compaction changes the saved session's model context but leaves searchable history as it was. Rewind cuts both back to the rewind point. History cannot rebuild a session and is never used to recover one. See [history](history.md) for storage, replication, and the history tool.
|
|
183
|
+
Compaction changes the saved session's model context but leaves searchable history as it was. Rewind cuts both back to the rewind point, but subagent sessions in history stay. History cannot rebuild a session and is never used to recover one. See [history](history.md) for storage, replication, and the history tool.
|
|
180
184
|
|
|
181
185
|
## Inspect model usage
|
|
182
186
|
|