@markusylisiurunen/tau 0.3.102 → 0.3.104

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 (73) hide show
  1. package/README.md +18 -23
  2. package/dist/code_mode/runtime.d.ts +6 -0
  3. package/dist/code_mode/runtime.js +2 -0
  4. package/dist/code_mode/runtime.js.map +1 -1
  5. package/dist/core/code_mode/sdk.js +4 -0
  6. package/dist/core/code_mode/sdk.js.map +1 -1
  7. package/dist/core/code_mode/web.js +5 -5
  8. package/dist/core/code_mode/web.js.map +1 -1
  9. package/dist/core/history/migrations.js +40 -0
  10. package/dist/core/history/migrations.js.map +1 -1
  11. package/dist/core/history/setup.js +24 -7
  12. package/dist/core/history/setup.js.map +1 -1
  13. package/dist/core/mcp/cli.js +1 -1
  14. package/dist/core/mcp/cli.js.map +1 -1
  15. package/dist/core/static/code_mode/sandbox_runner.mjs +19 -2
  16. package/dist/core/static/tau_docs/client-tools.md +46 -385
  17. package/dist/core/static/tau_docs/code-mode.md +114 -41
  18. package/dist/core/static/tau_docs/configuration.md +77 -171
  19. package/dist/core/static/tau_docs/getting-started.md +25 -96
  20. package/dist/core/static/tau_docs/history.md +30 -228
  21. package/dist/core/static/tau_docs/how-tau-works.md +53 -0
  22. package/dist/core/static/tau_docs/image-generation.md +15 -107
  23. package/dist/core/static/tau_docs/index.md +46 -46
  24. package/dist/core/static/tau_docs/instructions-and-skills.md +81 -0
  25. package/dist/core/static/tau_docs/manifest.json +15 -21
  26. package/dist/core/static/tau_docs/mcp.md +77 -0
  27. package/dist/core/static/tau_docs/models-and-credentials.md +67 -0
  28. package/dist/core/static/tau_docs/openrouter.md +31 -129
  29. package/dist/core/static/tau_docs/pdf-unpacking.md +8 -21
  30. package/dist/core/static/tau_docs/personas.md +48 -144
  31. package/dist/core/static/tau_docs/remote-sessions.md +33 -170
  32. package/dist/core/static/tau_docs/sdk.md +150 -0
  33. package/dist/core/static/tau_docs/security.md +6 -193
  34. package/dist/core/static/tau_docs/session-protocol.md +84 -246
  35. package/dist/core/static/tau_docs/sessions.md +41 -205
  36. package/dist/core/static/tau_docs/speech-generation.md +16 -129
  37. package/dist/core/static/tau_docs/subagents.md +57 -229
  38. package/dist/core/static/tau_docs/telegram.md +152 -192
  39. package/dist/core/static/tau_docs/tools.md +44 -167
  40. package/dist/core/static/tau_docs/troubleshooting.md +23 -217
  41. package/dist/core/static/tau_docs/tui.md +42 -282
  42. package/dist/core/telegram/adapter.js +4 -4
  43. package/dist/core/telegram/adapter.js.map +1 -1
  44. package/dist/core/telegram/runtime.js +3 -2
  45. package/dist/core/telegram/runtime.js.map +1 -1
  46. package/dist/core/tools/code.js +13 -12
  47. package/dist/core/tools/code.js.map +1 -1
  48. package/dist/core/tools/code_jobs.js.map +1 -1
  49. package/dist/core/tools/code_mode.js +4 -0
  50. package/dist/core/tools/code_mode.js.map +1 -1
  51. package/dist/core/tools/code_preloads.js +94 -0
  52. package/dist/core/tools/code_preloads.js.map +1 -0
  53. package/dist/core/version.js +1 -1
  54. package/dist/history/worker/index.js +16 -22
  55. package/dist/history/worker/index.js.map +1 -1
  56. package/dist/history/worker/migrations/0005_external_content.sql +58 -0
  57. package/dist/history/worker/migrations/0006_external_content_cutover.sql +44 -0
  58. package/dist/tui/session_chat_controller.js +21 -31
  59. package/dist/tui/session_chat_controller.js.map +1 -1
  60. package/dist/tui/ui/app_intro.js +45 -12
  61. package/dist/tui/ui/app_intro.js.map +1 -1
  62. package/package.json +4 -3
  63. package/dist/core/static/tau_docs/config-reference.md +0 -367
  64. package/dist/core/static/tau_docs/credentials.md +0 -165
  65. package/dist/core/static/tau_docs/models.md +0 -57
  66. package/dist/core/static/tau_docs/node-sdk.md +0 -430
  67. package/dist/core/static/tau_docs/ownership-and-scope.md +0 -107
  68. package/dist/core/static/tau_docs/prompts-and-project-context.md +0 -147
  69. package/dist/core/static/tau_docs/sdk-diff-review.md +0 -92
  70. package/dist/core/static/tau_docs/session-protocol-methods.md +0 -655
  71. package/dist/core/static/tau_docs/skills.md +0 -135
  72. package/dist/core/static/tau_docs/telegram-commands.md +0 -55
  73. package/dist/core/static/tau_docs/telegram-projects.md +0 -197
