@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.
Files changed (146) hide show
  1. package/dist/core/code_mode/agents.js +2 -0
  2. package/dist/core/code_mode/agents.js.map +1 -1
  3. package/dist/core/code_mode/history.js +7 -0
  4. package/dist/core/code_mode/history.js.map +1 -1
  5. package/dist/core/code_mode/models.js.map +1 -1
  6. package/dist/core/code_mode/web.js.map +1 -1
  7. package/dist/core/config/content_loader.js.map +1 -1
  8. package/dist/core/config/index.js +2 -1
  9. package/dist/core/config/index.js.map +1 -1
  10. package/dist/core/config/ownership.js +71 -0
  11. package/dist/core/config/ownership.js.map +1 -0
  12. package/dist/core/config/runtime.js +22 -10
  13. package/dist/core/config/runtime.js.map +1 -1
  14. package/dist/core/config/runtime_config_snapshot.js +2 -2
  15. package/dist/core/config/runtime_config_snapshot.js.map +1 -1
  16. package/dist/core/config/schema.js +3 -2
  17. package/dist/core/config/schema.js.map +1 -1
  18. package/dist/core/history/agent_history_recorder.js +64 -0
  19. package/dist/core/history/agent_history_recorder.js.map +1 -0
  20. package/dist/core/history/cli.js +2 -2
  21. package/dist/core/history/cli.js.map +1 -1
  22. package/dist/core/history/config.js.map +1 -1
  23. package/dist/core/history/history_manager.js +14 -29
  24. package/dist/core/history/history_manager.js.map +1 -1
  25. package/dist/core/history/local_history_store.js +43 -10
  26. package/dist/core/history/local_history_store.js.map +1 -1
  27. package/dist/core/history/migrations.js +1 -1
  28. package/dist/core/history/migrations.js.map +1 -1
  29. package/dist/core/history/remote_history_client.js +2 -0
  30. package/dist/core/history/remote_history_client.js.map +1 -1
  31. package/dist/core/history/setup.js +10 -8
  32. package/dist/core/history/setup.js.map +1 -1
  33. package/dist/core/index.js +1 -1
  34. package/dist/core/index.js.map +1 -1
  35. package/dist/core/persona_selection.js +38 -0
  36. package/dist/core/persona_selection.js.map +1 -0
  37. package/dist/core/runtime/agent_model.js.map +1 -1
  38. package/dist/core/runtime/chat_runtime.js +1 -5
  39. package/dist/core/runtime/chat_runtime.js.map +1 -1
  40. package/dist/core/session/auto_compaction_threshold.js.map +1 -1
  41. package/dist/core/static/code_mode/history/documentation.md +22 -4
  42. package/dist/core/static/tau_docs/code-mode.md +1 -1
  43. package/dist/core/static/tau_docs/config-reference.md +22 -8
  44. package/dist/core/static/tau_docs/configuration.md +13 -2
  45. package/dist/core/static/tau_docs/credentials.md +1 -1
  46. package/dist/core/static/tau_docs/history.md +48 -5
  47. package/dist/core/static/tau_docs/models.md +1 -1
  48. package/dist/core/static/tau_docs/node-sdk.md +9 -9
  49. package/dist/core/static/tau_docs/ownership-and-scope.md +7 -5
  50. package/dist/core/static/tau_docs/personas.md +5 -5
  51. package/dist/core/static/tau_docs/remote-sessions.md +3 -2
  52. package/dist/core/static/tau_docs/security.md +11 -3
  53. package/dist/core/static/tau_docs/session-protocol-methods.md +15 -6
  54. package/dist/core/static/tau_docs/session-protocol.md +21 -11
  55. package/dist/core/static/tau_docs/sessions.md +9 -5
  56. package/dist/core/static/tau_docs/subagents.md +13 -13
  57. package/dist/core/static/tau_docs/telegram-projects.md +65 -10
  58. package/dist/core/static/tau_docs/telegram.md +60 -41
  59. package/dist/core/static/tau_docs/troubleshooting.md +7 -3
  60. package/dist/core/static/tau_docs/tui.md +24 -5
  61. package/dist/core/subagents/agent_supervisor.js +5 -1
  62. package/dist/core/subagents/agent_supervisor.js.map +1 -1
  63. package/dist/core/subagents/claude_code_runner.mjs +49 -49
  64. package/dist/core/subagents/native_subagent_runtime.js +6 -1
  65. package/dist/core/subagents/native_subagent_runtime.js.map +1 -1
  66. package/dist/core/subagents/runtime.js.map +1 -1
  67. package/dist/core/telegram/adapter.js +41 -59
  68. package/dist/core/telegram/adapter.js.map +1 -1
  69. package/dist/core/telegram/cli.js +24 -12
  70. package/dist/core/telegram/cli.js.map +1 -1
  71. package/dist/core/telegram/config.js +43 -58
  72. package/dist/core/telegram/config.js.map +1 -1
  73. package/dist/core/telegram/local_session_client.js +3 -3
  74. package/dist/core/telegram/local_session_client.js.map +1 -1
  75. package/dist/core/telegram/runtime.js +19 -5
  76. package/dist/core/telegram/runtime.js.map +1 -1
  77. package/dist/core/telegram/session_manager.js +18 -7
  78. package/dist/core/telegram/session_manager.js.map +1 -1
  79. package/dist/core/telegram/workspace.js +21 -0
  80. package/dist/core/telegram/workspace.js.map +1 -1
  81. package/dist/core/tools/catalog.js.map +1 -1
  82. package/dist/core/utils/model_notices.js.map +1 -1
  83. package/dist/core/utils/speech_to_text_keywords.js +10 -4
  84. package/dist/core/utils/speech_to_text_keywords.js.map +1 -1
  85. package/dist/core/version.js +2 -2
  86. package/dist/core/version.js.map +1 -1
  87. package/dist/diff_tool/app/dist/assets/{core-D8lOlLN2.js → core-3PFMkRLP.js} +1 -1
  88. package/dist/diff_tool/app/dist/assets/engine-oniguruma-C5P09Ghe.js +1 -0
  89. package/dist/diff_tool/app/dist/assets/{highlights-B80gocb2.js → highlights-Bi-VwGCO.js} +2 -2
  90. package/dist/diff_tool/app/dist/assets/index-DhaXI7F3.js +221 -0
  91. package/dist/diff_tool/app/dist/assets/langs-CDbZNx2R.js +1 -0
  92. package/dist/diff_tool/app/dist/assets/lib-BKZ5ZaMU.js +1 -0
  93. package/dist/diff_tool/app/dist/assets/shiki-BArE1NVK.js +2 -0
  94. package/dist/diff_tool/app/dist/assets/{stream-tokenizer-BkuDYA48.js → stream-tokenizer-DFTZfQ1S.js} +4 -4
  95. package/dist/diff_tool/app/dist/assets/{themes-BaMgiyFz.js → themes-Dzo-2cM5.js} +2 -2
  96. package/dist/diff_tool/app/dist/assets/wasm-4KdTHw0F.js +1 -0
  97. package/dist/diff_tool/app/dist/index.html +2 -2
  98. package/dist/history/worker/index.js +140 -15
  99. package/dist/history/worker/index.js.map +1 -1
  100. package/dist/history/worker/migrations/0002_parent_session.sql +3 -0
  101. package/dist/history/worker/viewer.css +10 -1
  102. package/dist/host/local_session_host.js +134 -75
  103. package/dist/host/local_session_host.js.map +1 -1
  104. package/dist/host/session_bootstrap.js +53 -0
  105. package/dist/host/session_bootstrap.js.map +1 -0
  106. package/dist/host/session_host.js.map +1 -1
  107. package/dist/host/session_protocol_handler.js +9 -1
  108. package/dist/host/session_protocol_handler.js.map +1 -1
  109. package/dist/main.js +48 -95
  110. package/dist/main.js.map +1 -1
  111. package/dist/protocol/environment_variables.d.ts +2 -0
  112. package/dist/protocol/environment_variables.js +7 -0
  113. package/dist/protocol/environment_variables.js.map +1 -0
  114. package/dist/protocol/session_protocol.d.ts +16 -4
  115. package/dist/protocol/session_protocol.js +35 -15
  116. package/dist/protocol/session_protocol.js.map +1 -1
  117. package/dist/sdk/client.js +2 -2
  118. package/dist/sdk/client.js.map +1 -1
  119. package/dist/sdk/local_client.d.ts +6 -2
  120. package/dist/sdk/local_client.js +11 -59
  121. package/dist/sdk/local_client.js.map +1 -1
  122. package/dist/sdk/session.js +4 -3
  123. package/dist/sdk/session.js.map +1 -1
  124. package/dist/sdk/types.d.ts +6 -2
  125. package/dist/store/session_snapshot_migrations.js +19 -1
  126. package/dist/store/session_snapshot_migrations.js.map +1 -1
  127. package/dist/tui/chat_view.js +5 -0
  128. package/dist/tui/chat_view.js.map +1 -1
  129. package/dist/tui/host_diagnostic_relay.js +44 -0
  130. package/dist/tui/host_diagnostic_relay.js.map +1 -0
  131. package/dist/tui/index.js +1 -0
  132. package/dist/tui/index.js.map +1 -1
  133. package/dist/tui/listen_capture.js +7 -9
  134. package/dist/tui/listen_capture.js.map +1 -1
  135. package/dist/tui/session_chat_app.js +2 -2
  136. package/dist/tui/session_chat_app.js.map +1 -1
  137. package/dist/tui/session_chat_controller.js +89 -13
  138. package/dist/tui/session_chat_controller.js.map +1 -1
  139. package/dist/tui/terminal.js +13 -2
  140. package/dist/tui/terminal.js.map +1 -1
  141. package/package.json +9 -9
  142. package/dist/diff_tool/app/dist/assets/index-DSKn9aHV.js +0 -205
  143. package/dist/diff_tool/app/dist/assets/langs-Cb6u03GG.js +0 -1
  144. package/dist/diff_tool/app/dist/assets/lib-BFrBoEqQ.js +0 -9
  145. package/dist/diff_tool/app/dist/assets/shiki-DaptjTao.js +0 -2
  146. package/dist/diff_tool/app/dist/assets/wasm-BnjxR4X6.js +0 -1
