@markusylisiurunen/tau 0.3.102 → 0.3.103
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/README.md +18 -23
- package/dist/core/history/migrations.js +40 -0
- package/dist/core/history/migrations.js.map +1 -1
- package/dist/core/history/setup.js +24 -7
- package/dist/core/history/setup.js.map +1 -1
- package/dist/core/mcp/cli.js +1 -1
- package/dist/core/mcp/cli.js.map +1 -1
- package/dist/core/static/tau_docs/client-tools.md +46 -385
- package/dist/core/static/tau_docs/code-mode.md +104 -43
- package/dist/core/static/tau_docs/configuration.md +77 -171
- package/dist/core/static/tau_docs/getting-started.md +25 -96
- package/dist/core/static/tau_docs/history.md +30 -228
- package/dist/core/static/tau_docs/how-tau-works.md +53 -0
- package/dist/core/static/tau_docs/image-generation.md +15 -107
- package/dist/core/static/tau_docs/index.md +46 -46
- package/dist/core/static/tau_docs/instructions-and-skills.md +81 -0
- package/dist/core/static/tau_docs/manifest.json +15 -21
- package/dist/core/static/tau_docs/mcp.md +77 -0
- package/dist/core/static/tau_docs/models-and-credentials.md +67 -0
- package/dist/core/static/tau_docs/openrouter.md +31 -129
- package/dist/core/static/tau_docs/pdf-unpacking.md +8 -21
- package/dist/core/static/tau_docs/personas.md +48 -144
- package/dist/core/static/tau_docs/remote-sessions.md +33 -170
- package/dist/core/static/tau_docs/sdk.md +150 -0
- package/dist/core/static/tau_docs/security.md +6 -193
- package/dist/core/static/tau_docs/session-protocol.md +84 -246
- package/dist/core/static/tau_docs/sessions.md +41 -205
- package/dist/core/static/tau_docs/speech-generation.md +16 -129
- package/dist/core/static/tau_docs/subagents.md +57 -229
- package/dist/core/static/tau_docs/telegram.md +152 -192
- package/dist/core/static/tau_docs/tools.md +44 -167
- package/dist/core/static/tau_docs/troubleshooting.md +23 -217
- package/dist/core/static/tau_docs/tui.md +42 -282
- package/dist/core/version.js +1 -1
- package/dist/history/worker/index.js +16 -22
- package/dist/history/worker/index.js.map +1 -1
- package/dist/history/worker/migrations/0005_external_content.sql +58 -0
- package/dist/history/worker/migrations/0006_external_content_cutover.sql +44 -0
- package/package.json +2 -2
- package/dist/core/static/tau_docs/config-reference.md +0 -367
- package/dist/core/static/tau_docs/credentials.md +0 -165
- package/dist/core/static/tau_docs/models.md +0 -57
- package/dist/core/static/tau_docs/node-sdk.md +0 -430
- package/dist/core/static/tau_docs/ownership-and-scope.md +0 -107
- package/dist/core/static/tau_docs/prompts-and-project-context.md +0 -147
- package/dist/core/static/tau_docs/sdk-diff-review.md +0 -92
- package/dist/core/static/tau_docs/session-protocol-methods.md +0 -655
- package/dist/core/static/tau_docs/skills.md +0 -135
- package/dist/core/static/tau_docs/telegram-commands.md +0 -55
- package/dist/core/static/tau_docs/telegram-projects.md +0 -197
|
@@ -1,655 +0,0 @@
|
|
|
1
|
-
# Session protocol method reference
|
|
2
|
-
|
|
3
|
-
This page lists every request method of the protocol version that ships with this Tau release. It is a compact reference for clients that already know how to connect, observe, and apply deltas, as described in the [session protocol](session-protocol.md).
|
|
4
|
-
|
|
5
|
-
Every request is `{ version, type: "request", id, method, params }`, and every successful response is `{ version, type: "response", id, ok: true, result }`. `version` is the number the server sends in `ready`. `params` is required even when empty, and unknown fields are removed.
|
|
6
|
-
|
|
7
|
-
## Common values
|
|
8
|
-
|
|
9
|
-
A `sessionId` is a non-empty opaque string returned by `session.create` or `session.list`. A client-supplied `historyEntryId` is also a non-empty opaque string; omit it to let Tau generate one.
|
|
10
|
-
|
|
11
|
-
Reasoning values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
|
|
12
|
-
|
|
13
|
-
Turn methods return one of these final outcomes:
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
type TurnOutcome =
|
|
17
|
-
| { status: "completed"; stopReason: "stop" | "length" | "toolUse" }
|
|
18
|
-
| { status: "failed"; stopReason: "error"; errorMessage?: string }
|
|
19
|
-
| { status: "aborted"; stopReason: "aborted" }
|
|
20
|
-
| {
|
|
21
|
-
status: "blocked";
|
|
22
|
-
reason: "auto-compaction-failed";
|
|
23
|
-
message: string;
|
|
24
|
-
};
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
A successful request can therefore report a failed, aborted, or blocked turn. The request itself fails only when the host cannot accept or finish it.
|
|
28
|
-
|
|
29
|
-
## Connect and find sessions
|
|
30
|
-
|
|
31
|
-
### `initialize`
|
|
32
|
-
|
|
33
|
-
Advertises client identity and optional client tools. Send it after `ready`.
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
params: {
|
|
37
|
-
client: {
|
|
38
|
-
name: string;
|
|
39
|
-
version: string;
|
|
40
|
-
tools?: Array<{
|
|
41
|
-
name: string;
|
|
42
|
-
description: string;
|
|
43
|
-
parameters: unknown;
|
|
44
|
-
executionTimeoutMs?: number | null; // omitted: 60 seconds; null: no execution deadline
|
|
45
|
-
}>;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
result: {
|
|
50
|
-
protocolVersion: number; // same as `version` in `ready`
|
|
51
|
-
methods: string[];
|
|
52
|
-
alreadyInitialized: boolean;
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
`name` and `version` must be non-empty. Tool names must not collide with host tools or tools advertised by another observer. Only the first initialization on a connection registers tools; a repeated call reports `alreadyInitialized: true`.
|
|
57
|
-
|
|
58
|
-
### `session.create`
|
|
59
|
-
|
|
60
|
-
Creates a session in one explicitly selected execution environment.
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
params: {
|
|
64
|
-
executionEnvironment:
|
|
65
|
-
| { kind: "local"; cwd: string; env?: Record<string, string> }
|
|
66
|
-
| {
|
|
67
|
-
kind: "fly-sprite";
|
|
68
|
-
spriteName: string;
|
|
69
|
-
cwd: string;
|
|
70
|
-
};
|
|
71
|
-
attributes: Record<string, string>;
|
|
72
|
-
personaId?: string;
|
|
73
|
-
reasoning?: Reasoning;
|
|
74
|
-
autoCompactThresholdTokens?: number | null;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
result: { sessionId: string }
|
|
78
|
-
```
|
|
79
|
-
|
|
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
|
-
|
|
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.
|
|
85
|
-
|
|
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.
|
|
87
|
-
|
|
88
|
-
Creation returns only an id. Call `session.observe` for state and streamed updates.
|
|
89
|
-
|
|
90
|
-
### `session.list`
|
|
91
|
-
|
|
92
|
-
Lists sessions available from this host.
|
|
93
|
-
|
|
94
|
-
```ts
|
|
95
|
-
params: {
|
|
96
|
-
}
|
|
97
|
-
result: {
|
|
98
|
-
sessions: Array<{ sessionId: string; lifecycle: "idle" | "running" }>;
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### `session.observe`
|
|
103
|
-
|
|
104
|
-
Observes one session on this connection.
|
|
105
|
-
|
|
106
|
-
```ts
|
|
107
|
-
params: {
|
|
108
|
-
sessionId: string;
|
|
109
|
-
}
|
|
110
|
-
result: {
|
|
111
|
-
snapshot: SessionProtocolSnapshot;
|
|
112
|
-
pendingUserMessages: PendingUserMessagesState;
|
|
113
|
-
subagentActivities: SubagentActivitiesState;
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Install all three before applying later messages. Calling `observe` again returns fresh starting states; it does not create a second session.
|
|
118
|
-
|
|
119
|
-
### `session.unobserve`
|
|
120
|
-
|
|
121
|
-
Stops this connection's observation without deleting or interrupting the hosted session.
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
params: {
|
|
125
|
-
sessionId: string;
|
|
126
|
-
}
|
|
127
|
-
result: {
|
|
128
|
-
unobserved: true;
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
The session must currently be observed by this connection.
|
|
133
|
-
|
|
134
|
-
## Keep sessions loaded and unload them
|
|
135
|
-
|
|
136
|
-
[Keep a session loaded without clients](session-protocol.md#keep-a-session-loaded-without-clients) explains how these methods fit together. The connection does not need to observe the session to call them.
|
|
137
|
-
|
|
138
|
-
### `session.setRetention`
|
|
139
|
-
|
|
140
|
-
Sets, renews, or clears the session's retention period.
|
|
141
|
-
|
|
142
|
-
```ts
|
|
143
|
-
params: {
|
|
144
|
-
sessionId: string;
|
|
145
|
-
durationMs: number | null;
|
|
146
|
-
}
|
|
147
|
-
result: {
|
|
148
|
-
retainedUntil: number | null;
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
`durationMs` is required. A number must be an integer from 1 to 2,147,483,647 (about 24.8 days). The period starts when the host handles the request, and `retainedUntil` is its end in milliseconds since the Unix epoch, according to the host's clock. Each call replaces the previous period, so a call can shorten it as well as extend it.
|
|
153
|
-
|
|
154
|
-
`null` clears retention and returns `retainedUntil: null`. Clearing does not detach clients or interrupt work.
|
|
155
|
-
|
|
156
|
-
Setting a period requires a loaded session and fails with `not_found` otherwise, even when the session is saved. To retain an unloaded session, call `session.observe` first. Clearing always succeeds for a session that is not loaded, including an unknown ID.
|
|
157
|
-
|
|
158
|
-
### `session.collect`
|
|
159
|
-
|
|
160
|
-
Unloads a session if nothing keeps it loaded, and reports whether it is unloaded. This method never loads a session and never deletes the saved one.
|
|
161
|
-
|
|
162
|
-
```ts
|
|
163
|
-
params: {
|
|
164
|
-
sessionId: string;
|
|
165
|
-
}
|
|
166
|
-
result: {
|
|
167
|
-
disposed: boolean;
|
|
168
|
-
}
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
The result is `disposed: false`, without waiting, while any of these is true:
|
|
172
|
-
|
|
173
|
-
- A client observes the session, including this connection.
|
|
174
|
-
- A retention period is active.
|
|
175
|
-
- Work is running.
|
|
176
|
-
- The host is loading the session from storage.
|
|
177
|
-
|
|
178
|
-
Otherwise the host unloads the session, and the response waits until any unloading in progress has finished, including the release of the execution environment. The result is then `disposed: true`, which is also the result for a session that is not loaded and for an unknown ID. If unloading fails, the request fails with `internal_error`.
|
|
179
|
-
|
|
180
|
-
If saving the session before disposal fails, retry `session.collect`. A failed disposal, including cleanup of a recovery attempt, means the host can no longer establish that the session's files are safe to remove. No later `session.collect` for that ID returns `disposed: true` until the host restarts, even when the session is no longer loaded. Each later call returns `disposed: false` or fails. The host keeps this record only in memory, so after a restart the session counts as not loaded, and `disposed: true` no longer tells you whether the earlier release finished.
|
|
181
|
-
|
|
182
|
-
## Add user input and run turns
|
|
183
|
-
|
|
184
|
-
### `session.record`
|
|
185
|
-
|
|
186
|
-
Appends user-authored text without running an assistant turn.
|
|
187
|
-
|
|
188
|
-
```ts
|
|
189
|
-
params: { sessionId: string; text: string; historyEntryId?: string }
|
|
190
|
-
result: { snapshot: SessionProtocolSnapshot; userHistoryEntryId: string }
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
This changes the context and waits its turn behind other changes. It can interrupt a running turn, and rejects pending queued and steering requests before adding the message. Use it for text written by the user that the model should see, not for client diagnostics.
|
|
194
|
-
|
|
195
|
-
### `session.submit`
|
|
196
|
-
|
|
197
|
-
Appends user text and runs one ordinary turn. The session must be idle.
|
|
198
|
-
|
|
199
|
-
```ts
|
|
200
|
-
params: { sessionId: string; text: string; historyEntryId?: string }
|
|
201
|
-
result: { userHistoryEntryId: string; turn: TurnOutcome }
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
Once accepted, the turn is recorded in `snapshot.turns[userHistoryEntryId]`. Updates arrive through the observed channels while the request is open.
|
|
205
|
-
|
|
206
|
-
### `session.queue`
|
|
207
|
-
|
|
208
|
-
Same parameters and result as `session.submit`. When the session is idle, the turn starts right away. While a turn is running, the message is listed as pending and starts once the session is idle.
|
|
209
|
-
|
|
210
|
-
```ts
|
|
211
|
-
params: { sessionId: string; text: string; historyEntryId?: string }
|
|
212
|
-
result: { userHistoryEntryId: string; turn: TurnOutcome }
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
The response arrives when that turn finishes.
|
|
216
|
-
|
|
217
|
-
### `session.steer`
|
|
218
|
-
|
|
219
|
-
Changes the direction of the running turn.
|
|
220
|
-
|
|
221
|
-
```ts
|
|
222
|
-
params: {
|
|
223
|
-
sessionId: string;
|
|
224
|
-
text: string;
|
|
225
|
-
}
|
|
226
|
-
result: {
|
|
227
|
-
userHistoryEntryId: string;
|
|
228
|
-
turn: TurnOutcome;
|
|
229
|
-
}
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
When idle, steering starts an ordinary turn. During a turn, Tau waits for the next safe point, batches steering messages in arrival order, and continues the turn with them before any queued work. Batched requests share the same generated `userHistoryEntryId`. Steering does not accept a history ID from the caller.
|
|
233
|
-
|
|
234
|
-
### `session.cancelPendingMessages`
|
|
235
|
-
|
|
236
|
-
Cancels all pending queued and steering requests without interrupting running work.
|
|
237
|
-
|
|
238
|
-
```ts
|
|
239
|
-
params: {
|
|
240
|
-
sessionId: string;
|
|
241
|
-
}
|
|
242
|
-
result: {
|
|
243
|
-
cancelled: Array<{ id: string; mode: "queue" | "steer"; text: string }>;
|
|
244
|
-
}
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
The returned order is steering first, then queued messages. Each cancelled queue or steering request receives a `cancelled` error response.
|
|
248
|
-
|
|
249
|
-
### `session.retry`
|
|
250
|
-
|
|
251
|
-
Runs one turn from current history without appending user text.
|
|
252
|
-
|
|
253
|
-
```ts
|
|
254
|
-
params: {
|
|
255
|
-
sessionId: string;
|
|
256
|
-
}
|
|
257
|
-
result: {
|
|
258
|
-
turn: TurnOutcome;
|
|
259
|
-
}
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
The session must be idle.
|
|
263
|
-
|
|
264
|
-
### `session.interrupt`
|
|
265
|
-
|
|
266
|
-
Asks the session's running work to stop: turns, direct commands, model samples, and maintenance.
|
|
267
|
-
|
|
268
|
-
```ts
|
|
269
|
-
params: {
|
|
270
|
-
sessionId: string;
|
|
271
|
-
}
|
|
272
|
-
result: {
|
|
273
|
-
interrupted: boolean;
|
|
274
|
-
isTurnRunning: boolean;
|
|
275
|
-
}
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
`isTurnRunning` may stay `true` until the cancellation finishes. The method also cancels steering that has not been applied. It does not interrupt or remove subagents; use `session.interruptSubagent` for a subagent.
|
|
279
|
-
|
|
280
|
-
## Run independent execution and sampling
|
|
281
|
-
|
|
282
|
-
### `session.exec`
|
|
283
|
-
|
|
284
|
-
Runs a fresh non-interactive login Bash in the session execution environment. It does not change the snapshot or add output to conversation history.
|
|
285
|
-
|
|
286
|
-
```ts
|
|
287
|
-
params: {
|
|
288
|
-
sessionId: string;
|
|
289
|
-
execId: string;
|
|
290
|
-
command: string;
|
|
291
|
-
args?: string[];
|
|
292
|
-
env?: Record<string, string>;
|
|
293
|
-
stdinBase64?: string;
|
|
294
|
-
cwd?: string;
|
|
295
|
-
timeoutMs?: number;
|
|
296
|
-
maxCaptureBytes?: number;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
result: {
|
|
300
|
-
output: string;
|
|
301
|
-
stdout: string;
|
|
302
|
-
stderr: string;
|
|
303
|
-
exitCode: number | null;
|
|
304
|
-
truncated: boolean;
|
|
305
|
-
timedOut: boolean;
|
|
306
|
-
aborted: boolean;
|
|
307
|
-
closeSignal: string | null;
|
|
308
|
-
}
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
`execId` must be unique among active executions in the session. `stdinBase64` is limited to 16 MiB decoded. `maxCaptureBytes` is positive and at most 24 MiB; the default is 1 MiB. `HOME` cannot be overridden.
|
|
312
|
-
|
|
313
|
-
When `args` is present, Bash receives the first value as `$0` and the rest as `$@`. To run one executable safely, use `command: 'exec "$0" "$@"'` with the executable and its arguments in `args`. `cwd` sets the starting directory; it does not restrict the command to it.
|
|
314
|
-
|
|
315
|
-
Commands can run at the same time as turns, samples, session changes, and other commands. Clients must coordinate workspace access when consistency matters.
|
|
316
|
-
|
|
317
|
-
### `session.cancelExec`
|
|
318
|
-
|
|
319
|
-
Cancels one active execution without interrupting other work.
|
|
320
|
-
|
|
321
|
-
```ts
|
|
322
|
-
params: {
|
|
323
|
-
sessionId: string;
|
|
324
|
-
execId: string;
|
|
325
|
-
}
|
|
326
|
-
result: {
|
|
327
|
-
cancelled: boolean;
|
|
328
|
-
}
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
### `session.sample`
|
|
332
|
-
|
|
333
|
-
Runs a standalone model call with the session's current model. It uses only the context you supply, and does not change the session, run tools, send deltas, or add to the session's cost.
|
|
334
|
-
|
|
335
|
-
```ts
|
|
336
|
-
params: {
|
|
337
|
-
sessionId: string;
|
|
338
|
-
context: {
|
|
339
|
-
systemPrompt: string;
|
|
340
|
-
messages: Message[];
|
|
341
|
-
tools?: Array<{
|
|
342
|
-
name: string;
|
|
343
|
-
description: string;
|
|
344
|
-
parameters: Record<string, unknown>;
|
|
345
|
-
}>;
|
|
346
|
-
};
|
|
347
|
-
options: { reasoning?: Reasoning; maxTokens?: number };
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
result: { message: AssistantMessage }
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
`context.messages` and the returned message use Tau's provider-independent message format. System messages after the first use the plain-text format with versioned metadata described in the [session protocol](session-protocol.md); the metadata is not sent to the provider. Sections and tool changes are rejected. Assistant messages retain optional `providerThinkingLevel` strings and tool-call `argumentsError` diagnostics when passed into later sampling contexts. Tool calls in the response are returned as data and never run. Samples can run at the same time, and `session.interrupt`, transport shutdown, or host shutdown cancels them.
|
|
354
|
-
|
|
355
|
-
## Read and change session state
|
|
356
|
-
|
|
357
|
-
### `session.snapshot`
|
|
358
|
-
|
|
359
|
-
Returns the complete current snapshot.
|
|
360
|
-
|
|
361
|
-
```ts
|
|
362
|
-
params: {
|
|
363
|
-
sessionId: string;
|
|
364
|
-
}
|
|
365
|
-
result: SessionProtocolSnapshot;
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
Use this after observation, on demand, or to recover from a delta revision gap. The [session protocol](session-protocol.md) describes the snapshot and client application rules.
|
|
369
|
-
|
|
370
|
-
### `session.setAutoCompactThreshold`
|
|
371
|
-
|
|
372
|
-
Changes the main conversation's automatic-compaction threshold, starting with the next logical turn.
|
|
373
|
-
|
|
374
|
-
```ts
|
|
375
|
-
params: {
|
|
376
|
-
sessionId: string;
|
|
377
|
-
thresholdTokens: number | null;
|
|
378
|
-
}
|
|
379
|
-
result: {
|
|
380
|
-
revision: number;
|
|
381
|
-
settings: SessionProtocolSettingsSnapshot;
|
|
382
|
-
}
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
`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`.
|
|
386
|
-
|
|
387
|
-
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.
|
|
388
|
-
|
|
389
|
-
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.
|
|
390
|
-
|
|
391
|
-
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.
|
|
392
|
-
|
|
393
|
-
### `session.setReasoning`
|
|
394
|
-
|
|
395
|
-
Changes the reasoning effort, starting with the next turn.
|
|
396
|
-
|
|
397
|
-
```ts
|
|
398
|
-
params: {
|
|
399
|
-
sessionId: string;
|
|
400
|
-
reasoning: Reasoning;
|
|
401
|
-
}
|
|
402
|
-
result: {
|
|
403
|
-
revision: number;
|
|
404
|
-
settings: SessionProtocolSettingsSnapshot;
|
|
405
|
-
}
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
The change waits its turn behind other changes but does not interrupt a running turn. Running turns, including their steering, keep their settings.
|
|
409
|
-
|
|
410
|
-
### `session.setPersona`
|
|
411
|
-
|
|
412
|
-
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.
|
|
413
|
-
|
|
414
|
-
```ts
|
|
415
|
-
params: {
|
|
416
|
-
sessionId: string;
|
|
417
|
-
personaId: string | null;
|
|
418
|
-
reasoning?: Reasoning;
|
|
419
|
-
autoCompactThresholdTokens?: number;
|
|
420
|
-
}
|
|
421
|
-
result: SessionProtocolSnapshot;
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
- `reasoning` overrides the persona's default effort. Without it, the persona's default applies.
|
|
425
|
-
- `autoCompactThresholdTokens` sets the session's compaction override, as a safe integer of at least 50,000. Without it, the override is cleared.
|
|
426
|
-
|
|
427
|
-
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.
|
|
428
|
-
|
|
429
|
-
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.
|
|
430
|
-
|
|
431
|
-
### `session.resolvePrompt`
|
|
432
|
-
|
|
433
|
-
Loads one current prompt body from the execution environment.
|
|
434
|
-
|
|
435
|
-
```ts
|
|
436
|
-
params: {
|
|
437
|
-
sessionId: string;
|
|
438
|
-
promptId: string;
|
|
439
|
-
}
|
|
440
|
-
result: {
|
|
441
|
-
promptId: string;
|
|
442
|
-
text: string;
|
|
443
|
-
}
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
The snapshot catalog holds only prompt IDs and labels. Call this when the user chooses a prompt.
|
|
447
|
-
|
|
448
|
-
### `session.autocompletePaths`
|
|
449
|
-
|
|
450
|
-
Returns a limited list of path suggestions from the execution environment.
|
|
451
|
-
|
|
452
|
-
```ts
|
|
453
|
-
params: { sessionId: string; query: string; limit: number }
|
|
454
|
-
result: { paths: string[] }
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
`limit` is a positive integer no greater than 100. Results can include directories with a trailing `/` and are not snapshot state.
|
|
458
|
-
|
|
459
|
-
## Reload, compact, and rewind
|
|
460
|
-
|
|
461
|
-
### `session.reload`
|
|
462
|
-
|
|
463
|
-
Reloads the session's configuration and content from the execution environment.
|
|
464
|
-
|
|
465
|
-
```ts
|
|
466
|
-
params: { sessionId: string }
|
|
467
|
-
result: {
|
|
468
|
-
snapshot: SessionProtocolSnapshot;
|
|
469
|
-
warnings: string[];
|
|
470
|
-
counts: { personas: number; prompts: number; skills: number };
|
|
471
|
-
}
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
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.
|
|
475
|
-
|
|
476
|
-
### `session.compact`
|
|
477
|
-
|
|
478
|
-
Replaces the model's context with a generated summary.
|
|
479
|
-
|
|
480
|
-
```ts
|
|
481
|
-
params: {
|
|
482
|
-
sessionId: string;
|
|
483
|
-
mode: "summary-only" | "summary-and-last";
|
|
484
|
-
guidance?: string;
|
|
485
|
-
}
|
|
486
|
-
result: {
|
|
487
|
-
snapshot: SessionProtocolSnapshot;
|
|
488
|
-
compactionMessage: string;
|
|
489
|
-
includedLastAssistant: boolean;
|
|
490
|
-
}
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
Compaction interrupts a running turn, rejects pending input, and returns the new snapshot. A successful compaction advances the timeline epoch.
|
|
494
|
-
|
|
495
|
-
### `session.rewind`
|
|
496
|
-
|
|
497
|
-
Removes one user message and everything after it.
|
|
498
|
-
|
|
499
|
-
```ts
|
|
500
|
-
params: { sessionId: string; historyEntryId: string }
|
|
501
|
-
result: {
|
|
502
|
-
snapshot: SessionProtocolSnapshot;
|
|
503
|
-
historyEntryId: string;
|
|
504
|
-
text: string;
|
|
505
|
-
removedEntryIds: string[];
|
|
506
|
-
}
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
Rewind requires an idle session with no pending input, and returns `busy` instead of interrupting work. The returned `text` is the removed user message, for putting back in an editor.
|
|
510
|
-
|
|
511
|
-
## Control subagents and ephemeral contexts
|
|
512
|
-
|
|
513
|
-
### `session.interruptSubagent`
|
|
514
|
-
|
|
515
|
-
Interrupts one subagent's current run, at any depth. Its descendants keep running, and the subagent stays available for follow-ups.
|
|
516
|
-
|
|
517
|
-
```ts
|
|
518
|
-
params: {
|
|
519
|
-
sessionId: string;
|
|
520
|
-
subagentId: string;
|
|
521
|
-
}
|
|
522
|
-
result: {
|
|
523
|
-
found: boolean;
|
|
524
|
-
}
|
|
525
|
-
```
|
|
526
|
-
|
|
527
|
-
### `session.ephemeral.create`
|
|
528
|
-
|
|
529
|
-
Creates an agent context on the host that is not saved and is separate from the main conversation.
|
|
530
|
-
|
|
531
|
-
```ts
|
|
532
|
-
params: {
|
|
533
|
-
sessionId: string;
|
|
534
|
-
instructions: string;
|
|
535
|
-
workingDirectory?: string;
|
|
536
|
-
tools: Array<"bash" | "write" | "edit" | "view_image" | "web">;
|
|
537
|
-
reasoning?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
538
|
-
}
|
|
539
|
-
result: {
|
|
540
|
-
contextId: string;
|
|
541
|
-
}
|
|
542
|
-
```
|
|
543
|
-
|
|
544
|
-
The context uses the session's persona and execution environment, with the given instructions and exactly the given tools. `workingDirectory` selects the directory for project instructions, skills, and tool defaults. Relative paths resolve against the session directory; omitting it uses the session directory. The main session stays unchanged. `reasoning` sets the starting effort for new threads. Without it, the context uses the session's effort at creation time. Later changes to the session's settings do not affect the context. It does not survive a host restart.
|
|
545
|
-
|
|
546
|
-
### `session.ephemeral.submit`
|
|
547
|
-
|
|
548
|
-
Runs or continues one thread in an ephemeral context.
|
|
549
|
-
|
|
550
|
-
```ts
|
|
551
|
-
params: {
|
|
552
|
-
sessionId: string;
|
|
553
|
-
contextId: string;
|
|
554
|
-
threadId: string;
|
|
555
|
-
forkFromThreadId?: string;
|
|
556
|
-
message: string;
|
|
557
|
-
reasoning?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
558
|
-
}
|
|
559
|
-
result: { threadId: string; response: string }
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
`reasoning` changes the thread's effort before running the message, and stays in effect for later messages. Without it, the thread keeps its current effort. `forkFromThreadId` creates a new thread from an idle thread in the same context, copying its effort; a `reasoning` value given here applies only to the new fork. A second submission to a busy thread returns `busy`, while different threads can run at once.
|
|
563
|
-
|
|
564
|
-
### `session.ephemeral.close`
|
|
565
|
-
|
|
566
|
-
Closes a context and interrupts its live threads.
|
|
567
|
-
|
|
568
|
-
```ts
|
|
569
|
-
params: {
|
|
570
|
-
sessionId: string;
|
|
571
|
-
contextId: string;
|
|
572
|
-
}
|
|
573
|
-
result: {
|
|
574
|
-
closed: boolean;
|
|
575
|
-
}
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
`closed` is `false` when the context was not present.
|
|
579
|
-
|
|
580
|
-
## Complete delegated client-tool calls
|
|
581
|
-
|
|
582
|
-
These methods are for clients that offered tools in `initialize`. Other clients never call them.
|
|
583
|
-
|
|
584
|
-
### `session.clientTool.ack`
|
|
585
|
-
|
|
586
|
-
Acknowledges a `session.clientTool.call` before its deadline.
|
|
587
|
-
|
|
588
|
-
```ts
|
|
589
|
-
params: {
|
|
590
|
-
sessionId: string;
|
|
591
|
-
callId: string;
|
|
592
|
-
presentation?: {
|
|
593
|
-
subject?: string;
|
|
594
|
-
subjectWrap?: "word" | "character";
|
|
595
|
-
details?: Array<{
|
|
596
|
-
text: string;
|
|
597
|
-
tone?: "added" | "removed";
|
|
598
|
-
wrap?: "word" | "character";
|
|
599
|
-
}>;
|
|
600
|
-
metadata?: string[];
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
result: {
|
|
604
|
-
accepted: boolean;
|
|
605
|
-
}
|
|
606
|
-
```
|
|
607
|
-
|
|
608
|
-
The optional presentation partly overrides the running tool card. If given, `subject` must be non-empty and may contain line feeds but not carriage returns. Each detail text and metadata value is one line. Presentation objects are limited to 1 MiB; subjects and detail values to 256 KiB each; metadata values to 16 KiB each; and detail and metadata collections to 1,024 entries each.
|
|
609
|
-
|
|
610
|
-
The host keeps fields you set, within those limits, and fills in omitted fields with defaults truncated as Tau truncates its own cards. It sets the action and operation, and records the final presentation. An empty `details` or `metadata` array hides that default. Once the acknowledgement is accepted, the client may start work.
|
|
611
|
-
|
|
612
|
-
### `session.clientTool.result`
|
|
613
|
-
|
|
614
|
-
Completes a call with model-visible content or an error.
|
|
615
|
-
|
|
616
|
-
```ts
|
|
617
|
-
type PresentationOverride = {
|
|
618
|
-
subject?: string;
|
|
619
|
-
subjectWrap?: "word" | "character";
|
|
620
|
-
details?: Array<{
|
|
621
|
-
text: string;
|
|
622
|
-
tone?: "added" | "removed";
|
|
623
|
-
wrap?: "word" | "character";
|
|
624
|
-
}>;
|
|
625
|
-
metadata?: string[];
|
|
626
|
-
};
|
|
627
|
-
|
|
628
|
-
params:
|
|
629
|
-
| {
|
|
630
|
-
sessionId: string;
|
|
631
|
-
callId: string;
|
|
632
|
-
ok: true;
|
|
633
|
-
content: Array<
|
|
634
|
-
| { type: "text"; text: string; textSignature?: string }
|
|
635
|
-
| { type: "image"; data: string; mimeType: "image/jpeg" | "image/png" | "image/webp" }
|
|
636
|
-
>;
|
|
637
|
-
presentation?: PresentationOverride;
|
|
638
|
-
}
|
|
639
|
-
| {
|
|
640
|
-
sessionId: string;
|
|
641
|
-
callId: string;
|
|
642
|
-
ok: false;
|
|
643
|
-
error: string;
|
|
644
|
-
presentation?: PresentationOverride;
|
|
645
|
-
};
|
|
646
|
-
result: { accepted: boolean };
|
|
647
|
-
```
|
|
648
|
-
|
|
649
|
-
`content` keeps the order of text and image blocks in the model's result, snapshots, and deltas. It may be empty and can have at most 1,024 blocks, including at most 16 images in valid padded base64 of at most 3.5 MiB each. Images are never shown in the tool card.
|
|
650
|
-
|
|
651
|
-
The optional presentation applies only to the finished card, separately from the running one. The host keeps fields you set once they pass validation, and fills in omitted fields with truncated defaults. If no result arrives, the host shows a complete default card for the timeout, cancellation, detach, or other outcome.
|
|
652
|
-
|
|
653
|
-
A successful result is accepted only after the host has accepted the acknowledgement. An error sent before acknowledging records a preparation failure, such as an error from `describe`, and the tool never runs. An error sent afterward records an execution failure.
|
|
654
|
-
|
|
655
|
-
`accepted: false` means a successful result arrived before the call was acknowledged, or the call was cancelled, timed out, detached, unknown, or already finished. Do not retry or send more results for that call.
|