@@ -1,73 +1,50 @@
1
1
  # OpenRouter
2
2
 
3
- `tau tool openrouter` makes single requests for typed decisions and for understanding text or media. It works from any shell, inside or outside Tau, without a session, persona, conversation, tools, or session cost tracking. Only the content you pass is sent to OpenRouter and its chosen provider. Its judgments are model output; never use them as a security or permission check.
3
+ `tau tool openrouter` makes single model requests for typed decisions and for analyzing text or media. It has no session or conversation, and only what you pass is sent. Its output is model judgment, so never use it as a security or permission check.
4
4
 
5
5
  ## Credentials and requirements
6
6
 
7
- Install Tau and configure `OPENROUTER_API_KEY`, or put `apiKeys.openrouter` in the global `~/.config/tau/config.json` on the machine running the command. A nonblank environment key takes precedence. Project configuration cannot supply API keys. There is no key flag.
8
-
9
- The agent's Bash tool removes inherited variables that look like credentials. When the agent runs the command, put the key in global configuration on that machine, or set it some other way that machine supports. See [credentials](credentials.md) and [tools](tools.md).
10
-
11
- Audio and video require `ffprobe` from FFmpeg on `PATH`: `brew install ffmpeg` on macOS or `apt install ffmpeg` on Debian/Ubuntu. Text and images do not require FFmpeg. Media is validated locally, not transcoded.
7
+ Needs `OPENROUTER_API_KEY` or `apiKeys.openrouter` in global configuration. When the agent runs the command, use global configuration, because Bash commands do not inherit keys. Audio and video also need `ffprobe` from FFmpeg.
12
8
 
13
9
  ```sh
14
- tau tool openrouter --help
15
10
  tau tool openrouter decisions --help
16
- tau tool openrouter chat --help
17
- tau tool openrouter decisions --list-models
18
11
  tau tool openrouter chat --list-models
19
12
  ```
20
13
 
21
- Help and model listing require neither credentials nor network access and never read stdin. `--list-models` is a separate mode, incompatible with request flags, and prints one JSON object containing `models`, with each model's `id`, `inputs`, `reasoning` settings, and `role` guidance. `--help` and `-h` print text help.
22
-
23
- ## Fixed model choices
24
-
25
- Every request needs an exact `--model` ID from this table. There is no default, no way to use other IDs, no model discovery or refresh, and no automatic substitution. A versioned ID is not necessarily an immutable provider snapshot; output records the returned model separately.
26
-
27
- | Operation | Model | Inputs and suggested role | Reasoning efforts |
28
- | --- | --- | --- | --- |
29
- | `decisions` | `openai/gpt-6-luna-decisions` | Questions about text, structured state, or images; recommended first choice for decisions | Not supported |
30
- | `decisions` | `typesafe/jev-1.14` | Questions about text, structured state, or images; use for high-volume decisions when cost is the priority | Not supported |
31
- | `chat` | `google/gemini-3.8-flash` | Text, images, audio, video; first choice for audio/video and image-heavy analysis | `low`, `medium`, `high` |
32
- | `chat` | `google/gemini-4-argon` | Text, images, audio, video; multimodal analysis | `low`, `medium`, `high` |
33
- | `chat` | `openai/gpt-6-luna` | Text and images; cheap everyday extraction, summarization, and routine questions | `none`, `low`, `medium`, `high`, `xhigh`, `max` |
34
- | `chat` | `openai/gpt-6.1-terra` | Text and images; efficient visual reasoning, writing, and everyday coding | `low`, `medium`, `high`, `xhigh`, `max` |
35
- | `chat` | `openai/gpt-6.1-sol` | Text and images; coding, debugging, technical reasoning | `low`, `medium`, `high`, `xhigh`, `max` |
36
- | `chat` | `anthropic/claude-sonnet-5.5` | Text and images; writing, coding, and general-purpose reasoning | `low`, `medium`, `high`, `xhigh`, `max` |
37
- | `chat` | `anthropic/claude-opus-5.5` | Text and images; premium generalist for writing, synthesis, difficult reasoning, and second opinions | `low`, `medium`, `high`, `xhigh`, `max` |
14
+ `--model` is required and must be one of these exact IDs:
38
15
 