@@ -1,6 +1,6 @@
1
1
  # Subagents
2
2
 
3
- Subagents are background agents that the main agent starts and the host supervises. They help when part of the work can run independently or benefits from a separate context. A subagent belongs to its parent session. It is not a session of its own and has no persona file.
3
+ Subagents are background agents that the main agent starts and the host supervises. They help when part of the work can run independently or benefits from a separate context. A subagent belongs to its parent session. It has no saved session of its own and no persona file.
4
4
 
5
5
  ## Background workers
6
6
 
@@ -14,7 +14,7 @@ Whether the agent can start subagents depends on the main persona's tool list. T
14
14
 
15
15
  The main agent starts subagents only when the user or active instructions explicitly ask for delegation. Ask in ordinary language; no special tag is needed. The request itself does not create a subagent: the main agent still has to call `tau.agents.spawn`.
16
16
 
17
- The agent follows this rule itself. Tau checks that a launch is valid, but it does not judge whether the request really asked for delegation.
17
+ The agent follows this rule itself. Tau checks that a launch is valid, but it does not judge whether the request asked for delegation.
18
18
 
19
19
  ## Tools
20
20
 
@@ -26,12 +26,12 @@ A native Tau subagent can receive these tools. [Claude Code subagents](#claude-c
26
26
  - `view_image`
27
27
  - `web`
28
28
  - `history`
29
- - `mcp`, when the host has enabled MCP servers
29
+ - `mcp`, when the session has enabled MCP servers
30
30
  - `models`
31
31
 
32
- A subagent gets each of these that the main persona also has. For example, a main persona with `bash`, `edit`, `history`, and `agents` gives its subagents `bash`, `edit`, and `history`. Names such as `web` and `history` enable the matching capability in the subagent's `code` tool. MCP uses the host's existing connections, whatever the subagent's working directory. There is no separate tool list for subagents.
32
+ A subagent gets each of these that the main persona also has. For example, a main persona with `bash`, `edit`, `history`, and `agents` gives its subagents `bash`, `edit`, and `history`. Names such as `web` and `history` enable the matching capability in the subagent's `code` tool. MCP uses the parent session's servers and connections, whatever the subagent's working directory. There is no separate tool list for subagents.
33
33
 
34
- Every native Tau subagent also gets the built-in `tau_docs` tool, and a persona's `tools` list cannot remove it. Subagents never get `agents`: their `code` tool has no `tau.agents`, and they have no `wait_for_agents`. A subagent cannot start or manage other agents.
34
+ Every native Tau subagent also gets the built-in `tau_docs` tool, and a persona's `tools` list cannot remove it. Subagents never get `agents`: their `code` tool has no `tau.agents`, and they have no `wait_for_agents`.
35
35
 
36
36
  Subagents also never get [client tools](client-tools.md), such as the TUI's tools or a Telegram runner's file delivery tools. Only the main agent uses tools that attached clients offer. See [tools](tools.md) for how tool availability works in general.
37
37
 
@@ -114,7 +114,7 @@ Claude Code loads its user, project, and local settings and discovers its own in
114
114
  | `edit` | Edit |
115
115
  | `web` | WebSearch, WebFetch |
116
116
 
117
- Workers receive no Tau `code` capabilities, host MCP connections, `tau_docs`, or client tools. Nested agents and interactive questions are disabled. Hooks and automatic memory are disabled too. Claude Code discovers its own MCP servers from its normal configuration sources, including project and user configuration on the execution environment. These connections are independent of the parent persona's `mcp` tool selection; Tau does not map or forward its host MCP connections. Managed Claude Code policies still apply.
117
+ Workers receive no Tau `code` capabilities, Tau MCP connections, `tau_docs`, or client tools. Nested agents and interactive questions are disabled. Hooks and automatic memory are disabled too. Claude Code discovers its own MCP servers from its normal configuration sources, including project and user configuration on the execution environment. These connections are independent of the parent persona's `mcp` tool selection and of Tau's `mcpServers` setting, and Tau does not map or forward its own MCP connections. They run on the execution environment, so workers can use them even in a session on a remote execution environment, where Tau's own MCP is unavailable. Managed Claude Code policies still apply.
118
118
 
119
119
  Selected tools use `bypassPermissions`, with Claude Code's sandbox disabled. They run with the execution environment's operating-system authority, like Tau's tools. Review the local Claude settings, skills, and MCP configuration before enabling these workers.
120
120
 
@@ -130,9 +130,7 @@ Claude workers share the eight-worker limit and the usual subagent lifetime. Int
130
130
 
131
131
  `tau.agents.spawn` normally runs the subagent in the main session's `cwd`. The optional `workingDirectory` may be absolute or relative to that `cwd`. Tau resolves it to an absolute path on the execution environment.
132
132
 
133
- For native Tau subagents, when that path differs from the parent's `cwd`, Tau rebuilds the subagent's context for the new directory. It detects the platform and repository there, reads the applicable `AGENTS.md` files, and discovers that directory's skills.
134
-
135
- For native Tau subagents, the new directory does not change the persona, model catalog, runtime configuration, credentials, or tool policy. Those come from the parent session. Configuration in the new directory is read only where context needs it, such as for skill discovery.
133
+ For native Tau subagents, when that path differs from the parent's `cwd`, Tau rebuilds the subagent's context for the new directory. It detects the platform and repository there, reads the applicable `AGENTS.md` files, and discovers that directory's skills. The new directory does not change the persona, model catalog, runtime configuration, credentials, or tool policy. Those come from the parent session. Configuration in the new directory is read only where context needs it, such as for skill discovery.
136
134
 
137
135
  `workingDirectory` is always a path on the execution environment, which matters in monorepos and hosted environments. The host and attached clients never resolve it against their own filesystems.
138
136
 
@@ -201,7 +199,7 @@ The response text of all requested subagents shares a budget of 8,192 estimated
201
199
 
202
200
  Inside a program, `waitUntilIdle` waits for one subagent with the same meaning of idle and returns its state without the response. Neither wait returns until queued input has been handled too. Cancelling a wait, or stopping the program that waits, does not interrupt the subagent.
203
201
 
204
- The host also sends live subagent activity to attached clients for display. It is a summary for display. The subagent's messages and tool results are in its trace.
202
+ The host also sends attached clients a live summary of subagent activity for display. The subagent's messages and tool results are in its trace.
205
203
 
206
204
  ### Send more input
207
205
 
@@ -245,13 +243,15 @@ A failed call throws an error with a `code` and a `message`. The codes are `inva
245
243
 
246
244
  ## Detach, rewind, and recovery
247
245
 
248
- Subagents belong to the running session on the host, not to an attached TUI. Detaching a client, or losing the connection, does not stop them while the session stays alive. Another client can attach to the session and see their current state.
246
+ Subagents belong to the running session on the host, not to an attached TUI. Detaching a client, or losing the connection, does not stop them while the session stays alive. Another client can attach and see their current state.
249
247
 
250
248
  Subagents do not survive the end of a session on the host or a host restart. Their status may be saved while the session is live, but recovery removes those records, because their runtimes no longer exist. A recovered session cannot send input to an old subagent ID.
251
249
 
252
250
  Rewind also removes subagents that were started by an assistant message the rewind removed. A subagent started from a `code` program belongs to the assistant message that ran the program, including a program running as a background job. Host shutdown or session disposal interrupts and removes all subagents.
253
251
 
254
- Plan long work with this in mind. Important results should reach the main agent and end up in the session history or in project files before the session on the host goes away. [Sessions](sessions.md) covers saving and recovery in general.
252
+ Tau records native subagents as child sessions in [history](history.md#native-subagent-sessions), even without the `history` tool. These sessions stay after a rewind, but history cannot restore the subagents. Claude Code is excluded.
253
+
254
+ Important results should reach the main agent and end up in the session history or in project files before the session on the host goes away. [Sessions](sessions.md) covers saving and recovery in general.
255
255
 
256
256
  ## Reloading and validation
257
257
 
@@ -259,6 +259,6 @@ Changes to persona tools or to the launch allowlist apply after `/reload` in an
259
259
 
260
260
  `subagents.launchModels` must be an array of valid `<provider>/<model>:<effort>` strings. Unknown providers, invalid efforts, and malformed entries produce configuration warnings.
261
261
 
262
- A launch can fail because of invalid arguments, a model outside the allowlist, the concurrency limit, a prompt that cannot be built, or a working directory whose context cannot be built. Calls with an unknown subagent ID fail. Sending input also fails under the conditions in [send more input](#send-more-input).
262
+ A launch can fail because of invalid arguments, a model outside the allowlist, the concurrency limit, a prompt that cannot be built, or a working directory whose context cannot be built. Calls with an unknown subagent ID fail.
263
263
 
264
264
  Before starting a local TUI, `tau --debug --persona <id>` shows which tools are available, the model and settings subagents inherit, and the subagents' tool list. In a running session, `/reload` reports file warnings and `tau.agents.list()` shows live subagent state.
@@ -12,7 +12,7 @@ platform_api
12
12
  release2026
13
13
  ```
14
14
 
15
- Every project can have an optional non-empty `description`. Repository and persistent-directory projects can select `persona` as `<id>` or `<id>:<reasoning>`. Composite projects require their own persona. Sessions load applicable `AGENTS.md` instructions.
15
+ Every project can have an optional non-empty `description`. Projects do not select a persona. The bot does that through [startup and presets](telegram.md#startup-and-presets). Sessions load applicable `AGENTS.md` instructions.
16
16
 
17
17
  Each project must define exactly one workspace source: `repo`, `directory`, or `projectIds`.
18
18
 
@@ -26,14 +26,13 @@ A repository project clones one GitHub repository into a session-specific manage
26
26
  "ledger": {
27
27
  "repo": "acme/ledger",
28
28
  "ref": "main",
29
- "workingDirectory": "packages/api",
30
- "persona": "gpt-6.1-sol-coder"
29
+ "workingDirectory": "packages/api"
31
30
  }
32
31
  }
33
32
  }
