@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.
Files changed (50) hide show
  1. package/README.md +18 -23
  2. package/dist/core/history/migrations.js +40 -0
  3. package/dist/core/history/migrations.js.map +1 -1
  4. package/dist/core/history/setup.js +24 -7
  5. package/dist/core/history/setup.js.map +1 -1
  6. package/dist/core/mcp/cli.js +1 -1
  7. package/dist/core/mcp/cli.js.map +1 -1
  8. package/dist/core/static/tau_docs/client-tools.md +46 -385
  9. package/dist/core/static/tau_docs/code-mode.md +104 -43
  10. package/dist/core/static/tau_docs/configuration.md +77 -171
  11. package/dist/core/static/tau_docs/getting-started.md +25 -96
  12. package/dist/core/static/tau_docs/history.md +30 -228
  13. package/dist/core/static/tau_docs/how-tau-works.md +53 -0
  14. package/dist/core/static/tau_docs/image-generation.md +15 -107
  15. package/dist/core/static/tau_docs/index.md +46 -46
  16. package/dist/core/static/tau_docs/instructions-and-skills.md +81 -0
  17. package/dist/core/static/tau_docs/manifest.json +15 -21
  18. package/dist/core/static/tau_docs/mcp.md +77 -0
  19. package/dist/core/static/tau_docs/models-and-credentials.md +67 -0
  20. package/dist/core/static/tau_docs/openrouter.md +31 -129
  21. package/dist/core/static/tau_docs/pdf-unpacking.md +8 -21
  22. package/dist/core/static/tau_docs/personas.md +48 -144
  23. package/dist/core/static/tau_docs/remote-sessions.md +33 -170
  24. package/dist/core/static/tau_docs/sdk.md +150 -0
  25. package/dist/core/static/tau_docs/security.md +6 -193
  26. package/dist/core/static/tau_docs/session-protocol.md +84 -246
  27. package/dist/core/static/tau_docs/sessions.md +41 -205
  28. package/dist/core/static/tau_docs/speech-generation.md +16 -129
  29. package/dist/core/static/tau_docs/subagents.md +57 -229
  30. package/dist/core/static/tau_docs/telegram.md +152 -192
  31. package/dist/core/static/tau_docs/tools.md +44 -167
  32. package/dist/core/static/tau_docs/troubleshooting.md +23 -217
  33. package/dist/core/static/tau_docs/tui.md +42 -282
  34. package/dist/core/version.js +1 -1
  35. package/dist/history/worker/index.js +16 -22
  36. package/dist/history/worker/index.js.map +1 -1
  37. package/dist/history/worker/migrations/0005_external_content.sql +58 -0
  38. package/dist/history/worker/migrations/0006_external_content_cutover.sql +44 -0
  39. package/package.json +2 -2
  40. package/dist/core/static/tau_docs/config-reference.md +0 -367
  41. package/dist/core/static/tau_docs/credentials.md +0 -165
  42. package/dist/core/static/tau_docs/models.md +0 -57
  43. package/dist/core/static/tau_docs/node-sdk.md +0 -430
  44. package/dist/core/static/tau_docs/ownership-and-scope.md +0 -107
  45. package/dist/core/static/tau_docs/prompts-and-project-context.md +0 -147
  46. package/dist/core/static/tau_docs/sdk-diff-review.md +0 -92
  47. package/dist/core/static/tau_docs/session-protocol-methods.md +0 -655
  48. package/dist/core/static/tau_docs/skills.md +0 -135
  49. package/dist/core/static/tau_docs/telegram-commands.md +0 -55
  50. package/dist/core/static/tau_docs/telegram-projects.md +0 -197
@@ -1,143 +1,72 @@
1
1
  # Getting started
2
2
 
3
- Tau is a terminal chat client that gives AI agents tools for working in a project. The quickest way to learn it is a local session, where the terminal client, the session host, and the agent's execution environment all run on your machine. Remote sessions use the same three parts on different machines.
3
+ Tau is a terminal AI client that gives an agent tools for working in a project. It runs on macOS and Linux and requires Node.js 24 or newer.
4
4
 
5
- ## Requirements
6
-
7
- Tau supports macOS and Linux. Windows is not supported.
8
-
9
- The published package requires Node.js 24 or newer. Tau runs every command in a fresh non-interactive login Bash process. Before installing, check that environment from the account that will run Tau:
10
-
11
- ```sh
12
- bash -lc 'command -v node && node --version && command -v npm && npm --version'
13
- ```
14
-
15
- The command should find both executables and finish without prompts, terminal errors, or extra startup output. Use the same check for any other executable you expect the agent to use.
16
-
17
- ## Install or upgrade Tau
18
-
19
- Install the latest published version globally:
5
+ ## Install
20
6
 
21
7
  ```sh
22
8
  npm install -g @markusylisiurunen/tau@latest
23
9
  ```
24
10
 
25
- Run the same command to upgrade. Then check which executable and version npm installed:
11
+ Run the same command to upgrade.
26
12
 