39
- Roles are guidance for choosing, not guarantees or limits on what a model may be used for. Unsupported settings and media types fail locally; the command never switches models, transcribes audio, or extracts video frames instead.
16
+ | Operation | Model | Use for |
17
+ | --- | --- | --- |
18
+ | `decisions` | `openai/gpt-6-luna-decisions` | First choice, supports text and images |
19
+ | `decisions` | `typesafe/jev-1.14` | High volume when cost matters most |
20
+ | `chat` | `google/gemini-3.8-flash` | First choice for audio, video, and images |
21
+ | `chat` | `google/gemini-4-argon` | Multimodal analysis |
22
+ | `chat` | `openai/gpt-6-luna` | Cheap extraction and summaries |
23
+ | `chat` | `openai/gpt-6.1-terra` | Visual reasoning, writing, everyday coding |
24
+ | `chat` | `openai/gpt-6.1-sol` | Coding and technical reasoning |
25
+ | `chat` | `anthropic/claude-sonnet-5.5` | Writing, coding, general reasoning |
26
+ | `chat` | `anthropic/claude-opus-5.5` | Difficult reasoning and second opinions |
40
27
 
41
28
  ## Input and examples
42
29
 
43
30
  ### Decisions
44
31
 
45
- ```sh
46
- tau tool openrouter decisions --model openai/gpt-6-luna-decisions --input ./decision.json
47
- ```
48
-
49
- `--input` is required. A file path reads a UTF-8 JSON document. Exactly `--input -` reads one complete document from stdin until EOF:
32
+ A decision asks independent typed questions about some `state`:
50
33
 
51
34
  ```sh
52
35
  tau tool openrouter decisions --model openai/gpt-6-luna-decisions --input - <<'JSON'
53
36
  {
54
37
  "state": { "ticket": "The checkout page crashes when I click Pay." },
55
38
  "questions": {
56
- "is_bug": {
57
- "type": "noul",
58
- "instructions": "Does this report describe broken product behavior?"
59
- },
39
+ "is_bug": { "type": "noul", "instructions": "Is this broken product behavior?" },
60
40
  "team": {
61
41
  "type": "choice",
62
- "instructions": "Which team should own this ticket?",
63
- "criteria": {
64
- "payments": "Checkout or billing problems",
65
- "other": "Problems unrelated to payments"
66
- }
42
+ "instructions": "Which team should own this?",
43
+ "criteria": { "payments": "Checkout or billing", "other": "Anything else" }
67
44
  },
68
45
  "urgency": {
69
46
  "type": "score",
70
- "instructions": "How urgent is the issue?",
47
+ "instructions": "How urgent is it?",
71
48
  "criteria": ["Can wait", "Fix soon", "Blocking revenue"]
72
49
  }
73
50
  }
@@ -75,35 +52,11 @@ tau tool openrouter decisions --model openai/gpt-6-luna-decisions --input - <<'J
75
52
  JSON
76
53
  ```
77
54
 