34
33
  ```
35
34
 
36
- `repo` must be a GitHub `owner/repo`; other Git URLs are not accepted. The runner needs `gh` and `git` on its login shell's `PATH`, and `gh` must already be signed in with access to the repository.
35
+ `repo` must be a GitHub `owner/repo`; other Git URLs are not accepted. The runner needs `gh` and `git` on its login shell's `PATH`, and `gh` must already be signed in with access to the repository. A bot can use its own sign-in through its [environment](#bot-environments).
37
36
 
38
37
  All managed projects use the top-level `workspaceRoot`. A session workspace is:
39
38
 
@@ -65,8 +64,7 @@ A persistent-directory project reuses one existing directory instead of creating
65
64
  {
66
65
  "projects": {
67
66
  "notes": {
68
- "directory": "/srv/tau/notes",
69
- "persona": "gpt-6.1-sol-coder"
67
+ "directory": "/srv/tau/notes"
70
68
  }
71
69
  }
72
70
  }
@@ -91,7 +89,6 @@ A composite project creates a root containing multiple repositories:
91
89
  "api": { "repo": "acme/api", "workingDirectory": "services/http" },
92
90
  "platform": {
93
91
  "projectIds": ["web", "api"],
94
- "persona": "gpt-6.1-sol-coder:high",
95
92
  "instructions": "Keep shared contracts synchronized.",
96
93
  "subagents": {
97
94
  "launchModels": ["openai/gpt-6.1-sol:high"]
@@ -107,7 +104,7 @@ Members are placed at `<composite-root>/<member-project-id>` and use each reposi
107
104
 
108
105
  `subagents.launchModels` sets which models subagents may be started with. See [subagents](subagents.md) for the syntax and inheritance.
109
106
 
110
- The composite's settings apply to the whole session: persona, subagents, model catalog, configuration, and tools. Members' `.tau/config.json` files are not merged. A subagent started in a member directory rebuilds only the context that depends on the directory: environment and repository details, the applicable `AGENTS.md`, and the skills found there.
107
+ Configuration resolved at the composite root applies to the whole session, including the workspace's `defaultPersona`, subagents, model catalog, tools, MCP servers, and speech vocabulary. Members' `.tau/config.json` files are not merged. A subagent started in a member directory rebuilds only the context that depends on the directory: environment and repository details, the applicable `AGENTS.md`, and the skills found there.
111
108
 
112
109
  If any member cannot be prepared, Tau removes the whole composite workspace. Composite workspaces and member caches use the top-level `workspaceRoot`.
113
110
 
@@ -119,6 +116,8 @@ If the expected workspace is missing, recovery reconstructs it from the caches a
119
116
 
120
117
  ## Managed workspace safety
121
118
 
119
+ A project's `.tau/config.json` can define [MCP servers](config-reference.md#mcpservers) that start commands on the runner machine with the runner's credentials, so [review what you prepare](security.md#trust-mcp-servers). A workspace outside the runner user's home does not inherit servers from global configuration.
120
+
122
121
  **Important:** startup removes entries under managed workspace roots that no persisted session references. Dedicate these roots to Tau; never use a home directory, repository collection, or unrelated tree.
123
122
 
124
123
  Tau preserves referenced managed workspaces, configured persistent directories, and repository caches. `/new` closes the active session before replacing it. Closing a repository or composite session interrupts work and removes its workspace; persistent directories remain untouched.
@@ -129,9 +128,63 @@ A repository can include `.tau/scripts/provision` at its root. It must be a regu
129
128
 
130
129
  New and reconstructed workspaces run their hooks; preserved workspaces and persistent-directory projects do not. Composite sessions run member hooks in order and continue after failures. A failure is reported to linked chats but leaves the session usable. Keep hooks repeatable and non-interactive.
131
130
 
131
+ ## Bot environments
132
+
133
+ Bots in one runner can use different environment variables, for example to give each bot its own GitHub account and commit identity. Set `bots.<id>.env` to a map of variable names to string values:
134
+
135
+ ```json
136
+ "env": {
137
+ "GH_CONFIG_DIR": "/var/lib/assistant-github/gh",
138
+ "GIT_CONFIG_GLOBAL": "/var/lib/assistant-github/gitconfig",
139
+ "GH_TOKEN": "",
140
+ "GITHUB_TOKEN": ""
141
+ }
142
+ ```
143
+
144
+ Set up the files this example refers to as the runner's user:
145
+
146
+ 1. Sign in to `gh` in that directory with `GH_CONFIG_DIR=/var/lib/assistant-github/gh gh auth login`.
147
+ 2. Create the Git config file. Git uses it in place of the user's `~/.gitconfig`. Git HTTPS operations need the credential helper, and commits need the identity:
148
+
149
+ ```ini
150
+ [credential "https://github.com"]
151
+ helper =
152
+ helper = !gh auth git-credential
153
+ [user]
154
+ name = Assistant
155
+ email = assistant@example.com
156
+ ```
157
+
158
+ The empty tokens override any token in the runner's environment, which `gh` would otherwise use in place of the signed-in account.
159
+
160
+ The map applies in two places:
161
+
162
+ - **Workspace preparation.** The bot's repository clone and fetch commands run with the runner's environment plus the map. The map wins when both set a variable.
163
+ - **New sessions.** Session tools, provision hooks, and subagents run with the session's usual environment, which has inherited secret-like variables removed, plus the map.
164
+
165
+ The runner's own environment and other bots do not change. The map does not set model-provider credentials or configure client tools.
166
+
167
+ Names and values follow these rules:
168
+
169
+ - Names must match `[A-Za-z_][A-Za-z0-9_]*`.
170
+ - Values cannot contain NUL.
171
+ - `HOME` is not allowed, because the execution environment sets it.
172
+ - Values are literal. Tau does not expand `$HOME` or `~` and does not resolve relative paths, so use absolute paths for credential directories.
173
+
174
+ Tau saves the map in each session, so do not put tokens or other secrets in it. Use paths to separately protected credential stores instead. The map is not a security boundary. Bots still share the operating-system user's permissions and repository caches, and commands can override their own environment.
175
+
176
+ ### Changing a bot's environment
177
+
178
+ Restart the runner after changing or removing `env`. New sessions use the new map. A saved session whose map differs fails recovery before it accepts turns, because it would otherwise continue under the old identity. This check does not change the session's files. A session resumes normally if its map is unchanged, and that includes an older session with no saved map if the bot has no `env`.
179
+
180
+ A session that failed this check has two ways forward:
181
+
182
+ - Restore the previous `env` and restart the runner. The session then resumes.
183
+ - Start a new session with `/new`. For a repository or composite project, this deletes the old workspace, so first save any unfinished work from it on the runner machine. Persistent-directory projects keep their files.
184
+
132
185
  ## Troubleshooting
133
186
 
134
- **Repository preparation fails.** Check that the runner machine has `gh` signed in with access to the repository, `git`, and network access. Check `repo`, `ref`, the workspace root's permissions and free space, and that `workingDirectory` exists after checkout. Changing the repository of an existing project ID rebuilds its cache. Do not delete caches or workspaces first; keep the logs and fix access or configuration.
187
+ **Repository preparation fails.** Check that the runner machine has `gh` signed in with access to the repository, `git`, and network access. If the bot sets `env`, check the sign-in that its [environment](#bot-environments) selects. Check `repo`, `ref`, the workspace root's permissions and free space, and that `workingDirectory` exists after checkout. Changing the repository of an existing project ID rebuilds its cache. Do not delete caches or workspaces first; keep the logs and fix access or configuration.
135
188
 
136
189
  **Startup removed unexpected files.** The workspace root was not dedicated to Tau. Stop the runner and move `workspaceRoot` to an empty directory of its own before restarting. Tau cannot restore unrelated files it deleted.
137
190
 
@@ -139,4 +192,6 @@ New and reconstructed workspaces run their hooks; preserved workspaces and persi
139
192
 
140
193
  **A persistent-directory session fails recovery.** Recovery rejects a saved `cwd` that differs from the configured directory. Restore the directory at its original path, or set the project config back, or start a new session in the new directory. Tau does not move an existing session to a new directory.
141
194
 
142
- **A recovered session does not match the current configuration.** Preserved workspaces are used as they are, and composite root files are not regenerated, so configuration changes apply only to new workspaces. Recovery also needs the same `workspaceRoot`, project definitions, host home, and Tau sessions. Check the runner logs and `/status`. Do not edit runner state, project preferences, saved sessions, or managed workspaces to force a match.
195
+ **A session fails recovery after a bot's `env` changes.** Recovery rejects a saved environment that differs from the bot's current `env`, and `/status` reports the failure. See [changing a bot's environment](#changing-a-bots-environment) for the ways forward.
196
+
197
+ **A recovered session does not match the current configuration.** Preserved workspaces are used as they are, and composite root files are not regenerated, so configuration changes apply only to new workspaces. Recovery also needs the same `workspaceRoot`, project definitions, bot `env`, host home, and Tau sessions. Check the runner logs and `/status`. Do not edit runner state, project preferences, saved sessions, or managed workspaces to force a match.
@@ -14,7 +14,9 @@ tau telegram --config-file /etc/tau/telegram.json
14
14
 
15
15
  The process stays in the foreground until `SIGINT` or `SIGTERM`. Relative `--config-file` paths resolve from the process working directory. Paths inside that file resolve as described below, usually from the config file's directory.
16
16
 
17
- The Telegram file is **not** one of Tau's `config.json` levels. It configures the runner: bot tokens, projects, workspace roots, and routing. Tau still loads normal configuration from the runner's startup directory and from each session's workspace. See [configuration](configuration.md) and [ownership and scope](ownership-and-scope.md).
17
+ Add `--check-config` to validate the file and exit without starting the runner. It does not check tokens, directories, or repository access.
18
+
19
+ The Telegram file is **not** one of Tau's `config.json` levels. It configures the runner: bot tokens, startup settings, presets, projects, workspace roots, and routing. Tau still loads normal configuration from the runner's startup directory and from each session's workspace. See [configuration](configuration.md) and [ownership and scope](ownership-and-scope.md).
18
20
 
19
21
  Run at most one runner per configuration and workspace root. Two runners would compete for Telegram updates, runner state, and workspace cleanup.
20
22
 
@@ -28,6 +30,7 @@ A useful configuration defines at least one bot and one project:
28
30
  "bots": {
29
31
  "engineering": {
30
32
  "botToken": "<telegram-bot-token>",
33
+ "startup": { "source": "workspace" },
31
34
  "allowedProjectIds": ["ledger"],
32
35
  "allowedUserIds": [18422031],
33
36
  "allowedChatIds": [18422031],
@@ -37,8 +40,7 @@ A useful configuration defines at least one bot and one project:
37
40
  "projects": {
38
41
  "ledger": {
39
42
  "repo": "acme/ledger",
40
- "ref": "main",
41
- "persona": "gpt-6.1-sol-coder:high"
43
+ "ref": "main"
42
44
  }
43
45
  }
44
46
  }
@@ -46,7 +48,7 @@ A useful configuration defines at least one bot and one project:
46
48
 
47
49
  The bot token must be written in the file; it cannot come from an environment variable. Protect the file, never commit it, and rotate an exposed token through BotFather. Never print the config into a session or shared log.
48
50
 
49
- Unknown fields are removed, so a misspelled field silently has no effect. The exception is a `personaMenu` entry, where an unknown field makes the config invalid.
51
+ The runner refuses to start if the file contains an unknown field, and the error names that field.
50
52
 
51
53
  ## Top-level fields
52
54
 
@@ -68,9 +70,11 @@ Each `bots.<id>` object supports:
68
70
  | Field | Required | Behavior |
69
71
  | --- | --- | --- |
70
72
  | `botToken` | Yes | Telegram Bot API token. |
73
+ | `env` | No | Environment variables for this bot's workspace preparation and new sessions. See [bot environments](telegram-projects.md#bot-environments). |
71
74
  | `allowedProjectIds` | No | Non-empty unique subset of configured project IDs; omission exposes all projects. |
72
75
  | `autoCompactThresholdTokens` | No | Default automatic-compaction threshold for this bot's sessions. See [compaction thresholds](#compaction-thresholds). |
73
- | `personaMenu` | No | Ordered list of personas offered by `/persona`; omission offers every persona. See [persona menu](#persona-menu). |
76
+ | `startup` | Yes | `{ "source": "workspace" }` or `{ "source": "preset", "preset": "<key>" }`. See [startup and presets](#startup-and-presets). |
77
+ | `presets` | No | Named choices that `/persona` offers. Omission offers all workspace personas, and `{}` offers none. |
74
78
  | `allowedUserIds` | No | Integer user IDs allowed to trigger turns, commands, and callbacks. |
75
79
  | `allowedChatIds` | No | Integer chat IDs allowed to interact with the bot; also opts groups in. |
76
80
  | `defaultProjectId` | No | Initial project preference, and must be allowed for this bot. |
@@ -84,7 +88,7 @@ Use both lists for a private bot. `allowedUserIds` decides who can start work, b
84
88
 
85
89
  A bot sees only its `allowedProjectIds`, or every project if the field is missing. If only one project is allowed, it is selected automatically and the command palette omits `/use_<project>` commands. The command still works when typed directly. Otherwise the palette includes project-switch commands, and a chat needs `defaultProjectId` or a `/use_<project>` choice before `/new`. Each startup replaces the palette, removing switch commands if the bot now has only one available project.
86
90
 
87
- Telegram allows 100 commands per bot: twelve built-ins and up to 88 `/use_<projectId>` commands.
91
+ Telegram allows 100 commands per bot: thirteen built-ins and up to 87 `/use_<projectId>` commands. With `presets: {}`, `/persona` is hidden, which leaves room for one more project command.
88
92
 
89
93
  ## Projects
90
94
 
@@ -94,15 +98,15 @@ Each project tells the runner where a session works. There are three kinds:
94
98
  - A **persistent-directory project** reuses one existing directory for all of its sessions.
95
99
  - A **composite project** combines several repository projects in one workspace.
96
100
 
97
- Project IDs become `/use_<projectId>` commands, so they may contain only lowercase letters, digits, and underscores, and be at most 28 characters. Every project can have a `description`, and must define exactly one of `repo`, `directory`, or `projectIds`. [Telegram projects and workspaces](telegram-projects.md) describes each kind, where workspaces live, provision hooks, and what happens to workspaces on restart.
101
+ [Telegram projects and workspaces](telegram-projects.md) describes project fields, workspace preparation, provision hooks, and recovery.
98
102
 
99
103
  **Important:** at startup, the runner deletes everything under its managed workspace roots that no saved session uses. Give Tau a dedicated `workspaceRoot`; never use a home directory, a collection of repositories, or any directory with other content.
100
104
 
101
105
  ## Normal Tau configuration inside workspaces
102
106
 
103
- After preparation, Tau creates an ordinary local session in the workspace. It reads `~/.config/tau` and the `.tau` directories above the workspace as usual, so personas, prompts, skills, project context, host tools, and other settings work as in the TUI.
107
+ After preparation, Tau creates an ordinary local session in the workspace. It reads `~/.config/tau` and the `.tau` directories above the workspace as usual, so personas, prompts, skills, project context, host tools, [MCP servers](config-reference.md#mcpservers), and other settings work as in the TUI.
104
108
 
105
- A project's `persona` replaces the default for its sessions. Composite sessions use the generated root files and their required persona.
109
+ The bot's `startup` selects a new session's settings, as described in [startup and presets](#startup-and-presets).
106
110
 
107
111
  Every Telegram turn starts with a hidden `<system>` block saying the message comes from Telegram and the reply goes there. It asks for direct answers to simple questions, and for short acknowledgements or useful progress updates during longer work, because users cannot see tool activity.
108
112
 
@@ -125,7 +129,7 @@ The runner loads its speech credentials and `speech.voiceId` at startup, from it
125
129
  | `/use_<projectId>` | Selects the project for future `/new` sessions. |
126
130
  | `/new` | Replaces the active session using the preferred project. |
127
131
  | `/status` | Reports session state, project, model, reasoning, context usage, and cost. |
128
- | `/persona` | Switches persona while idle without losing history or starting a turn. |
132
+ | `/persona` | Applies a persona or preset from a menu while idle, without losing history or starting a turn. |
129
133
  | `/effort_low` | Selects low reasoning for future turns. |
130
134
  | `/effort_medium` | Selects medium reasoning for future turns. |
131
135
  | `/effort_high` | Selects high reasoning for future turns. |
@@ -137,9 +141,9 @@ The runner loads its speech credentials and `speech.voiceId` at startup, from it
137
141
  | `/tts_on` | Sends a voice note after each final assistant response. |
138
142
  | `/tts_off` | Disables voice responses. |
139
143
 
140
- Changes to the auto-compaction threshold apply from the next turn and survive session recovery. Switching to a different persona removes the override. `/status` shows context usage as a percentage of the full model window. When a session override is set, or the default threshold is below the model-based threshold, it also shows the effective threshold in parentheses. See [compaction thresholds](#compaction-thresholds) for bot defaults and [automatic compaction](sessions.md#automatic-compaction) for limits and costs.
144
+ Changes to the auto-compaction threshold apply from the next turn and survive session recovery. `/status` shows context usage as a percentage of the full model window. When a session override is set, or the default threshold is below the model-based threshold, it also shows the effective threshold in parentheses. See [compaction thresholds](#compaction-thresholds) for bot defaults and [automatic compaction](sessions.md#automatic-compaction) for limits and costs.
141
145
 
142
- A [persona](personas.md) choice applies to the current session only; `/new` uses the project's default.
146
+ A [persona](personas.md) or preset choice applies to the current session only. `/new` starts from the bot's `startup`.
143
147
 
144
148
  Preferences are saved per bot and chat, and survive restarts and new sessions. A project change applies at the next `/new`, not to the current session.
145
149
 
@@ -153,43 +157,58 @@ In groups, commands must explicitly mention the bot. Accepted forms include:
153
157
 
154
158
  Commands addressed to other bots are ignored.
155
159
 
156
- ### Persona menu
160
+ ## Startup and presets
161
+
162
+ `startup` decides how a bot's new sessions start, and `presets` decides what `/persona` offers. `startup` does not add a menu entry.
157
163
 
158
- By default, `/persona` offers every persona in the session. A bot's `personaMenu` replaces that list with the personas you name, in the order you list them, and can give each one a shorter label:
164
+ `startup` is required. `{ "source": "workspace" }` uses the workspace's `defaultPersona`, found through the same configuration layers as the TUI, including any effort suffix. To start with a named preset instead:
159
165
 
160
166
  ```json