27
- ```sh
28
- command -v tau
29
- npm list -g @markusylisiurunen/tau --depth=0
30
- ```
13
+ ## Connect a provider
31
14
 
32
- The built-in documentation is part of the package, so upgrading Tau also upgrades the documentation its agent reads. Tau also refreshes compatible model metadata in the background when a host that runs models starts. To refresh it without upgrading Tau, run:
33
-
34
- ```sh
35
- tau models refresh
36
- ```
37
-
38
- ## Set up a provider
39
-
40
- A session needs credentials for the provider that its persona uses. Providers that use API keys read their usual environment variables. For example:
15
+ Export the API key of the provider you want to use:
41
16
 
42
17
  ```sh
43
18
  export ANTHROPIC_API_KEY='sk-ant-...'
44
- tau
45
19
  ```
46
20
 
47
- Common choices are `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and `GEMINI_API_KEY`. You can also put keys in `apiKeys` in Tau configuration:
21
+ `OPENAI_API_KEY` and `GEMINI_API_KEY` work the same way. To use a ChatGPT subscription instead, run `tau auth login codex` and start Tau with a ChatGPT persona: `tau --persona gpt-6.1-sol-chatgpt-coder`. See [models and credentials](models-and-credentials.md).
48
22
 
49
- ```json
50
- {
51
- "apiKeys": {
52
- "anthropic": "sk-ant-..."
53
- }
54
- }
55
- ```
56
-
57
- Put personal secrets in the global config at `~/.config/tau/config.json`. A project file is likely to be committed. [Credentials](credentials.md) covers environment variables and which key wins for each feature.
58
-
59
- The `openai-codex` provider signs in with a ChatGPT subscription through OAuth. It does not use `OPENAI_API_KEY` or `apiKeys.openai`:
23
+ ## Run a session
60
24
 
61
25
  ```sh
62
- tau auth login codex
63
- tau auth list
64
- ```
65
-
66
- Manage this storage with the auth commands. Do not edit `~/.config/tau/auth.json` directly.
67
-
68
- ## Start a local session
69
-
70
- Change to the project directory you want the agent to work in, then run Tau:
71
-
72
- ```sh
73
- cd ~/Code/ledger-service
26
+ cd ~/Code/my-project
74
27
  tau
75
28
  ```
76
29
 
77
- Tau finds project configuration and content from that directory upward, loads the selected persona, creates a local session that is saved automatically, and opens the TUI. The agent's file and command tools start in this directory.
78
-
79
- Type a request and press Enter. Good first requests are concrete and limited in scope:
30
+ Type a request and press Enter:
80
31
 
81
32
  ```text
82
- Explain the request flow through this service and point to the key files.
33
+ Run the parser tests, fix the failure, and summarize the change.
83
34
  ```
84
35
 
85
- ```text
86
- Run the focused tests for the parser, fix the failure, and summarize the change.
87
- ```
88
-
89
- Use `/help` inside the TUI to see interactive commands. Press `Ctrl+C` twice to exit. Tau saves the session as you go, so there is nothing to save before exiting.
90
-
91
- ## Choose a persona and reasoning level
36
+ The agent starts in this directory and can run any command your user can run. Tau saves the session as you go. Press `Ctrl+C` twice to exit, and use `/help` to see commands and keys.
92
37
 
93
- A **persona** selects a provider and model, together with instructions, tools, skills, and default model settings. Tau ships built-in chat and coder personas and can load custom persona files.
38
+ ## Choose a persona
94
39
 
95
- To start with a specific persona, pass its exact id:
96
-
97
- ```sh
98
- tau --persona gpt-6.1-sol-coder
99
- ```
100
-
101
- Append a reasoning level when the model supports it:
40
+ A persona selects the model, instructions, and tools. `tau --help` lists the available ones:
102
41
 
103
42
  ```sh
104
43
  tau --persona gpt-6.1-sol-coder:high
105
44
  ```
106
45
 
107
- The reasoning levels are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. A persona may offer only some of them in the TUI. Providers that do not support reasoning ignore the setting.
108
-
109
- During a session, `/persona:<id>` changes the persona and `Shift+Tab` cycles through the available reasoning levels. A turn that is already running keeps the persona, reasoning, model, and tools it started with. Changes apply from the next turn.
110
-
111
- To set a default for new sessions, use `defaultPersona`:
46
+ The optional suffix sets the reasoning level. To make a choice permanent, set a default in `~/.config/tau/config.json`:
112
47
 
113
48
  ```json
114
- {
115
- "defaultPersona": "gpt-6.1-sol-coder:high"
116
- }
49
+ { "defaultPersona": "gpt-6.1-sol-coder:high" }
117
50
  ```
118
51
 
119
- See [personas](personas.md) for custom persona files and how inheritance works, and [models](models.md) for model catalog overrides.
52
+ Inside a session, `/persona:<id>` switches persona and `Shift+Tab` cycles reasoning.
120
53
 
121
- ## Inspect startup
54
+ ## Ask Tau about itself
122
55
 
123
- Start with the help output:
56
+ The agent can read this manual, so you can ask it to configure Tau or explain a feature:
124
57
 
125
- ```sh
126
- tau --help
58
+ ```text
59
+ Using Tau's documentation, add a project skill that runs our release checks.
127
60
  ```