78
- Stdin must not be a terminal and must reach EOF within 30 seconds. Empty input, malformed JSON, multiple documents, invalid UTF-8, and oversized input fail before any request.
79
-
80
- The input contains exactly `state` and `questions`. The model belongs only in `--model`, not the document. `state` is a string, JSON object, or array. `questions` is a nonempty map of nonempty names to questions:
81
-
82
- - `noul`: required `instructions`; optional `criteria` with both `true` and `false`. The answer's `noul` is a probability from zero to one, not a boolean.
83
- - `choice`: required `instructions` and a nonempty `criteria` object mapping category names to guidance. The answer's `choice` names a supplied category; optional `probabilities` and `confidence` retain provider probabilities.
84
- - `score`: required `instructions` and a nonempty ordered `criteria` array. The answer's `score` is a numeric position from zero to the last rubric index, possibly fractional. Optional `legend`, `probabilities`, and `confidence` retain distribution details.
85
-
86
- Instructions and criterion guidance accept strings, JSON objects, or arrays; choice criterion values may also be `null`. Unknown question fields and the reserved question/category name `__proto__` are rejected. Arbitrary keys within state and guidance are preserved. Several independent questions can share one state; dependent questions require separate calls.
87
-
88
- Luna Decisions supports at most 200 questions, 255 categories per choice question, and 2–10 rubric levels per score question. Tau checks these limits before sending the request. Jev also accepts a single-level score rubric. Both models use the same JSON input format.
89
-
90
- Luna also accepts up to 64 ordered local PNG/JPEG/WebP images using repeatable `--image <path>` flags:
91
-
92
- ```sh
93
- tau tool openrouter decisions \
94
- --model openai/gpt-6-luna-decisions \
95
- --input ./visual-checks.json --image ./checkout.png
96
- ```
97
-
98
- Describe what to check in `questions` and supply images with `--image`. Images follow `state` in flag order and retain their original bytes. Objects and arrays in `state` are sent as JSON text, so image URLs inside `state` are treated as text.
99
-
100
- Jev accepts up to 16 PNG/JPEG images through the same flags. Each side must be 256–1,568 pixels, with at least 78,400 pixels in total (inclusive limits). A 256×256 image is too small; 280×280 meets the minimum area. WebP is unsupported. Tau checks these constraints before sending, without resizing or converting images. EXIF orientation is not applied by Jev, so rotate photos before attaching them.
101
-
102
- Images also use the [same validation and limits as chat images](#outputs-and-recovery). Only local files are accepted; external URLs and file IDs are unsupported. Neither decision model accepts audio or video.
55
+ `--input` also takes a file path. Add images with repeatable `--image` flags. Answers have this shape:
103
56
 
104
- Multimodal requests follow [OpenRouter’s Decisions format](https://openrouter.ai/docs/guides/community/multimodal-decisions): a plain string followed by `image_url` parts in the `state` array. Tau’s byte and attachment limits still apply. Jev also imposes provider-side processed-image and expanded-request limits, so a request that passes local validation can still be rejected. Bounding-box questions are unsupported.
105
-
106
- The command posts once to OpenRouter's alpha Decisions endpoint. It validates answer names, types, categories, rubric ranges, and probability bounds. Refusals and malformed answers fail the command. Successful output is one JSON object:
57
+ - `noul`: a probability from 0 to 1
58
+ - `choice`: the name of a category
59
+ - `score`: a position in the `criteria` list, possibly fractional
107
60
 
108
61
  ```json
109
62
  {
@@ -114,75 +67,24 @@ The command posts once to OpenRouter's alpha Decisions endpoint. It validates an
114
67
  }
115
68
  ```
116
69
 
117
- This illustrates a single-question response; every submitted question must have an answer. Provider `id` and `provider` are included when supplied. Usage contains reported token counts and optional reported cost, never an estimated cost. Negative judgments and low confidence still exit successfully. No thresholds or prose explanations are invented.
70
+ Luna accepts at most 200 questions and up to 64 PNG, JPEG, or WebP images. Jev accepts up to 16 PNG or JPEG images, with each side between 256 and 1,568 pixels.
118
71
 
119
72
  ### Chat
120
73
 
121
- ```sh
122
- tau tool openrouter chat \
123
- --model openai/gpt-6.1-sol \
124
- --system 'Review carefully. Separate observations from assumptions.' \
125
- --prompt-file ./review-context.txt \
126
- --image ./error.png \
127
- --reasoning high
128
- ```
129
-
130
- Flags belong after `chat`. No positional arguments are accepted.
131
-
132
- | Flag | Contract |
133
- | --- | --- |
134
- | `--model <id>` | Required exact shipped chat model ID |
135
- | `--prompt <text>` or `--prompt-file <path>` | Exactly one required; nonblank UTF-8 user prompt |
136
- | `--system <text>` or `--system-file <path>` | Optional, mutually exclusive, nonblank explicit system instructions |
137
- | `--image <path>` | Repeatable local PNG, JPEG, or WebP image |
138
- | `--audio <path>` | Repeatable local WAV or MP3 audio; Gemini only |
139
- | `--video <path>` | Repeatable local MP4 video; Gemini only |
140
- | `--reasoning <effort>` | Optional model-supported effort from the table |
141
-
142
- All file paths resolve relative to the invoking working directory. Prompt/system files name regular files; `-` has special stdin meaning only for decisions. Omitting system instructions sends no system message. Omitting reasoning leaves that parameter to the provider, not necessarily disabled. Effort does not request a written reasoning trace.
143
-
144
- Media flags may be mixed; the request contains the prompt first, followed by attachments in command-line order. Files are embedded inline as data URLs or base64 audio, not uploaded to public hosting. There are no remote URL inputs, generated media, automatic resizing, clipping, conversion, chunking, conversation history, or tool execution.
145
-
146
74
  ```sh
147
75
  tau tool openrouter chat \
148
76
  --model google/gemini-3.8-flash \
149
- --prompt 'Compare this recording with the reference and spoken requirements.' \
150
- --video ./recording.mp4 \
151
- --image ./reference.png \
152
- --audio ./requirements.wav > ./analysis.json
77
+ --prompt 'Compare this recording with the reference.' \
78
+ --system 'Separate observations from assumptions.' \
79
+ --video ./recording.mp4 --image ./reference.png --reasoning high
153
80
  ```
154
81
 
155
- Chat sends one non-streaming completion request. It imposes no output token cap: neither `max_tokens` nor `max_completion_tokens` is sent, and there is no `--max-tokens` flag. Provider defaults, remaining context, and model limits still apply; omission does not mean unlimited output.
156
-
157
- Successful stdout contains one JSON object with `requested_model`, returned `model`, `answer` (text or `null`), and `finish_reason`. Reported `id`, `provider`, `usage` (including cost and token details), `native_finish_reason`, and `refusal` appear when supplied. Missing optional metadata is not fabricated. Reasoning is never substituted for the answer or returned as answer text.
82
+ Use `--prompt` or `--prompt-file`, and `--system` or `--system-file`. Attachments are `--image` (PNG, JPEG, WebP), and for Gemini only, `--audio` (WAV, MP3) and `--video` (H.264 MP4). Each can repeat.
158
83
 
159
- - `stop` with no refusal is a complete answer.
160
- - `length` is truncated output, even if answer text is empty.
161
- - `content_filter` or a nonempty `refusal` indicates refusal, not a complete answer.
162
-
163
- These are successful exchanges with distinguishable outcomes; scripts must inspect them. Provider errors, malformed responses, unexpected tool calls, and a normal stop with neither answer nor refusal fail instead of masquerading as an answer.
84
+ Stdout has `answer` and `finish_reason`. `stop` means a complete answer, `length` means the answer was cut off, and `content_filter` or a `refusal` field means the model refused. Check these, because all of them exit successfully.
164
85
 
165
86
  ## Outputs and recovery
166
87
 
167
- Tau sets these limits to reject abnormal input. They are not the providers' maximum capacities, and a request within them can still exceed the selected model's context window or a provider limit. 1 MiB is 1,048,576 bytes.
168
-
169
- | Resource | Limit |
170
- | --- | --- |
171
- | Decisions JSON | 20 MiB of UTF-8 |
172
- | Chat prompt, system instructions, and schema | 20 MiB of UTF-8 combined |
173
- | Attachments per request | 64 of any mix of types; 16 for Jev |
174
- | Each image | 32 MiB, 32,768 pixels per edge, 100 megapixels; one frame |
175
- | Each audio or video | 256 MiB |
176
- | Audio formats | Single-stream PCM 16-bit little-endian WAV or MP3 |
177
- | Video format | H.264 MP4 up to 3840×2160 with optional AAC audio |
178
- | Audio/video duration | Known positive duration; 7,200 seconds (2 hours) combined |
179
- | Complete encoded JSON request | 512 MiB, including base64 expansion and text |
180
- | Response | 32 MiB |
181
- | Local media probe | 15 seconds per file |
182
- | HTTP request and response | 10 minutes |
183
-
184
- Oversized or unsupported inputs fail before sending. Audio/video validation uses private temporary copies of the exact bytes being submitted and removes those copies after probing. Keep FFmpeg current when handling untrusted media.
185
-
186
- Diagnostics go to stderr and failures exit nonzero. Authentication, insufficient credits, permission failures, rate limits, and provider/service failures report distinct status diagnostics without dumping provider bodies. There are no automatic retries, including after timeouts or interrupted connections: the provider may already have charged for an unknown outcome. A response exceeding the safety bound can fail after a billable request.
88
+ Output is one JSON object on stdout, with diagnostics on stderr. Failures exit nonzero. Requests are never retried, because the provider may already have charged for one with an unknown result.
187
89
 
188
- Passing local validation does not guarantee the provider accepts the request. OpenRouter's alpha Decisions API and provider availability can change independently of Tau. Read the actual output and errors, and never treat model judgments as verified facts.
90
+ Input over Tau's limits fails before sending. Limits include 20 MiB of text, 64 attachments, 32 MiB per image, 256 MiB per audio or video file, and two hours of combined media. A request within these limits can still exceed a model's or provider's limit.
@@ -1,38 +1,25 @@
1
1
  # PDF unpacking
2
2
 
3
- `tau tool pdf-unpack` turns a PDF into OCR Markdown and page-image patches using Mistral and Poppler.
4
-
5
- ```bash
6
- tau tool pdf-unpack --help
7
- tau tool pdf-unpack ./docs/architecture.pdf
8
- ```
3
+ `tau tool pdf-unpack` turns a PDF into OCR Markdown and page images.
9
4
 
10
5
  ## Credentials and requirements
11
6
 
12
- Requires a Mistral API key. See [feature-specific credentials](credentials.md#feature-specific-keys) for setup.
13
-
14
- The command requires `pdftoppm` from Poppler on `PATH`. On macOS, install it with `brew install poppler`; Debian-based Linux distributions provide it through `apt install poppler-utils`.
7
+ Needs `MISTRAL_API_KEY` or `apiKeys.mistral`, and `pdftoppm` from Poppler (`brew install poppler` or `apt install poppler-utils`).
15
8
 
16
9
  ## Input and examples
17
10
 
18
- Give one local PDF path, relative to the current directory. Quote paths containing spaces:
19
-
20
11
  ```bash
21
12
  tau tool pdf-unpack './docs/design review.pdf'
22
13
  ```
23
14
 
24
- The command uploads the PDF to Mistral for OCR and renders page images locally.
15
+ The PDF is uploaded to Mistral and deleted afterwards when possible.
25
16
 
26
17
  ## Outputs and recovery
27
18
 
28
- On success, stdout prints the output directory, which is temporary but not deleted automatically, and lists every file. The directory contains:
29
-
30
- - `document.md`: the complete OCR document with recognized tables inlined.
31
- - `pages/page-0001.md` and later numbered files: one Markdown file per PDF page.
32
- - `images/page-0001/patch-0001.png` and later numbered patches: images for visual verification.
33
-
34
- OCR text can contain mistakes. Images and figures that are not captured in Markdown are marked with placeholders that point to the matching page patches. Read `document.md` for the whole document, use `pages/` for page-level work, and inspect `images/` before trusting or correcting uncertain OCR.
19
+ Stdout prints a temporary output directory, which is kept until you delete it:
35
20
 
36
- After OCR, the command tries to delete the uploaded file from Mistral and reports if that fails. The local output stays on disk; delete it when you no longer need it. If processing fails, Tau tries to remove the partial output directory. The error names the step that failed and says whether the partial output was removed. Partial output is never a complete result. If the failure happens after the OCR request started, the error warns that running the command again may be charged again.
21
+ - `document.md`: the whole document
22
+ - `pages/page-0001.md`: one file per page
23
+ - `images/page-0001/patch-0001.png`: page images for checking uncertain OCR
37
24
 
38
- See [command-line tools](tools.md) for the other tools and where commands run.
25
+ OCR can contain mistakes, and figures appear as placeholders pointing to page images. Running the command again after a failed OCR request may be charged again.
@@ -1,50 +1,10 @@
1
1
  # Personas
2
2
 
3
- A persona defines how the agent works. It chooses a provider and model, supplies the base system prompt, sets reasoning and service tier, and selects tools. Switching persona changes how later turns run, in the same session.
3
+ A persona defines how the agent works: model, base system prompt, default reasoning, and tools. Tau ships chat and coder personas for its supported models, and `tau --help` lists what is available. GPT models have variants for the API and for a ChatGPT subscription. A built-in persona appears only when its model is in the catalog. The default is `sonnet-5.5-coder`.
4
4
 
5
- Tau ships built-in personas and loads custom persona files from the execution environment. The available list depends on the Tau version and on where the session runs, so check the current list instead of relying on remembered names.
5
+ ## Writing a persona
6
6
 
7
- ## Built-in and effective personas
8
-
9
- Built-in personas are generated from Tau's current model catalog. Most model families have separate chat and coder variants, and some have only the variants Tau supports. Built-ins come with Tau's own prompts, defaults, tool selections, and subagent access.
10
-
11
- The Opus 5.5 chat and coder personas are available only when `anthropic/claude-opus-5-5` is present in the effective model catalog. The Sonnet 5.5 variants (`sonnet-5.5-chat` and `sonnet-5.5-coder`) likewise require `anthropic/claude-sonnet-5-5`.
12
-
13
- GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna, and GPT-6 Astra have API and ChatGPT variants for chat and coding. Fast ChatGPT variants use priority service and are available only for coding. They are available only when the effective catalog contains the matching model ID (`gpt-6.1-sol`, `gpt-6.1-terra`, `gpt-6-luna`, or `gpt-6-astra`) for the corresponding provider.
14
-
15
- All built-in personas default to medium reasoning. The startup default is `sonnet-5.5-coder`.
16
-
17
- After a remote catalog refresh, `/reload` adopts the updated catalog for an existing session.
18
-
19
- Built-in personas are always included. A custom persona replaces a built-in by using the same ID.
20
-
21
- To see the current list:
22
-
23
- ```sh
24
- tau --help
25
- tau --debug
26
- ```
27
-
28
- `tau --debug` also prints the full prompts and project context, so be careful where you share its output.
29
-
30
- If no personas are left, session creation fails. Reload also fails, so a running session never ends up without a persona.
31
-
32
- ## Discovery and precedence
33
-
34
- Custom persona files are loaded from:
35
-
36
- - `~/.config/tau/personas/<id>.md` when the session `cwd` is inside the execution environment's home;
37
- - every ancestor `.tau/personas/<id>.md` from the broadest project level to the nearest.
38
-
39
- Built-ins come first, global custom personas override them, and the nearest project definition wins. IDs are compared case-insensitively when deciding which definition overrides which. The `id` inside a file must still match its filename without `.md` exactly, including case.
40
-
41
- For a session in `~/code/ledger/apps/api`, a project file at `~/code/ledger/apps/.tau/personas/release-coder.md` overrides the same ID from `~/code/ledger/.tau/personas/` or `~/.config/tau/personas/`.
42
-
43
- These locations are on the execution environment. An attached TUI does not add persona files to a remote session. See [configuration](configuration.md) and [ownership and scope](ownership-and-scope.md).
44
-
45
- ## Persona file contract
46
-
47
- A persona is a Markdown file with YAML frontmatter. `id`, `provider`, and `model` are required. The Markdown body is required, must not be empty, and becomes the persona's base system prompt.
7
+ A persona is a Markdown file whose body is the system prompt. For example, `.tau/personas/release-coder.md`:
48
8
 
49
9
  ```markdown
50
10
  ---
@@ -54,125 +14,69 @@ description: Prepares and verifies repository releases.
54
14
  provider: anthropic
55
15
  model: claude-opus-5-5
56
16
  reasoning: high
57
- allowedReasoningLevels:
58
- - medium
59
- - high
60
- - xhigh
61
- tools:
62
- - bash
63
- - write
64
- - edit
65
- - view_image
66
- - web
67
- - history
17
+ tools: [bash, write, edit, web, history]
68
18
  ---
69
19
 
70
- Work as a release engineer. Inspect repository policy before changing release state.
20
+ Work as a release engineer. Check the repository's release policy before changing anything.
71
21
  ```
72
22
 
73
- The frontmatter must be a YAML object between `---` lines. Unknown fields are ignored.
74
-
75
- ### Required fields
76
-
77
- | Field | Contract |
78
- | --- | --- |
79
- | `id` | Non-empty persona ID. It must exactly match the filename without `.md`. |
80
- | `provider` | Non-empty provider ID from the installed [model catalog](models.md). |
81
- | `model` | Non-empty model ID for that provider. It may be an ID missing from the catalog, as long as the provider is known. |
82
-
83
- Each custom persona is complete on its own. It does not inherit a provider, model, prompt, or settings from another persona.
84
-
85
- ### Optional fields
86
-
87
- | Field | Contract |
88
- | --- | --- |
89
- | `label` | Display label. A blank or omitted label falls back to `custom`. |
90
- | `description` | Short catalog description. |
91
- | `reasoning` | Default effort: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. |
92
- | `serviceTier` | `priority` or `flex`. Used only by `openai` and `openai-codex`. |
93
- | `allowedReasoningLevels` | Array of reasoning efforts offered by the TUI selector. |
94
- | `tools` | List of persona-selectable tools. |
95
- | `autoCompactThresholdTokens` | Default automatic-compaction threshold: a safe integer of at least 50,000 tokens. |
96
- | `subagentAutoCompactThresholdTokens` | Map from `<provider>/<model>` IDs (without reasoning effort) to safe integer thresholds of at least 50,000 tokens for native Tau subagents launched with that model. |
97
-
98
- For example, these optional frontmatter fields give the main conversation a 200,000-token default and explicit launches of one subagent model an 80,000-token default:
99
-
100
- ```yaml
101
- autoCompactThresholdTokens: 200000
102
- subagentAutoCompactThresholdTokens:
103
- openai/gpt-6.1-sol: 80000
23
+ Each persona stands alone and inherits nothing from another persona.
24
+
25
+ ```ts
26
+ type Frontmatter = {
27
+ id: string; // must match the filename without .md
28
+ provider: string;
29
+ model: string;
30
+ label?: string;
31
+ description?: string;
32
+ reasoning?: Reasoning; // default effort
33
+ allowedReasoningLevels?: Reasoning[]; // what Shift+Tab cycles through
34
+ serviceTier?: "priority" | "flex"; // openai and openai-codex only
35
+ tools?: ToolName[]; // default: all of them
36
+ autoCompactThresholdTokens?: number; // at least 50000
37
+ subagentAutoCompactThresholdTokens?: Record<string, number>; // keyed by "<provider>/<model>"
38
+ };
39
+
40
+ type Reasoning =
41
+ "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
42
+ type ToolName =
43
+ | "bash"
44
+ | "write"
45
+ | "edit"
46
+ | "view_image"
47
+ | "web"
48
+ | "history"
49
+ | "mcp"
50
+ | "models"
51
+ | "agents";
104
52
  ```
105
53
 
106
- In `subagentAutoCompactThresholdTokens` keys, the provider is lowercased and the model ID is kept exactly as written, so `OpenAI/gpt-6.1-sol` and `openai/gpt-6.1-sol` name the same model. The provider must be known. A model ID missing from the catalog is allowed, as for `model`. Claude Code models are not allowed because Claude Code manages its own compaction.
107
-
108
- Thresholds are capped at the selected model's context window minus 16,384 tokens. A session's `/auto-compact` override takes precedence over the persona default, and so does a Telegram bot's default threshold. See [sessions](sessions.md) and [subagents](subagents.md) for inheritance and reset behavior.
109
-
110
- Every persona can use all discovered skills. If a custom persona omits `tools`, Tau enables the standard tools and `agents`. A `tools` list without `agents` prevents the agent from starting or managing subagents. See [skills](skills.md) and [subagents](subagents.md) for those contracts.
111
-
112
- The selectable tool names are:
54
+ A `tools` list replaces the defaults, and `tools: []` turns all of them off. `tau_docs` and client tools are always unaffected. See [tools](tools.md).
113
55
 
114
- `bash`, `write`, `edit`, `view_image`, `web`, `history`, `mcp`, `models`, and `agents`.
56
+ An invalid persona is skipped with a warning.
115
57
 
116
- Names such as `web`, `history`, `mcp`, and `models` enable capabilities inside the `code` tool, and `bash` also enables `tau.bash`. `agents` enables `tau.agents` inside `code` and the `wait_for_agents` tool. Tau builds the `code` tool from whichever of these capabilities are selected and usable.
117
-
118
- A `tools` list replaces the defaults. Names are lowercased and duplicates removed. An unknown name makes the persona invalid. `tools: []` gives the persona none of these tools. The built-in `tau_docs` tool is always available, independent of this list. `mcp` works only when the session has enabled MCP servers, which a session on a remote execution environment never has. [Tools](tools.md) explains eligibility and ownership.
119
-
120
- ## Selecting a persona
58
+ ## Where personas load from
121
59
 
122
- `defaultPersona` in `config.json` selects the startup default. It accepts an exact persona ID or an ID plus reasoning override:
60
+ Tau looks in these locations on the execution environment, and later ones win. A persona with a built-in's ID replaces it.
123
61
 
124
- ```json
125
- {
126
- "defaultPersona": "release-coder:high"
127
- }
62
+ ```text
63
+ built-in personas
64
+ ~/.config/tau/personas/<id>.md only when cwd is inside home
65
+ <ancestor>/.tau/personas/<id>.md from broadest to nearest
128
66
  ```
129
67
 
130
- The most specific `defaultPersona` wins. The ID must match exactly, including case. An unknown default produces a warning, and Tau uses the first available persona. Telegram [workspace startup and presets](telegram.md#startup-and-presets) select the default the same way.
131
-
132
- Override the default for one TUI launch:
68
+ ## Selecting a persona
133
69
 
134
70
  ```sh
135
71
  tau --persona release-coder:xhigh
136
72
  ```
137
73
 
138
- `-p` is the short form. The same `<id>:<effort>` syntax and reasoning enum apply.
139
-
140
- Inside the TUI, switch while idle with:
141
-
142
- ```text
143
- /persona:release-coder
74
+ ```json
75
+ { "defaultPersona": "release-coder:high" }
144
76
  ```
145
77
 
146
- This command matches the ID case-insensitively. `Ctrl+P` cycles through the available personas. A switch reloads configuration and content from the execution environment, applies the new persona, rebuilds project and skill context and the tool set, and saves the new session settings. The TUI refuses to switch while a turn is running.
147
-
148
- ## Reasoning and service tier
149
-
150
- `reasoning` is the persona's default effort. A startup suffix, the session reasoning command, or `Shift+Tab` can override it. You can change reasoning while a turn is running, but the running turn keeps the model and tool settings it started with. The new effort applies from the next submitted or queued turn.
151
-
152
- `allowedReasoningLevels` sets which values the TUI cycles through for the persona. It also limits an effort passed to `setPersona`, including a Telegram preset's `reasoning`. TUI startup suffixes, `defaultPersona` suffixes, and `session.setReasoning` can still set other levels. When it is omitted, the TUI offers all standard levels for a model that supports reasoning. For a model whose catalog entry says `reasoning: false`, the selector shows only `none`.
153
-
154
- An empty `allowedReasoningLevels` does not create an empty selector. The TUI uses its normal model-aware choices.
155
-
156
- `serviceTier` is sent with OpenAI and OpenAI Codex requests. `priority` requests the provider's priority service, and `flex` requests flex service. Whether the tier is available, how it is billed, and whether requests are rejected depend on your provider account. Other providers ignore this setting.
157
-
158
- ## Reloading changes
159
-
160
- After editing personas, skills, or project context, run `/reload` while the session is idle. Reload finds personas again and rebuilds the session's prompt and tools.
161
-
162
- If the current persona ID still exists, Tau applies its newly loaded definition and keeps the session's current settings, including reasoning and service tier. Selecting the persona again applies its declared defaults. If the ID is gone, Tau selects the first available persona. Existing messages stay as they are; a persona change never rewrites earlier history.
163
-
164
- The TUI refuses to reload while a turn is running. Existing subagents keep the setup they started with, and children they launch later inherit that setup. Subagents that the main agent starts after the reload use the reloaded persona. See [subagents](subagents.md).
165
-
166
- ## Validation and common mistakes
167
-
168
- An invalid persona is skipped and reported as a configuration warning. Other valid personas still load. Frequent causes are:
78
+ Inside the TUI, use `/persona:release-coder` or Ctrl+P while idle. A switch applies to later turns and keeps the conversation. Shift+Tab changes reasoning, which applies from the next turn.
169
79
 
170
- - malformed YAML, missing frontmatter delimiters, or frontmatter that is not an object;
171
- - missing `id`, `provider`, `model`, or a non-empty prompt body;
172
- - an `id` that does not exactly match the filename;
173
- - an unknown provider or an unresolved model;
174
- - an invalid reasoning effort or service tier;
175
- - an automatic-compaction threshold below 50,000, or a `subagentAutoCompactThresholdTokens` key with an unknown provider or the `claude-code` provider;
176
- - an unknown persona tool.
80
+ ## Changing a persona file
177
81
 
178
- `/reload` shows warnings, with file paths, in the transcript. For a new local session, `tau --debug --persona <id>` shows the selected model, settings, skills, subagents, tools, and the complete prompt. If an edit seems to have no effect in a remote session, confirm the session's execution environment and `cwd` before editing another copy of the file. [Troubleshooting](troubleshooting.md) covers that check in more detail.
82
+ Run `/reload` while idle. If the current ID still exists, Tau applies its new definition and keeps the session's reasoning and service tier. Otherwise Tau selects the first available persona. Running subagents keep the setup they started with.