161
- "personaMenu": [
162
- { "id": "gpt-6.1-sol-coder", "label": "sol" },
163
- { "id": "sonnet-5.5-coder", "autoCompactThresholdTokens": 150000 }
164
- ]
167
+ "startup": { "source": "preset", "preset": "astra" },
168
+ "presets": {
169
+ "workspace": { "source": "workspace", "label": "Workspace default" },
170
+ "astra": {
171
+ "source": "persona",
172
+ "label": "Astra",
173
+ "persona": "gpt-6-astra-chat",
174
+ "reasoning": "low",
175
+ "autoCompactThresholdTokens": 120000
176
+ }
177
+ }
165
178
  ```
166
179
 
167
- Each entry has a required `id`, the exact persona ID, an optional `label`, and an optional `autoCompactThresholdTokens` (see [compaction thresholds](#compaction-thresholds)). The ID and label must be non-empty after surrounding whitespace is trimmed, IDs must be unique, and no other fields are allowed. Without a label, the picker shows the persona's own label, or its ID if it has none. The label appears in the picker and in the switch confirmation. It changes nothing else, so the persona keeps its ID, prompt, model, tools, and reasoning settings, and the TUI still shows its normal name.
180
+ `startup.preset` must name a key in `presets`. There are two kinds of preset:
168
181
 
169
- The menu is matched against each session's personas when `/persona` runs, because different projects can define different personas. Listed personas that the session lacks are named in the picker message, and the rest of the menu still works. An empty list, `[]`, offers no personas.
182
+ - A `workspace` preset resolves the workspace's `defaultPersona` each time it is applied.
183
+ - A `persona` preset names a persona ID without an effort suffix. Its optional `reasoning` is one of `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`, and defaults to the persona's own setting. Its optional `autoCompactThresholdTokens` is [described below](#compaction-thresholds).
170
184
 
171
- Apart from compaction thresholds, the menu only changes what the picker offers. It does not restrict which personas a session may use, and it does not change default personas. A project's `persona` still applies to new sessions even if the menu omits it. When the session's current persona is not in the menu, the picker message names it, but it is not added as a choice.
185
+ Every preset needs a non-empty `label`. Keys must be non-empty, without surrounding whitespace.
172
186
 
173
- ### Compaction thresholds
187
+ The `/persona` menu depends on `presets`:
174
188
 
175
- A bot can set default [automatic-compaction](sessions.md#automatic-compaction) thresholds for its sessions. Both fields take a safe integer of at least 50,000 tokens:
189
+ - Omitted: all personas available in the session's workspace, with their own labels and default settings.
190
+ - `{}`: nothing, and `/persona` is hidden from the command palette. Typing it replies that no presets are configured.
191
+ - With entries: exactly those entries, in the object's order. Integer-like keys sort first, so use non-numeric keys to keep the order you wrote.
176
192
 
177
- ```json
178
- "engineering": {
179
- "botToken": "<telegram-bot-token>",
180
- "autoCompactThresholdTokens": 200000,
181
- "personaMenu": [
182
- { "id": "gpt-6.1-sol-coder", "autoCompactThresholdTokens": 120000 },
183
- { "id": "sonnet-5.5-coder" }
184
- ]
185
- }
186
- ```
193
+ Buttons show only labels, because a session does not record which preset was applied. `/status` reports the session's actual settings.
194
+
195
+ Applying a preset changes the prompt, model, tools, reasoning, and other persona settings together, and keeps the conversation. It applies them once, so effort commands then change only reasoning, and applying the preset again restores its settings.
196
+
197
+ An unavailable persona stays in the menu. Applying it, or a `reasoning` value the persona does not support, reports an error and changes no settings. The value must be in the persona's `allowedReasoningLevels` when that list is non-empty, and a model without reasoning accepts only `none`. A failing preset at `startup` fails the new session.
198
+
199
+ A workspace selection works as in the TUI: an unavailable `defaultPersona` falls back to the first available persona, and its effort suffix skips these checks.
200
+
201
+ Restart the runner after editing `startup` or `presets`. Recovery keeps a session's saved settings and does not reapply them. Reload keeps the session's settings if its persona still exists.
202
+
203
+ ## Compaction thresholds
204
+
205
+ A bot's optional `autoCompactThresholdTokens` sets a default for its sessions. A persona preset's optional field of the same name sets a saved session override when the preset is applied, including at startup. Both take a safe integer of at least 50,000 tokens.
187
206
 
188
- A session uses the first threshold that is set: its `/auto_compact` override, the `personaMenu` entry whose `id` exactly matches the current persona, the bot's `autoCompactThresholdTokens`, the persona's own `autoCompactThresholdTokens`, and finally the model's context window minus 16,384 tokens. Every threshold is capped at that model-based limit. In this example, a session using `gpt-6.1-sol-coder` compacts at 120,000 tokens, and a session using any other persona compacts at 200,000 tokens. A menu entry's threshold applies whenever the session uses that persona, including through the project's default `persona`.
207
+ A session uses its saved override first, then the bot default, the persona default, and finally the model's context window minus 16,384 tokens. The effective threshold is capped at that model-based limit. `/auto_compact` changes the saved override. Applying a persona or preset clears the previous override unless the preset sets a threshold, even when the persona stays the same.
189
208
 
190
- These defaults are not saved with the session. The runner reads them at startup, so restart the runner after changing them. Recovered sessions then use the new defaults, and keep any `/auto_compact` override they had.
209
+ The runner reads the bot default at startup and does not save it with the session. Recovered sessions use the current bot default and keep their saved override.
191
210
 
192
- Native subagents launched without a model use the session's effective threshold, as described in [subagents](subagents.md#automatic-compaction). Ephemeral threads use the persona's own default and ignore the bot's thresholds.
211
+ Native subagents launched without a model use the session's effective threshold, as described in [subagents](subagents.md#automatic-compaction). Ephemeral threads use the persona's own default and ignore both the bot default and the session override.
193
212
 
194
213
  ## DMs, groups, and active work
195
214
 
@@ -197,7 +216,7 @@ In a DM, ordinary text goes to the active session. If none is selected but the c
197
216
 
198
217
  In an allowed group, a message starts a turn only when it mentions the bot's username. Other text and captions are kept as background context, labeled with their sender. At the next mention, Tau includes up to the 50 most recent kept messages since the last turn, and clears them once the turn is submitted.
199
218
 
200
- Group context can include attachment paths, audio transcripts, and processing errors. The model receives it as untrusted input. `allowedUserIds` stops an unlisted sender from starting work, but their messages can still become context in an allowed group.
219
+ Group context can include attachment paths, audio transcripts, and processing errors. The model receives it as untrusted input.
201
220
 
202
221
  Text and transcribed audio either start or steer a turn. When the session is idle, the message starts a normal turn. When Tau is working, the message steers the running turn: the turn stops at its next safe point and continues with the new message. Further steering is batched as usual. Telegram has no command to queue a separate turn. Use `/interrupt` to stop instead of steering.
203
222
 
@@ -213,7 +232,7 @@ Sending a file only queues it, and its caption is kept as metadata. The next tex
213
232
 
214
233
  Files are stored in the execution environment's temporary directory, so system cleanup can remove them. Queued files and group context are cleared on shutdown. Treat file contents and metadata as untrusted.
215
234
 
216
- Voice transcription uses Gemini with `GEMINI_API_KEY`, or else `apiKeys.google`. Optional spelling hints use GPT-6 Luna (reasoning disabled) with OpenAI credentials. The runner's [`speech.vocabulary`](config-reference.md#speech) terms precede extracted hints and work without OpenAI credentials or conversation context. Gemini transcribes verbatim with `gemini-3.5-transcribe`, using English (`en-US`) and Finnish (`fi-FI`) hints, and Tau tries to delete the uploaded file afterward. Receiving files needs no Google key. See [credentials](credentials.md).
235
+ Voice transcription uses Gemini with `GEMINI_API_KEY`, or else `apiKeys.google`. Optional spelling hints use GPT-6 Luna (reasoning disabled) with OpenAI credentials. The session's [`speech.vocabulary`](config-reference.md#speech) terms, then the runner's global terms, precede extracted hints and work without OpenAI credentials or conversation context. Without a selected session, Tau does not download or transcribe audio. Transcription fails if the session is not ready. Gemini transcribes verbatim with `gemini-3.5-transcribe`, using English (`en-US`) and Finnish (`fi-FI`) hints, and Tau tries to delete the uploaded file afterward. Receiving files needs no Google key. See [credentials](credentials.md).
217
236
 
218
237
  `/tts_on` rewrites text with `gpt-6-luna` (reasoning disabled) and generates speech with Eleven v4 Turbo. It requires both OpenAI and ElevenLabs credentials and runner `ffmpeg` with Opus. Voice notes use brisk delivery and 1.15× speed. See [`speech` configuration](config-reference.md#speech) for default and custom voice selection. Source and rewritten text are limited to 10,000 Unicode characters each, and audio to 32 MiB. Rewriting times out after one minute and the whole job after five. Jobs are not saved. On failure, the bot sends `voice response failed. please try again.`; the text reply is unaffected and details go to the logs.
219
238
 
@@ -237,7 +256,7 @@ If a failed session still has submitted work with an unknown result, Tau can rec
237
256
 
238
257
  ## Verify a runner safely
239
258
 
240
- 1. Check that the Telegram file is valid JSON, without showing it in a shared terminal.
259
+ 1. Run `--check-config`, without showing the file in a shared terminal.
241
260
  2. Confirm the runner user can execute `tau`, `git`, and `gh`, and that `gh` can access each repository.
242
261
  3. Start the runner and watch for config, polling, command-sync, cache, checkout, and recovery errors. Successful startup prints `tau telegram running`.
243
262
  4. In an allowed DM, run `/status`, select a project if needed, then run `/new`.
@@ -250,7 +269,7 @@ Do not verify bot tokens, provider keys, Access secrets, transcript contents, or
250
269
 
251
270
  ## Troubleshooting
252
271
 
253
- **The runner rejects its config.** Startup errors name every invalid bot or project field. Check the required `bots` and `projects` objects, exact project IDs, positive numbers, allowed project IDs, persona suffixes, `personaMenu` entries, and that each project defines exactly one of `repo`, `directory`, or `projectIds`. Check the JSON syntax without printing the file, which contains bot tokens, and restart the runner after fixing it. Relative paths in the file resolve from its directory.
272
+ **The runner rejects its config.** Startup errors name every invalid bot or project field. Check the required `bots` and `projects` objects, exact project IDs, positive numbers, allowed project IDs, startup sources, preset references, and that each project defines exactly one of `repo`, `directory`, or `projectIds`. Check the JSON syntax without printing the file, which contains bot tokens, and restart the runner after fixing it. Relative paths in the file resolve from its directory.
254
273
 
255
274
  **The bot ignores a DM.** If `allowedChatIds` is set, the DM's chat ID must be listed. If `allowedUserIds` is set, the sender's user ID must be listed too.
256
275
 
@@ -262,7 +281,7 @@ Do not verify bot tokens, provider keys, Access secrets, transcript contents, or
262
281
 
263
282
  **Audio or an attachment fails.** The reply or runner log names the step that failed: download, saving, format, or transcription. Check that Telegram can deliver the file to the bot, the type is supported, the runner can write to its temporary directory, and Gemini accepts the media type. Transcription needs `GEMINI_API_KEY` or `apiKeys.google` for the runner process; restart the runner after setting it. Changing a workspace's environment does not affect the runner. Do not log media or transcripts to debug this.
264
283
 
265
- **Voice replies fail.** `/tts_on` needs OpenAI and ElevenLabs credentials and `ffmpeg` with Opus on the runner. Check [`speech.voiceId`](config-reference.md#speech) if a configured voice is unavailable. The bot replies `voice response failed. please try again.` and logs the details; the text reply is still delivered.
284
+ **Voice replies fail.** `/tts_on` needs OpenAI and ElevenLabs credentials and `ffmpeg` with Opus on the runner. Check [`speech.voiceId`](config-reference.md#speech) if a configured voice is unavailable.
266
285
 
267
286
  **Replies or notifications arrive late or not at all.** Each outgoing message part has a deadline and is retried twice on retryable errors. Tau honors Telegram's `retry_after`, and later notifications in a chat wait for earlier ones. Long replies are split, so only a later part may have failed. The runner log shows the method, status, retry class, attempt, chat, session, and message. Fix network, rate-limit, token, or chat permission problems on the runner. Before resending by hand, check which parts arrived. A delivery failure is not a failed turn, and notifications about failed or blocked turns are sent again after a restart. Never fix delivery by editing runner state.
268
287
 
@@ -61,10 +61,11 @@ Run `tau --debug` from the intended directory for a new local startup. For a run
61
61
  | Change | How to apply |
62
62
  | --- | --- |
63
63
  | Session configuration and content | `/reload` while idle |
64
- | Theme, speech, or TUI client tools | Restart `tau` or `tau attach` |
64
+ | MCP server definitions | Start a new session, or reopen the session after the host has unloaded it |
65
+ | Theme, voice, recording shortcut, personal speech vocabulary, or TUI client tools | Restart `tau` or `tau attach` |
65
66
  | Host environment, `apiKeys`, history, hosted environments, listener, or Tau version | Restart the host |
66
67
  | Default persona or execution environment | Create a new session if it must change |
67
- | Telegram config, routing, speech, or workspaces | Restart the runner |
68
+ | Telegram config, routing, voice, personal speech vocabulary, or workspaces | Restart the runner |
68
69
 
69
70
  ## `/reload` is unavailable, refused, or not enough
70
71
 
@@ -73,7 +74,8 @@ Run `tau --debug` from the intended directory for a new local startup. For a run
73
74
  Reload updates configuration, personas, prompts, skills, `AGENTS.md` context, and host tools for later turns. It does not:
74
75
 
75
76
  - change the execution environment, its `cwd`, or its home;
76
- - reload an attached client's themes, speech settings, or tools;
77
+ - change the session's MCP servers;
78
+ - reload an attached client's themes, voice, recording shortcut, personal speech vocabulary, or tools;
77
79
  - read environment variables again in a running process;
78
80
  - reload the host's history service or hosted environment settings;
79
81
  - update Tau's code or built-in documentation; or
@@ -200,6 +202,8 @@ If attachment reports an unsupported protocol version or an invalid message, upg
200
202
 
201
203
  For `tau attach --new`, `--cwd` must be an absolute path inside the chosen execution environment. With the default local kind, it is a path on the host, not on the attaching machine. Tau does not create the directory, clone a repository, or detect repository attributes.
202
204
 
205
+ Creating a session also fails if Tau cannot read the hostname from the execution environment, for example because `node` is missing there or the target does not respond in time. The error gives the reason and any output from the failed command. Over the session protocol, these details are in the error's `data.cause`.
206
+
203
207
  For a Fly Sprite session, check on the host that:
204
208
 
205
209
  - `flySprites` is set in the host's startup configuration;
@@ -27,7 +27,9 @@ printf 'summarize the current changes' | tau
27
27
 
28
28
  Use `tau attach` for a session hosted elsewhere. The terminal, themes, clipboard, speech commands, built-in diff review tool, and command client tools stay on the attaching machine. Bash tools, file access, project configuration, and model calls use the session's execution environment. See [remote sessions](remote-sessions.md) for connecting and creating sessions.
29
29
 
30
- The startup summary lists discovered skills, project context files, configured client tools, and enabled MCP servers. MCP servers are shown as configured, not connected, because connections open on first use. In attached sessions, the MCP list comes from the host. Empty sections are left out.
30
+ The startup summary lists discovered skills, project context files, configured client tools, and enabled MCP servers. MCP servers are shown as configured, not connected, because connections open on first use. The MCP list comes from the session, also in attached sessions, and a session on a remote execution environment shows MCP as unavailable. Empty sections are left out.
31
+
32
+ In a local TUI, configuration problems found when the host loads a session appear in the transcript. An attached TUI shows them when you run `/reload`.
31
33
 
32
34
  ## Work in the editor
33
35
 
@@ -106,7 +108,7 @@ Then use Shift+Tab to choose a reasoning level. A newly added persona appears on
106
108
 
107
109
  Run commands that change the context, such as persona changes, compaction, rewind, and reload, while idle. `/auto-compact` can inspect or change the next-turn threshold during a running turn. `/auto-speak`, `/listen`, `/prompt:<id>`, and `/exit` do little during a running turn. Other commands wait until Tau is idle.
108
110
 
109
- The footer shows context usage as a percentage of the full model window, such as `20%/272k`. When a session override is set, or the default threshold is below the model-based threshold, the effective compaction threshold appears in parentheses: `20%/272k (50k)`. This threshold cannot exceed the model's context window minus 16,384 tokens. Without an override or a lower default, the footer shows no threshold. Switching to a different persona removes the session override.
111
+ The footer shows context usage as a percentage of the full model window, such as `20%/272k`. When a session override is set, or the default threshold is below the model-based threshold, the effective compaction threshold appears in parentheses: `20%/272k (50k)`. This threshold cannot exceed the model's context window minus 16,384 tokens. Without an override or a lower default, the footer shows no threshold. Applying a persona removes the session override, even when reapplying the current persona.
110
112
 
111
113
  While subagents are running, a panel above the editor shows the selected subagent's title, recent activity, and a usage line such as `openai-codex/gpt-6-astra:medium · ↑12k ↓2k (r8k w0) · 14%/200k · $0.04`. The line starts with the subagent's provider, model, and reasoning effort, including settings inherited from the persona. Text that does not fit the terminal width is cut off on the right.
112
114
 
@@ -238,7 +240,7 @@ A submitted draft that contains dictation carries hidden guidance saying that so
238
240
 
239
241
  The editor is locked from the start of recording until finalization. Escape cancels voice input at any stage: startup, recording, microphone shutdown, transcription, or retry. Cancelling removes the preview at once, restores the original draft, and unlocks the editor without inserting or submitting anything. The cancelled recording is deleted once pending file work finishes. A failure also restores the original draft. A recording or retry cannot start while another editor update is pending.
240
242
 
241
- For live transcription, GPT-6 Luna, with reasoning disabled, extracts spelling hints from the recent conversation while recording starts. Tau buffers audio until the transcription session is ready, then streams it. Gemini uses `gemini-3.5-transcribe-live` in verbatim mode with English (`en-US`) and Finnish (`fi-FI`) language hints. Missing OpenAI credentials or a failed hint extraction do not stop transcription. Configured [`speech.vocabulary`](config-reference.md#speech) terms take priority over extracted hints and remain available when extraction fails.
243
+ For live transcription, GPT-6 Luna, with reasoning disabled, extracts spelling hints from the recent conversation while recording starts. Tau buffers audio until the transcription session is ready, then streams it. Gemini uses `gemini-3.5-transcribe-live` in verbatim mode with English (`en-US`) and Finnish (`fi-FI`) language hints. Missing OpenAI credentials or a failed hint extraction do not stop transcription. The session's [`speech.vocabulary`](config-reference.md#speech) terms, followed by the terms in the TUI's own global configuration, take priority over extracted hints and remain available when extraction fails.
242
244
 
243
245
  If transcription fails, Tau keeps the local WAV file and reports its path:
244
246
 
@@ -277,11 +279,28 @@ See [`speech` configuration](config-reference.md#speech) for the default Maisie
277
279
  - Escape stops playback without turning the mode off.
278
280
  - It uses the same voice, credentials, and rewriting as `/speak`. It never opens the microphone or submits dictation.
279
281
 
282
+ ## See session status in your terminal
283
+
284
+ The TUI reports the session's status to the terminal through the [Program Status Protocol (OSC 7501)](https://www.superlogical.com/rex/docs/build/program-status). A terminal such as Rex can use these reports to show which of your sessions need attention. Local and attached sessions report in the same way, and the report always comes from the TUI on your machine.
285
+
286
+ | Status | Meaning |
287
+ | --------- | ----------------------------------------------------------- |
288
+ | `working` | A turn is running, including any tools it uses. |
289
+ | `done` | The last turn finished successfully. |
290
+ | `error` | The last turn failed or was blocked. |
291
+ | `idle` | The session is waiting for input, or you canceled the turn. |
292
+
293
+ `done` and `error` stay until the next turn starts. When you start the TUI, attach, or switch sessions, Tau reports only `working` or `idle`, so a turn that finished earlier appears as `idle`. Tau clears the status when you leave a session or exit.
294
+
295
+ Each report contains only the status and `app=tau`. It never includes messages or other session content, and nothing is sent when the TUI's output is not a terminal. Tau reports only the main session, and it does not use the protocol's `blocked` state, even while a diff review waits for you.
296
+
297
+ Terminals without support show nothing. Set `PI_PROGRAM_STATUS=0` on the TUI machine to turn reports off, or `PI_PROGRAM_STATUS=1` to send them without waiting for the terminal to confirm support.
298
+
280
299
  ## Reload the right component
281
300
 
282
- Run `/reload` while idle after changing configuration, personas, prompts, skills, or `AGENTS.md` content in the execution environment. The host reads them again from the session's working directory, keeps the current persona if it still exists, and otherwise selects the first available persona. Warnings appear in the transcript.
301
+ Run `/reload` while idle after changing configuration, personas, prompts, skills, or `AGENTS.md` content in the execution environment. The host reads them again from the session's working directory, keeps the current persona if it still exists, and otherwise selects the first available persona. Warnings appear in the transcript. This also refreshes the session's speech vocabulary. MCP server definitions do not change on reload; a warning tells you when they differ, and [the configuration reference](config-reference.md#mcpservers) explains how to apply them.
283
302
 
284
- Restart the TUI instead after changing themes, speech settings, or configured client tools. Codex auth storage is read again on every new request. Restart the host after changing its Tau version, environment variables, `apiKeys`, WebSocket listener, or hosted execution environment settings. [Credentials](credentials.md) and [remote sessions](remote-sessions.md) explain which process owns what.
303
+ Restart the TUI instead after changing themes, voice, recording shortcut, personal speech vocabulary, or configured client tools. Codex auth storage is read again on every new request. Restart the host after changing its Tau version, environment variables, `apiKeys`, WebSocket listener, or hosted execution environment settings. [Credentials](credentials.md) and [remote sessions](remote-sessions.md) explain which process owns what.
285
304
 
286
305
  ## Common mistakes
287
306
 
@@ -64,13 +64,17 @@ export class AgentSupervisor {
64
64
  }
65
65
  const id = randomUUID();
66
66
  const runtimeConfig = { ...options.runtimeConfig, workingDirectory };
67
+ const createdAt = this.deps.clock.now();
68
+ const openHistory = this.options.openHistory;
67
69
  const runtime = createSubagentRuntime(runtimeConfig, {
68
70
  ...options,
69
71
  id,
70
72
  deps: this.deps,
73
+ openHistory: openHistory
74
+ ? () => openHistory({ sessionId: id, workingDirectory, createdAt })
75
+ : undefined,
71
76
  onEvent: async (event) => await this.recordRuntimeEvent(id, event),
72
77
  });
73
- const createdAt = this.deps.clock.now();
74
78
  const record = {
75
79
  id,
76
80
  title: options.title,