128
61
 
129
- Tau prints configuration and content warnings to stderr at startup. Each warning names the source path and the invalid field or entry. Tau continues with everything else it could load.
62
+ ## Prepare the shell
130
63
 
131
- For a local startup, `--debug` shows the resources and tool schemas resolved for the current directory without opening the TUI:
64
+ Every agent command runs in a fresh non-interactive login Bash. Login startup files must not print text, prompt, or need a terminal. Check that the tools you expect are found:
132
65
 
133
66
  ```sh
134
- tau --debug --persona gpt-6.1-sol-coder:high
67
+ bash -lc 'command -v node git'
135
68
  ```
136
69
 
137
- Debug output can include project instructions and other text sent to the model, so check where it ends up before sharing it. It inspects only a local startup. It cannot show the effective state of a running remote host or an attached client.
138
-
139
- After you edit configuration or content that the session loads, `/reload` refreshes it when no turn is running and reports warnings in the transcript. Changes to client settings or host startup settings need a restart of that process. [Configuration](configuration.md) explains which changes apply where.
140
-
141
- ## Continue from here
70
+ ## Next steps
142
71
 
143
- Read [ownership and scope](ownership-and-scope.md) before using `tau attach`, hosted execution environments, the SDK, or Telegram. For everyday configuration, use [configuration](configuration.md) together with the [configuration reference](config-reference.md). [TUI](tui.md) covers daily use, and [sessions](sessions.md) explains saving, recovery, compaction, and rewind.
72
+ Read [how Tau works](how-tau-works.md) before using remote sessions, the SDK, or Telegram. It explains which machine each setting belongs to.
@@ -1,161 +1,39 @@
1
1
  # History
2
2
 
3
- Tau keeps a searchable transcript history so you can find earlier work without reopening every session. History is separate from saved sessions. The host uses the saved session to continue and recover a conversation, while history is a flat record for searching and reading.
3
+ Tau keeps a searchable record of past sessions, separate from saved sessions. History helps you find earlier work, and it cannot restore a session.
4
4
 
5
- This matters for recovery, compaction, and privacy. History cannot rebuild a lost session, and keeping history does not make a missing session resumable. See [sessions](sessions.md) for saving and recovery.
5
+ ## Local history
6
6
 
7
- ## What local history records
7
+ Each host records its sessions in `~/.config/tau/history.sqlite`, in the host user's home. It stores user messages, assistant text, and finished tool calls with their results, so treat it as private. Thinking and the persona's base prompt are not stored.
8
8
 
9
- Every Tau host opens a SQLite database on its own machine:
9
+ Recording is best effort, so history can have gaps. A recording failure does not affect the session, and later entries are still recorded.
10
10
 
11
- ```text
12
- ~/.config/tau/history.sqlite
13
- ```
14
-
15
- The file is in the **host user's home**. An attached TUI or a remote execution environment does not get its own history. Local `tau`, `tau serve`, and the default SDK host all use the host machine's database.
16
-
17
- For each session, history stores the creation attributes and the active transcript, in order:
18
-
19
- - user messages, as text or as text and image blocks, with Tau's internal metadata removed
20
- - intermediate system instructions as plain text, marked as system entries, without Tau metadata (the persona's base prompt is not included)
21
- - assistant text, including preambles and responses, but not thinking
22
- - finished tool calls, with the tool name, arguments, result, and outcome
23
-
24
- `<system>...</system>` blocks at the start of user messages stay in history. Tool arguments and results can contain file contents, command output, and other sensitive data, so treat the database as private. Tau creates its directory and file with private permissions, but the host user and the machine's administrators can still read them. Never copy the database into a repository or share it.
25
-
26
- Recording history is best effort and never waits for database locks on the agent's event loop. The host buffers changes in memory and writes them in order from a background worker. Temporary SQLite contention delays recording; the worker retries automatically, including when opening the database. Normal appends and rewinds retain their order while waiting.
27
-
28
- The buffer holds up to 64 MiB of serialized changes per host. When it fills, new changes are dropped until space is available. Other local write errors drop the affected change rather than disabling history. Later changes in the same session are still recorded. Session files and agent work are unaffected by history failures.
29
-
30
- Pending changes have not reached durable storage. A crash can lose them; normal shutdown gives recording and replication up to two seconds to flush. Events already committed to SQLite remain on disk, including any pending remote replication. Tau does not automatically reconstruct missing history from session files.
31
-
32
- Hosts emit `history_recording` diagnostics with a `delayed`, `dropped`, or `recovered` status, a session ID, and pending operation and byte counts. The TUI displays them, headless hosts write them to stderr, and in-process SDK hosts deliver them through `onDiagnostic`. Repeated drop diagnostics are rate-limited. A recording gap does not stop later recording or require a host restart.
33
-
34
- ## How session operations affect history
35
-
36
- History follows the transcript, not the model's current context.
37
-
38
- **Rewind removes later entries.** When a session rewinds to a message, Tau deletes history from that message onward. The same deletion is queued for a configured remote collection. [Subagent sessions](#native-subagent-sessions) stay.
39
-
40
- **Compaction keeps entries.** Compaction replaces the session's model context with a summary, but the original entries stay in history. Work from before a compaction can still be found, even though the session no longer contains it word for word.
41
-
42
- **Retry deletes nothing.** Only operations that remove messages from the session, such as rewind, delete history. Retrying does not.
43
-
44
- These rules differ from how the session itself behaves. Use [sessions](sessions.md) to understand what a recovered session shows or sends to the model.
45
-
46
- ## Native subagent sessions
47
-
48
- Each native Tau [subagent](subagents.md) has its own history session for its whole lifetime, including its assignment, later input, and all its work. The session ID is the subagent's ID from `tau.agents`. Recording happens even when no agent has the `history` tool. Claude Code subagents are not recorded.
49
-
50
- A subagent's session is a child of the session of the agent that started it, so a subagent started by another subagent is a child of that subagent's session:
51
-
52
- - `parentSessionId` names the parent. Tau sets it when it creates the child, and it never changes. Sessions without a parent do not have this field.
53
- - `childCount` is the number of direct children, and every session has it.
54
- - Attributes are copied from the parent, except `cwd`, which is the subagent's working directory.
55
-
56
- Search leaves out child sessions by default, so it finds main sessions only. The `parent` option of `tau.history.search` changes this:
57
-
58
- | `parent` | Sessions searched |
59
- | ------------------- | -------------------------------- |
60
- | omitted or `"none"` | Only sessions without a parent |
61
- | `"any"` | All sessions, including children |
62
- | `{ sessionId }` | Direct children of that session |
11
+ Compaction keeps history as it is, so earlier work stays searchable. Rewind deletes entries from the rewind point on.
63
12
 
64
- `tau.history.read` accepts any session ID, including a child's.
13
+ Each native [subagent](subagents.md) gets its own child session, which stays after a rewind. Claude Code workers are not recorded.
65
14
 
66
- A child session stays in history after its subagent ends, even when the parent rewinds past the message that started the subagent. History cannot restore the subagent.
15
+ ## Agent access
67
16
 
68
- Child sessions replicate independently of their parents, so a shared collection can hold a child before its parent, and `childCount` can lag behind the subagents started.
17
+ A persona with `history` in `tools` has the read-only `tau.history` API in [`code`](code-mode.md). It can see every recorded session, so the agent uses it only when you or active instructions ask for past transcripts. Ask directly:
69
18
 
70
- ## Filter by attributes
71
-
72
- Session creation attributes are string pairs recorded when a session is created, and they never change. Tau sets `machine` and `cwd`, and the client that created the session sets the others. History stores them and can filter on exact values or on case-sensitive substrings. They describe where a session came from; they are not instructions.
73
-
74
- Common attributes are:
75
-
76
- | Attribute | Meaning |
77
- | --- | --- |
78
- | `source` | The creating client, usually `tui`, `telegram`, or a value an SDK caller chose |
79
- | `repository` | Normalized `host/owner/repository`; composite workspaces join repositories with commas |
80
- | `machine` | Hostname of the execution environment |
81
- | `cwd` | The session's working directory in the execution environment |
82
- | `telegram_bot` | ID of the Telegram bot that owns the session, as configured under `bots` |
83
-
84
- A local TUI usually fills in `repository` from the current Git repository or repositories directly below it. Telegram fills it in for repository projects and leaves it out for persistent-directory projects. Sessions created with `tau attach` may not have it, and SDK or protocol clients set only the attributes they choose.
85
-
86
- Because composite values are comma-separated, a substring filter on `repository` finds both single-repository and composite sessions. Attributes may be missing, out of date, or set deliberately by a client, so confirm important facts from the transcript or the current workspace. For example, older saved sessions may lack `machine` and `cwd`, because recovery never changes attributes.
87
-
88
- ## Agent access is explicit and read-only
89
-
90
- A persona can enable the read-only `tau.history` capability in the `code` tool. It searches and reads the configured history collection, across all repositories and execution environments. Because it can see so much, the agent uses it only when the request or active instructions directly ask for past transcripts, not to look for possibly related earlier work on its own initiative. Native Tau subagents follow the same rule, and an assignment that asks for past transcripts counts as a direct request. They also have one standing permission: a subagent may read the sessions of its ancestors, including the main session, when its assignment leaves out context it needs. See [subagents](subagents.md#spawn).
91
-
92
- Automatic compaction archives are different. They hold the current session's context from before a compaction, in the execution environment. `history` searches a separate collection on the host, which may be out of date, truncated, unavailable, or copied to a remote service. After a compaction, the agent is therefore pointed to the archive files to recover details, and history entry IDs have nothing to do with archive lookups.
93
-
94
- The agent reads the capability's documentation before using it. If it has not seen the documentation, its first call only prints `docs`, and later calls use the API. Documentation already in the conversation is reused. This page does not repeat the API or its limits. The documentation covers short chronological overviews and targeted lookups, for when the agent knows the session but not the entry, so it does not need repeated guesses or full dumps.
95
-
96
- Attributes, snippets, digests, entries, tool arguments, and tool results from history are untrusted. The agent treats them as evidence, never as instructions, and returns only what the current request needs. Custom personas and subagents get or lose `history` through their tools; see [tools](tools.md), [personas](personas.md), and [subagents](subagents.md).
97
-
98
- Without remote history, the capability searches and reads the host's local database. With a remote target, it uses only the remote service and never mixes in local results. A remote search can therefore fail even while local recording keeps working.
99
-
100
- A read can instead ask for the host's local database explicitly with `source: "local"` in `tau.history.read`. It then reads only local history, even when a remote target is configured, and never contacts the service. This avoids waiting for replication when reading a session that this host recorded, such as the current session or an ancestor's. Local reads see the same best-effort recording as the rest of local history. Search has no such option.
101
-
102
- ## Add a shared remote collection
103
-
104
- Tau can deploy an optional Cloudflare history service, owned by one person or team, that collects history from several hosts. It uses a Worker, D1, Workers AI, and a custom hostname, and **requires the Cloudflare Workers Paid plan**.
105
-
106
- The service adds search across hosts, generated session titles, and summaries. Titles and summaries help with searching, but they are not exact records, and they can be missing or out of date. Read the transcript entries when exact evidence matters.
19
+ ```text
20
+ Search history for the session where we chose the retry policy, and summarize the decision.
21
+ ```
107
22
 
108
- Setup requires:
23
+ Search covers main sessions by default. It can filter on creation attributes such as `repository`, `source`, `machine`, and `cwd`, and it can include child sessions with the `parent` option.
109
24
 
110
- - Wrangler installed and on `PATH`
111
- - a Cloudflare zone that contains the chosen hostname
112
- - `CLOUDFLARE_API_TOKEN` available to the command, so Wrangler authenticates without prompts
113
- - a history API key and a separate viewer password, supplied securely, or setup can generate both
25
+ ## Shared remote service
114
26
 
115
- Run setup on a machine with Cloudflare access:
27
+ Tau can deploy a Cloudflare service, owned by one person or team, that collects history from several hosts. It adds search across hosts, generated titles and summaries, and a web viewer. It needs the Cloudflare Workers Paid plan, Wrangler on `PATH`, and a zone for the hostname.
116
28
 
117
29
  ```sh
118
- tau history setup \
119
- --domain history.example.net \
120
- --zone-name example.net
30
+ export CLOUDFLARE_API_TOKEN='...'
31
+ tau history setup --domain history.example.net --zone-name example.net
121
32
  ```
122
33
 
123
- `TAU_HISTORY_DOMAIN` and `TAU_HISTORY_ZONE_NAME` can provide the two values instead. Setup creates or reuses the `tau-history` D1 database, applies its migrations, deploys the `tau-history` Worker route, and stores the API key and viewer password as separate Worker secrets.
124
-
125
- For the API key, `--api-key` wins over `TAU_HISTORY_API_KEY`, and setup generates a key if neither is given. For the viewer password, `--viewer-password` wins over `TAU_HISTORY_VIEWER_PASSWORD`, and setup generates one if neither is given. The two must differ. Prefer a secret manager or a protected environment over command-line values, which can end up in shell history. Never paste either credential into a session.
126
-
127
- ## Browse remote conversations
128
-
129
- Open the service's address, for example `https://history.example.net/`, to browse the collection read-only. Sign in with HTTP Basic authentication, username `tau`, and the viewer password from setup.
130
-
131
- - Setup prints passwords it generates, but never prints ones you supplied.
132
- - Plain HTTP requests from outside are redirected to HTTPS before sign-in. HTTP on loopback works for local development.
133
- - The password never appears in a URL, and pages are not cached by the browser.
134
- - The password gives read access to transcripts, attributes, tool arguments, and tool results from every host that uses the service. Keep it private.
34
+ Setup deploys a Worker and a D1 database, and prints an API key and a viewer password if you did not supply them through `--api-key` and `--viewer-password`.
135
35
 
136
- The index lists recently updated sessions without a parent, with titles, summaries, times, and attributes, plus a search form. Its search also covers only those sessions, so open a [subagent's session](#native-subagent-sessions) through the links on its parent's page or through its `webUrl`.
137
-
138
- - Repository and source filters match case-sensitive substrings. They combine with text search and stay active across pages.
139
- - **Older sessions** loads the next page; pages never load by themselves.
140
- - A summary can be pending or out of date while the transcript is already available.
141
-
142
- A session page starts empty, then loads the transcript in batches and adds them in order, with no scrolling or page controls. Tool entries start collapsed. Text and metadata are shown as plain text, never as HTML or Markdown. Valid PNG, JPEG, GIF, and WebP blocks are shown as images, and other structured content as plain text.
143
-
144
- Above the transcript, a session page links to related sessions when it has any. **Parent session** links to the parent, or shows its ID marked as not available when the service does not have that session. **Child sessions** is a nested list of the sessions below this one. It shows up to 200 sessions and 8 levels, and a note appears when the list is incomplete. When the tree is incomplete, the note links to a paginated list of all direct children. Open a child session to explore its descendants. Each link opens that session's normal page, and transcripts are never combined.
145
-
146
- **Copy conversation** at the top works once the whole transcript has loaded. If loading fails, a retry button appears and copying stays off. The selector next to it chooses what to copy:
147
-
148
- - **Messages only** (the default) leaves out tool entries.
149
- - **Include tool calls** adds tool names, arguments, and outcomes, without results.
150
- - **Include everything** adds results too.
151
-
152
- These options do not depend on which tool cards are expanded. Each entry's own **Copy** button copies the complete entry. Leaving out tools or results reduces noise but does not remove sensitive content from messages or arguments. The API still returns results page by page.
153
-
154
- Remote search and read results include a stable `webUrl` for each session, which `tau.history` can return when asked for a link. The URL alone grants no access; the browser still needs the viewer password. Local-only history has no web URL.
155
-
156
- ## Configure hosts to replicate
157
-
158
- Remote history can be set only in the host's global Tau config, normally `~/.config/tau/config.json`:
36
+ Then configure each host in its global configuration and restart it:
159
37
 
160
38
  ```json
161
39
  {
@@ -166,111 +44,35 @@ Remote history can be set only in the host's global Tau config, normally `~/.con
166
44
  }
167
45
  ```
168
46
 
169
- `endpoint` must be an HTTP or HTTPS URL without credentials, query, or fragment. Tau removes trailing slashes. The host uses the first API key it finds:
170
-
171
- 1. `TAU_HISTORY_API_KEY`
172
- 2. the host environment variable named by `history.apiKeyEnv`
173
- 3. inline `history.apiKey`
174
-
175
- If `history` is set but no key is found, the host fails to start, instead of quietly running without remote history. The key stays on the host and is never visible to history code-mode programs. See [credentials](credentials.md) for where to put it.
176
-
177
- Restart the host after changing this block or its environment variables. `/reload` does not reload it.
178
-
179
- ## Keep the service and hosts on one version
180
-
181
- The service and every host that uses it must run the same Tau release, because they do not negotiate versions. A mismatch has these effects:
182
-
183
- - A service older than the host ignores fields it does not know, including parent links. It stores those child sessions without a parent, so they appear as ordinary sessions, and upgrading the service later does not restore the links. The host also rejects the older service's search and read responses.
184
- - A host older than the service rejects the service's search and read responses, so its remote searches and reads fail. Replication and local recording keep working.
185
-
186
- To upgrade without losing parent links:
187
-
188
- 1. Upgrade Tau on the machine you use for setup, then run `tau history setup` with the existing API key and viewer password. Setup deploys the Worker from the installed Tau release and applies new D1 migrations.
189
- 2. Upgrade and restart each host. Until a host restarts on the new release, its remote searches and reads fail.
190
-
191
- ## Replication and outages
192
-
193
- Replication starts locally:
194
-
195
- 1. Tau writes each history change to local SQLite.
196
- 2. In the same transaction, it adds the change to a local outbox on disk.
197
- 3. The host sends pending changes to the endpoint in the background.
198
- 4. Changes the service accepts are removed from the outbox.
199
-
200
- A service outage does not block sessions or local recording. Pending changes stay on disk and are sent again later, including after a host restart or the next history activity. The service applies each change only once, even if it arrives twice. Changes for one session are sent in order, and each session is sent independently of the others.
47
+ Tau uses `TAU_HISTORY_API_KEY`, then the variable named by `apiKeyEnv`, then an inline `apiKey`. The host refuses to start if `history` is set and no key is found.
201
48
 
202
- If the service permanently rejects a change, for example because the session's attributes conflict with what it already has, Tau stops sending changes for that session only. The pending changes and the error stay in local SQLite, later changes for that session wait, and other sessions keep replicating. Temporary network, authentication, rate-limit, and service errors leave changes pending for a later retry. Both kinds of failure produce a `history_replication_failed` host diagnostic, without the API key:
49
+ The service stores transcripts and sends their content to Workers AI for summaries, so decide which projects and people should share it. Sessions recorded before you added the configuration may not appear.
203
50
 
204
- - Headless Tau commands print it to stderr.
205
- - The TUI distinguishes blocked replication from a retryable delay in the footer. A transcript notice keeps the affected session, operation ID (when known), and error.
206
- - An in-process SDK host delivers it only through `onDiagnostic`, when configured.
51
+ To browse, open the service's address and sign in with username `tau` and the viewer password. The password gives read access to everything in the collection. Remote search and read results include a `webUrl` for each session, which still needs the password. Service errors appear in the Worker logs.
207
52
 
208
- Local entries keep everything recorded. For the remote copy, an entry larger than 1 MiB keeps its ID and metadata, but oversized content, arguments, or results are truncated in the middle with a marker. The host's local entry can therefore contain details the shared copy leaves out.
53
+ ## How replication behaves
209
54
 
210
- With a remote target configured, history searches and reads go only to the service, unless a read explicitly asks for local history. Tau never falls back to local results when the service is unreachable, because that would change which collection you are searching. Do not assume sessions recorded before you added the configuration appear remotely.
55
+ Each host writes to local SQLite first and sends changes to the service in the background. An outage does not affect sessions, and pending changes are sent later. With a remote target, searches and reads use the service only, and do not fall back to local results. `tau.history.read` can ask for local data with `source: "local"`.
211
56
 
212
- ## Recover blocked replication
57
+ Entries over 1 MiB are shortened in the remote copy, and summaries can lag behind transcripts.
213
58
 
214
- A permanent rejection blocks that session until you explicitly retry it. Restarting the host does not clear the block, also called a quarantine.
215
-
216
- Run this on the affected host with its remote history configuration:
59
+ If the service permanently rejects a change, that session's replication stops until you retry it. Other sessions continue. Fix the cause, then run this on the affected host:
217
60
 
218
61
  ```sh
219
62
  tau history status
220
- ```
221
-
222
- The command prints persisted quarantines for the configured endpoint as JSON. It does not require an API key. When a change fails, its diagnostic identifies the failed operation, even if earlier changes in the same request succeeded. Request-level and transport failures may have no operation ID.
223
-
224
- Fix the underlying service or data problem before retrying. If the service needs an update, deploy it with `tau history setup` using the setup requirements above and the existing credentials. Then, on the affected host, run:
225
-
226
- ```sh
227
63
  tau history retry --session <session-id>
228
64
  ```
229
65
 
230
- Retry requires the host's history API key. It clears only the named session's quarantine and sends pending changes with their original operation IDs. Local history and queued changes are preserved. The command can also send pending changes for other unblocked sessions at the same endpoint; other quarantines stay blocked.
231
-
232
- If the service permanently rejects the session again, Tau restores its quarantine. A temporary failure leaves changes pending for a later retry. The command exits unsuccessfully if the selected session remains blocked or a temporary failure prevents replication from completing.
233
-
234
- ## Verify operation
235
-
236
- Check that each step works, without looking at credentials or dumping transcripts:
237
-
238
- 1. Confirm setup finished the D1 migration and Worker deployment without errors.
239
- 2. Add the global config and the key's environment variable on one host, then restart it.
240
- 3. Create a small throwaway session with distinctive, non-sensitive text.
241
- 4. Ask the agent explicitly to search history for that session. It reads the capability's `docs` first.
242
- 5. With several hosts, repeat from another host, and allow time for replication and summaries.
243
-
244
- A transcript can become searchable before its summary appears, so a missing summary does not mean replication failed. Open the service in a browser and sign in to confirm the session and its transcript are there.
245
-
246
- Cloudflare problems show up in the normal Worker logs, Cron Events, and D1 diagnostics. The service has no separate admin dashboard or status endpoint.
247
-
248
- ## Troubleshooting
249
-
250
- **`history` is configured but no API key is available.** Set `TAU_HISTORY_API_KEY`, set the variable named by `apiKeyEnv`, or use an inline key only if the config file is well protected. Restart the host.
251
-
252
- **The agent has no history capability.** The active persona must select `history`. Fix the persona and run `/reload` while idle.
253
-
254
- **The history capability returns a service error while the session works.** Remote searches and replication can fail without affecting the session or local recording. Check that the endpoint is reachable and read the Worker logs, without printing the key. Check `history_recording` diagnostics separately for local write failures.
255
-
256
- **The browser keeps asking for credentials.** Use username `tau` and the viewer password from the latest setup. The API key is for hosts and does not work in the browser.
257
-
258
- **A session does not appear in remote search.** Confirm the host was restarted with the remote config, the session was used while the config was active, and enough history activity has happened to send the outbox. Check host logs for `history_replication_failed`. A permanent rejection affects only the named session, while other failures are retried. Summaries are not immediate.
259
-
260
- **Remote search or read fails with an invalid response after an upgrade.** The host and the service are on different Tau releases. [Put them on the same release](#keep-the-service-and-hosts-on-one-version).
261
-
262
- **Local history is delayed or dropping changes.** Brief SQLite contention is retried automatically. For sustained failures, check the host's `history_recording` diagnostics, file access, free space, ownership of `~/.config/tau`, and whether another process holds a long database transaction. Fixing the underlying problem lets later writes proceed without restarting the host; dropped changes remain gaps. `tau history status` reports remote replication quarantines, not the live recording buffer. Do not edit, replace, or delete the SQLite files as a first repair, and do not inspect outbox rows or keys.
263
-
264
- **Search finds material removed from the model's context.** This is expected after compaction. After a rewind, the removed entries should disappear; if the remote copy still has them, wait for the deletion to replicate.
66
+ ## Upgrading
265
67
 
266
- ## Destroy the remote service
68
+ The service and every host must run the same Tau release. Upgrade the service first by running `tau history setup` from the new release with the existing API key and viewer password, then upgrade and restart each host. A host on another release fails remote searches and reads with an invalid response, and an older service loses parent links of child sessions.
267
69
 
268
- `tau history destroy --yes` permanently deletes the `tau-history` Worker and D1 database, and with them the shared transcripts and summaries. It does not delete any host's local `history.sqlite`, and it is not a substitute for a retention or export plan.
70
+ ## Removing the service
269
71
 
270
- Run it only once you are sure the service and its data are no longer needed:
72
+ This permanently deletes the Worker, the database, and the shared transcripts. Local databases are not affected:
271
73
 
272
74
  ```sh
273
75
  tau history destroy --yes
274
76
  ```
275
77
 
276
- The command needs `CLOUDFLARE_API_TOKEN`. It reports each resource separately and treats Tau history resources that are already gone as deleted. If one deletion fails, read the partial result before retrying. Afterward, remove the `history` config from your hosts and restart them; otherwise their remote searches and replication keep failing.
78
+ Afterwards, remove `history` from each host's configuration and restart it.
@@ -0,0 +1,53 @@
1
+ # How Tau works
2
+
3
+ A Tau session has three parts. They can share one machine, but each can also run on a different one:
4
+
5
+ - The **client** is what you interact with: the TUI, an SDK program, or the Telegram runner. It owns drafts, themes, speech, the diff review interface, and client tools.
6
+ - The **host** runs the session. It makes model calls, holds credentials, and saves sessions and history in its user's home.
7
+ - The **execution environment** is the machine the agent acts on. It holds the working directory, files, commands, project configuration, `AGENTS.md`, personas, and skills.
8
+
9
+ Each session has one execution environment, fixed when the session is created. Paths in prompts and tool calls are paths on that environment.
10
+
11
+ ## Where each mode runs
12
+
13
+ | Mode | Client | Host | Execution environment |
14
+ | --- | --- | --- | --- |
15
+ | `tau` | Local TUI | Same process | Current directory |
16
+ | `tau attach` | Attaching machine | Machine running `tau serve` | Directory on the host, or a Fly Sprite |
17
+ | Node SDK, default client | Your program | Same process | Usually a local directory |
18
+ | Node SDK over WebSocket | Your program | Machine running `tau serve` | Directory on the host, or a Fly Sprite |
19
+ | `tau telegram` | Telegram runner | Same process | Project workspace on the runner machine |
20
+
21
+ ## Where to put a setting
22
+
23
+ | You want to change | Change it on | Then |
24
+ | --- | --- | --- |
25
+ | Project config, personas, prompts, skills, `AGENTS.md` | Execution environment | `/reload` while idle |
26
+ | MCP servers | Execution environment, for local sessions (they run on the host) | New session |
27
+ | Theme, voice, recording shortcut, client tools | Client | Restart the client |
28
+ | API keys and service credentials used by the agent | Host | Restart the host |
29
+ | `tau auth` accounts | Host | Nothing, later requests use them |
30
+ | Fly Sprite connection, remote history | Host | Restart the host |
31
+ | Telegram bots, projects, and routing | Runner's `--config-file` | Restart the runner |
32
+
33
+ Suppose a laptop runs this:
34
+
35
+ ```sh
36
+ tau attach --new --cwd /srv/ledger ws://devbox.example:8787
37
+ ```
38
+
39
+ Project configuration comes from `/srv/ledger` on `devbox.example`, and `!pwd` prints `/srv/ledger`. Model calls run on `devbox.example`, so a key exported only on the laptop has no effect. The theme comes from the laptop, and `/diff` opens its browser tool there.
40
+
41
+ ## What a session keeps
42
+
43
+ The host saves each session under `~/.config/tau/sessions` and recovers it after a restart. Running processes and subagents do not survive a restart. See [sessions](sessions.md).
44
+
45
+ Never edit Tau's own state by hand: `~/.config/tau/auth.json`, `models-store.json`, `sessions/`, `history.sqlite`, or Telegram runner state files. Use Tau's commands instead.
46
+
47
+ ## Global configuration and home
48
+
49
+ Tau reads global configuration (`~/.config/tau`) only when the working directory is the home directory or below it, on that same machine. A project outside home therefore gets project levels only.
50
+
51
+ ## What the agent's documentation covers
52
+
53
+ `tau_docs` reads the manual installed with the host. It cannot see effective configuration, environment variables, or anything on the client. An attached client can run a different Tau version, but the protocol version must match, so upgrade client and host together.