@kingingwang/pi-windows-x64 0.87.0 → 0.99.1

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 (76) hide show
  1. package/bin/CHANGELOG.md +121 -0
  2. package/bin/README.md +25 -711
  3. package/bin/docs/cli-integration.md +106 -0
  4. package/bin/docs/cli.md +329 -0
  5. package/bin/docs/compaction.md +22 -22
  6. package/bin/docs/configuration.md +47 -0
  7. package/bin/docs/containerization.md +109 -82
  8. package/bin/docs/custom-provider.md +109 -722
  9. package/bin/docs/docs.json +147 -99
  10. package/bin/docs/environment-variables.md +3 -5
  11. package/bin/docs/extensions.md +165 -2996
  12. package/bin/docs/how-pi-works.md +49 -0
  13. package/bin/docs/images/interactive-mode.png +0 -0
  14. package/bin/docs/index.md +24 -69
  15. package/bin/docs/json.md +193 -65
  16. package/bin/docs/keybindings.md +58 -103
  17. package/bin/docs/llama-cpp.md +16 -3
  18. package/bin/docs/mcp.md +188 -0
  19. package/bin/docs/message-types.md +261 -0
  20. package/bin/docs/models.md +81 -556
  21. package/bin/docs/packages.md +67 -166
  22. package/bin/docs/prompt-templates.md +31 -68
  23. package/bin/docs/providers.md +103 -240
  24. package/bin/docs/quickstart.md +61 -106
  25. package/bin/docs/rpc-commands.md +860 -0
  26. package/bin/docs/rpc-extension-ui.md +200 -0
  27. package/bin/docs/rpc.md +130 -1555
  28. package/bin/docs/sdk.md +79 -1169
  29. package/bin/docs/security.md +72 -32
  30. package/bin/docs/session-format.md +15 -215
  31. package/bin/docs/sessions.md +35 -141
  32. package/bin/docs/settings.md +117 -377
  33. package/bin/docs/shell-aliases.md +85 -5
  34. package/bin/docs/skills.md +51 -190
  35. package/bin/docs/slash-commands.md +60 -0
  36. package/bin/docs/terminal-setup.md +105 -78
  37. package/bin/docs/termux.md +74 -83
  38. package/bin/docs/themes.md +88 -274
  39. package/bin/docs/tmux.md +31 -39
  40. package/bin/docs/tui.md +74 -910
  41. package/bin/docs/usage.md +54 -272
  42. package/bin/docs/virtual-models.md +114 -0
  43. package/bin/docs/windows.md +45 -17
  44. package/bin/examples/README.md +13 -2
  45. package/bin/examples/extensions/README.md +2 -0
  46. package/bin/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  47. package/bin/examples/extensions/custom-provider-anthropic/package.json +1 -1
  48. package/bin/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  49. package/bin/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  50. package/bin/examples/extensions/debug-provider.ts +90 -0
  51. package/bin/examples/extensions/gondolin/package-lock.json +2 -2
  52. package/bin/examples/extensions/gondolin/package.json +1 -1
  53. package/bin/examples/extensions/jev-router.ts +113 -0
  54. package/bin/examples/extensions/sandbox/package-lock.json +2 -2
  55. package/bin/examples/extensions/sandbox/package.json +1 -1
  56. package/bin/examples/extensions/with-deps/package-lock.json +2 -2
  57. package/bin/examples/extensions/with-deps/package.json +1 -1
  58. package/bin/examples/rpc-client.ts +35 -0
  59. package/bin/examples/rpc-extension-ui.ts +26 -6
  60. package/bin/examples/sdk/14-codemode-mcp.ts +61 -0
  61. package/bin/examples/sdk/README.md +3 -2
  62. package/bin/export-html/ansi-to-html.d.ts.map +1 -1
  63. package/bin/export-html/ansi-to-html.js.map +1 -1
  64. package/bin/export-html/index.d.ts.map +1 -1
  65. package/bin/export-html/index.js.map +1 -1
  66. package/bin/export-html/template.css +10 -0
  67. package/bin/export-html/template.js +66 -17
  68. package/bin/export-html/tool-renderer.d.ts.map +1 -1
  69. package/bin/export-html/tool-renderer.js.map +1 -1
  70. package/bin/package.json +14 -12
  71. package/bin/pi.exe +2 -2
  72. package/bin/theme/dark.json +59 -72
  73. package/bin/theme/light.json +57 -69
  74. package/bin/theme/theme-schema.json +7 -2
  75. package/package.json +1 -1
  76. package/bin/docs/development.md +0 -90
@@ -1,431 +1,171 @@
1
- # Settings
1
+ # Settings Reference
2
2
 
3
- Pi uses JSON settings files with project settings overriding global settings.
3
+ This reference lists user-configurable settings, their types, defaults, and purposes. Project settings override agent-directory settings. Resource lists are combined. See [Configuration](configuration.md) for file locations and trust behavior.
4
4
 
5
- | Location | Scope |
6
- |----------|-------|
7
- | `~/.pi/agent/settings.json` | Global (all projects) |
8
- | `.pi/settings.json` | Project (current directory) |
5
+ ## Model and thinking
9
6
 
10
- Edit directly or use `/settings` for common options. To save startup model defaults interactively, use `/model` and press Ctrl+S on the desired model. To save the startup thinking level, use `/thinking` and press Ctrl+S.
11
-
12
- ## Project Trust
13
-
14
- On interactive startup, pi asks before trusting a project folder that contains project-local settings, resources, or project `.agents/skills` and has no saved decision for the folder or a parent folder in `~/.pi/agent/trust.json`. Trusting a project allows pi to load `.pi/settings.json` and `.pi` resources, install missing project packages, and execute project extensions.
15
-
16
- Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore those project resources, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
17
-
18
- If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.pi/agent/settings.json`, or change it with `/settings`.
19
-
20
- `pi config` and package commands use the same project trust flow, except `pi update` never prompts. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
21
-
22
- Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.pi/agent/trust.json` only; the current session is not reloaded, so restart pi for changes to take effect.
23
-
24
- ## All Settings
25
-
26
- ### Model & Thinking
7
+ <a id="model-cycling"></a>
27
8
 
28
9
  | Setting | Type | Default | Description |
29
- |---------|------|---------|-------------|
30
- | `defaultProvider` | string | - | Startup provider (e.g., `"anthropic"`, `"openai"`; saved with Ctrl+S in `/model`, or edited manually) |
31
- | `defaultModel` | string | - | Startup model ID (saved with Ctrl+S in `/model`, or edited manually) |
32
- | `defaultThinkingLevel` | string | - | Startup thinking level (saved with Ctrl+S in `/thinking`, or edited manually): `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"` |
33
- | `modelThinkingLevels` | object | - | Per-model startup thinking levels keyed by `"provider/modelId"`; configure from `/settings` → Default thinking level per model or edit manually |
34
- | `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
35
- | `showCacheMissNotices` | boolean | `false` | Show transcript notices for significant prompt-cache misses, successful cache-warming usage, compaction or branch-summary usage, and provider recovery diagnostics such as dropped Anthropic thinking blocks |
36
- | `thinkingBudgets` | object | - | Custom token budgets per thinking level. Anthropic, Google, and Bedrock use these natively. OpenAI-compatible models use them when `compat.thinkingTokenBudgetField` (or `supportsThinkingTokenBudget`) is set. |
37
- | `cacheWarming` | string | `"streaming"` | Prompt cache-warming mode: `"off"`, `"streaming"`, or `"idle"`. Global setting only. |
38
-
39
- #### Cache Warming
40
-
41
- Providers drop a prompt cache entry after a period of inactivity, so the first request after a pause pays full input price again. Cache warming re-sends the last request with a one-token output budget shortly before expiry:
42
-
43
- - `"off"` disables warming.
44
- - `"streaming"` protects expensive prefixes during long tool executions and stops as soon as the agent settles.
45
- - `"idle"` also considers refreshes while waiting for your next prompt, using a fixed 15% continuation probability measured from real usage.
46
-
47
- ```json
48
- {
49
- "cacheWarming": "idle"
50
- }
51
- ```
52
-
53
- A refresh is sent only when the expected avoided cache-miss cost, minus the cost of the refresh, leaves at least $0.05 of expected savings. Active agent runs use 100% continuation probability. `/session` shows the next decision, continuation probability, expected savings, threshold, and estimated costs. When cache miss notices are enabled, each successful refresh appears in the transcript with its cost; notices identify extension overrides.
54
-
55
- Warming stops when the context changes (model switch, compaction, branch navigation). Idle warming stops no later than 30 minutes after the last real provider request; warming during an active agent run stops after 60 minutes. Extensions can override each decision through the [`cache_warming_decision`](extensions.md#cache_warming_decision) event.
10
+ |---|---|---|---|
11
+ | `defaultProvider` | string | Automatic | Startup AI provider. |
12
+ | `defaultModel` | string | Automatic | Startup model ID. |
13
+ | `defaultThinkingLevel` | `"off" \| "minimal" \| "low" \| "medium" \| "high" \| "xhigh" \| "max"` | `"medium"` | Startup thinking level. |
14
+ | `modelThinkingLevels` | object | None | Per-model startup thinking levels keyed by exact `provider/modelId`. |
15
+ | `thinkingBudgets` | object | Built-in budgets | Token budgets for `minimal`, `low`, `medium`, and `high` thinking levels. |
16
+ | `enabledModels` | `string[]` | All available models | Model patterns used for startup selection and model cycling. Uses the same format as `--models`. |
17
+ | `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in the transcript. |
18
+ | `showCacheMissNotices` | boolean | `false` | Show notices for significant cache misses, successful cache warming, compaction usage, and provider recovery. |
19
+ | `cacheWarming` | `"off" \| "streaming" \| "idle"` | `"streaming"` | Keep eligible provider prompt caches warm during active runs or, with `"idle"`, between runs. Global setting only. |
56
20
 
57
- Each refresh is billed as a cache read of the full context plus one output token. Usage and cost show up in session totals but never enter model context. Pi schedules candidates at 90% of the cache lifetime while leaving at least ten seconds before expiry.
21
+ Cache warming runs only when the model declares a cache lifetime and Pi estimates at least $0.05 in avoided cache-miss cost. Refresh usage counts toward session totals but does not enter model context. `/session` shows the next decision; extensions can override it with `cache_warming_decision`. See [Prompt Cache Lifetimes](models.md#prompt-cache-lifetimes).
58
22
 
59
- Warming needs a known cache lifetime for the model and the retention tier the request used (`short`, or `long` with `PI_CACHE_RETENTION=long`). The built-in catalog carries lifetimes for direct Anthropic; custom models and other providers can declare theirs with `promptCache` in `models.json` (see [Prompt Cache Lifetimes](models.md#prompt-cache-lifetimes)). Claude models that use budget-based rather than adaptive thinking are skipped while thinking is on, because Anthropic derives the thinking budget from `max_tokens` and keys the message cache on it, so a one-token request cannot reproduce the entry.
23
+ See [Choose a Model](models.md) for model selection and thinking controls.
60
24
 
61
- #### thinkingBudgets
62
-
63
- ```json
64
- {
65
- "thinkingBudgets": {
66
- "minimal": 1024,
67
- "low": 4096,
68
- "medium": 10240,
69
- "high": 32768
70
- }
71
- }
72
- ```
73
-
74
- ### UI & Display
25
+ ## Interaction
75
26
 
76
27
  | Setting | Type | Default | Description |
77
- |---------|------|---------|-------------|
78
- | `theme` | string | `"dark"` | Theme name (`"dark"`, `"light"`, or custom) |
79
- | `externalEditor` | string | `$VISUAL`, then `$EDITOR`, then Notepad on Windows or `nano` elsewhere | Command for Ctrl+G external editor; takes precedence over environment variables |
80
- | `quietStartup` | boolean | `false` | Hide startup header |
81
- | `defaultProjectTrust` | string | `"ask"` | Fallback project trust behavior: `"ask"`, `"always"`, or `"never"`. Global setting only |
82
- | `collapseChangelog` | boolean | `false` | Show condensed changelog after updates |
83
- | `enableInstallTelemetry` | boolean | `true` | Send the anonymous install/update ping and selected provider attribution headers. This does not control update checks |
84
- | `enableAnalytics` | boolean | `false` | Opt-in analytics data sharing. Currently only asked for during the experimental first-time setup (`PI_EXPERIMENTAL=1`) |
85
- | `trackingId` | string | - | Analytics tracking identifier, generated when `enableAnalytics` is turned on |
86
- | `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"` |
87
- | `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
88
- | `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
89
- | `outputPad` | number | `1` | Horizontal padding for user messages, assistant messages, and thinking (0 or 1) |
90
- | `autocompleteMaxVisible` | number | `5` | Max visible items in autocomplete dropdown (3-20) |
91
- | `showHardwareCursor` | boolean | `false` | Show the terminal cursor while TUI positions it for IME support |
92
- | `tuiMode` | string | `"regular"` | Interactive TUI mode: `"regular"` or experimental `"fullscreen"`. Changes from `/settings` apply immediately; `--tui-mode` overrides this setting at startup |
93
- | `fullscreenExitOutput` | string | `"transcript"` | Fullscreen exit output: `"transcript"` prints the final transcript and resume hint, while `"resume-hint"` restores the previous screen and prints only the resume hint. Has no effect in regular TUI mode |
94
- | `fullscreenScrollbar` | string | `"auto"` | Fullscreen transcript scrollbar: `"auto"` shows it temporarily while scrolling or while the pointer is over its rightmost-column track, `"always"` reserves that column and keeps it visible, and `"hidden"` hides it. Has no effect in regular TUI mode |
95
- | `fullscreenCopyOnSelect` | boolean | `true` | Automatically copy selected text in fullscreen mode. When disabled, selections stay highlighted and `Ctrl+X` copies the active selection |
96
-
97
- For VS Code, include `--wait` so pi resumes after the editor exits:
98
-
99
- ```json
100
- {
101
- "externalEditor": "code --wait"
102
- }
103
- ```
104
-
105
- ### Telemetry and update checks
106
-
107
- `enableInstallTelemetry` controls the anonymous install/update ping to `https://pi.dev/api/report-install` and Pi attribution headers for OpenRouter, NVIDIA NIM, and Cloudflare provider requests. Opting out disables both. It does not disable update checks; Pi can still fetch `https://pi.dev/api/latest-version` to look for the latest version.
108
-
109
- Set `PI_SKIP_VERSION_CHECK=1` to disable the Pi version update check. Use `--offline` or `PI_OFFLINE=1` to disable all startup network operations described here, including update checks, package update checks, and install/update telemetry.
28
+ |---|---|---|---|
29
+ | `steeringMode` | `"all" \| "one-at-a-time"` | `"one-at-a-time"` | How queued steering messages are delivered. |
30
+ | `followUpMode` | `"all" \| "one-at-a-time"` | `"one-at-a-time"` | How queued follow-up messages are delivered. |
31
+ | `externalEditor` | string | `$VISUAL`, `$EDITOR`, then platform default | Command opened by the external-editor keybinding. |
32
+ | `doubleEscapeAction` | `"tree" \| "fork" \| "none"` | `"tree"` | Action for double Escape with an empty editor. |
33
+ | `treeFilterMode` | `"default" \| "no-tools" \| "user-only" \| "labeled-only" \| "all"` | `"default"` | Initial filter used by `/tree`. |
34
+ | `defaultProjectTrust` | `"ask" \| "always" \| "never"` | `"ask"` | Fallback project-trust behavior. **Can only be set in agent-directory settings.** |
110
35
 
111
- ### Network
36
+ ## Tools
112
37
 
113
38
  | Setting | Type | Default | Description |
114
- |---------|------|---------|-------------|
115
- | `httpProxy` | string | - | HTTP proxy URL applied as `HTTP_PROXY` and `HTTPS_PROXY`. Global setting only. |
39
+ |---|---|---|---|
40
+ | `defaultTools` | `string[]` | `read`, `bash`, `edit`, `write` | Tools enabled at startup. Plain names replace the defaults; `+name` adds a tool and `-name` removes one. An empty array disables all built-in tools but not extension or SDK tools. |
41
+ | `codemode.mode` | `"on"` \| `"only"` | `"on"` | How the `codemode` tool presents tools while it is active. `on`: declared tools get their `codemode` declaration appended to their description, and `codemode` lists only tools that are not declared (MCP `codemode` exposure). `only`: `codemode` lists every tool scripts can call, and active built-in and extension tools are hidden from the model, so it reaches them through `codemode`. |
42
+ | `codemode.inlineBudget` | number | `3000` | Estimated tokens (characters / 4) the `codemode` tool's description may spend on tool declarations. Tools that do not fit are left out and found with `searchTools()`. `0` lists only namespaces. |
116
43
 
117
- ```json
118
- {
119
- "httpProxy": "http://127.0.0.1:7890"
120
- }
121
- ```
44
+ Available built-in tools are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`. `defaultTools` can also name `codemode` and `tool_search`, which built-in extensions register inactive, and other extension tools registered inactive.
122
45
 
123
- ### Warnings
124
-
125
- | Setting | Type | Default | Description |
126
- |---------|------|---------|-------------|
127
- | `warnings.anthropicExtraUsage` | boolean | `true` | Show a warning when Anthropic subscription auth may use paid extra usage |
128
-
129
- ```json
130
- {
131
- "warnings": {
132
- "anthropicExtraUsage": false
133
- }
134
- }
135
- ```
136
-
137
- ### Compaction
138
-
139
- | Setting | Type | Default | Description |
140
- |---------|------|---------|-------------|
141
- | `compaction.enabled` | boolean | `true` | Enable auto-compaction |
142
- | `compaction.reserveTokens` | number | `16384` | Tokens reserved for LLM response |
143
- | `compaction.keepRecentTokens` | number | `20000` | Recent tokens to keep (not summarized) |
144
- | `compaction.modelOverrides` | object | - | Per-model `reserveTokens` and `keepRecentTokens` overrides keyed by exact `"provider/modelId"` |
46
+ A list of only `+name` and `-name` entries changes the inherited selection instead of replacing it. For example, this enables `codemode` next to the default tools:
145
47
 
146
48
  ```json
147
49
  {
148
- "compaction": {
149
- "enabled": true,
150
- "reserveTokens": 16384,
151
- "keepRecentTokens": 20000
152
- }
50
+ "defaultTools": ["+codemode"]
153
51
  }
154
52
  ```
155
53
 
156
- #### Per-model compaction overrides
157
-
158
- ```json
159
- {
160
- "compaction": {
161
- "enabled": true,
162
- "reserveTokens": 16384,
163
- "keepRecentTokens": 20000,
164
- "modelOverrides": {
165
- "some-provider/big-model": {
166
- "reserveTokens": 400000
167
- },
168
- "local/small-model": {
169
- "reserveTokens": 2048,
170
- "keepRecentTokens": 4096
171
- }
172
- }
173
- }
174
- }
175
- ```
176
-
177
- Keys match exact, case-sensitive `provider/modelId` values, not names or glob patterns. Model IDs may contain slashes (for example, `openrouter/anthropic/claude-sonnet-4`).
178
-
179
- Each token setting resolves independently: matching model override → ordinary `compaction` setting → built-in default. In the example, `some-provider/big-model` keeps the ordinary 20000 recent tokens. Token values must be non-negative safe integers. Invalid values in the matching model override produce an error when read; only omitted fields fall back to the ordinary setting. Model override entries must be objects. Invalid ordinary token settings produce an error when read, even if the active model has a valid override. Only omitted ordinary values use built-in defaults. Zero is accepted, but `reserveTokens: 0` leaves no response margin and also sets the summarization output budget to zero.
54
+ This replaces `bash` with `powershell` and enables `grep`: `["-bash", "+powershell", "+grep"]`. Project settings apply on top of user settings: a project list with only `+name` and `-name` entries changes the user's selection, and a project list with a plain name replaces it. In one list, plain names form the selection, and `+name` and `-name` then apply in order.
180
55
 
181
- Global and project settings merge recursively **before** model lookup. A project can override one field for a model without replacing its other fields or other models. A global model-specific value takes precedence over a project-wide fallback; override the same model entry in the project to change it.
56
+ CLI tool options override this setting for one invocation; `--tools` does not accept `+name` or `-name`. See [Command Line](cli.md#tools).
182
57
 
183
- `enabled` is not model-specific. The active model's token settings apply to manual compaction, automatic threshold checks (including between assistant turns), and overflow recovery. Switching models takes effect on the next check or compaction. Configure overrides in JSON; `/settings` retains the ordinary auto-compaction toggle.
184
-
185
- See [compaction.md](compaction.md) for trigger and summarization behavior.
186
-
187
- ### Branch Summary
58
+ ## Sessions and context
188
59
 
189
60
  | Setting | Type | Default | Description |
190
- |---------|------|---------|-------------|
191
- | `branchSummary.reserveTokens` | number | `16384` | Tokens reserved when selecting branch history; output is capped at 4096 tokens |
192
- | `branchSummary.skipPrompt` | boolean | `false` | Skip "Summarize branch?" prompt on `/tree` navigation (defaults to no summary) |
61
+ |---|---|---|---|
62
+ | `sessionDir` | string | Agent session directory | Session storage directory. Relative paths resolve from the working directory. `PI_CODING_AGENT_SESSION_DIR` and `--session-dir` override this setting. |
193
63
 
194
- ### Retry
64
+ ### Compaction
195
65
 
196
66
  | Setting | Type | Default | Description |
197
- |---------|------|---------|-------------|
198
- | `retry.enabled` | boolean | `true` | Enable automatic agent-level retry |
199
- | `retry.maxRetries` | number or null | `null` | Maximum agent-level retry attempts; `null` retries without a limit |
200
- | `retry.baseDelayMs` | number | `2000` | Base delay for agent-level exponential backoff |
201
- | `retry.maxBackoffMs` | number | `600000` | Maximum agent-level backoff delay (10 minutes) |
202
- | `retry.maxUnauthorizedRetries` | number | `5` | Maximum retry attempts for HTTP 401/authentication failures |
203
- | `retry.provider.timeoutMs` | number | SDK default | Provider/SDK request timeout in milliseconds |
204
- | `retry.provider.maxRetries` | number | `0` | Provider/SDK retry attempts |
205
- | `retry.provider.maxRetryDelayMs` | number | `60000` | Max server-requested delay before failing (60s) |
206
-
207
- Agent-level retry covers HTTP provider errors, transport and stream disconnections, empty assistant responses, and responses containing only thinking without text or tool calls. HTTP 401/authentication failures remain bounded by `retry.maxUnauthorizedRetries`; other retryable failures use `retry.maxRetries`, which is unlimited by default. Exponential backoff never exceeds `retry.maxBackoffMs`.
67
+ |---|---|---|---|
68
+ | `compaction.enabled` | boolean | `true` | Enable automatic compaction. |
69
+ | `compaction.reserveTokens` | number | `16384` | Tokens reserved for the model response. |
70
+ | `compaction.keepRecentTokens` | number | `20000` | Recent tokens retained without summarization. |
71
+ | `compaction.modelOverrides` | object | None | Per-model token settings keyed by exact `provider/modelId`. |
208
72
 
209
- When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs`, the request fails immediately with an informative error instead of waiting silently. Set it to `0` to disable the limit.
73
+ <a id="per-model-compaction-overrides"></a>
210
74
 
211
- Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explicitly needed. Setting it above `0` can make SDK/provider retries handle out-of-usage-limit errors before Pi sees them, which may block the agent until the provider quota resets in some circumstances.
75
+ Compaction token values must be non-negative safe integers. Each value resolves independently from the matching model override, then the ordinary compaction setting, then the built-in default. Project and user objects merge before model lookup.
212
76
 
213
- ```json
214
- {
215
- "retry": {
216
- "enabled": true,
217
- "maxRetries": null,
218
- "baseDelayMs": 2000,
219
- "maxBackoffMs": 600000,
220
- "maxUnauthorizedRetries": 5,
221
- "provider": {
222
- "timeoutMs": 3600000,
223
- "maxRetries": 0,
224
- "maxRetryDelayMs": 60000
225
- }
226
- }
227
- }
228
- ```
77
+ See [Compaction Reference](compaction.md) for trigger, summarization, and validation behavior.
229
78
 
230
- ### Message Delivery
79
+ ### Branch summaries
231
80
 
232
81
  | Setting | Type | Default | Description |
233
- |---------|------|---------|-------------|
234
- | `steeringMode` | string | `"one-at-a-time"` | How steering messages are sent: `"all"` or `"one-at-a-time"` |
235
- | `followUpMode` | string | `"one-at-a-time"` | How follow-up messages are sent: `"all"` or `"one-at-a-time"` |
236
- | `nonStreaming` | boolean | `false` | Request a single non-streaming response from capable providers. Currently supported by `openai-completions` APIs. |
237
- | `transport` | string | `"auto"` | Preferred transport for providers that support multiple transports: `"sse"`, `"websocket"`, `"websocket-cached"`, or `"auto"` |
238
- | `httpIdleTimeoutMs` | number | `300000` | HTTP header/body idle timeout in milliseconds, also used by providers with explicit stream idle timeouts. Set to `0` to disable. |
239
- | `websocketConnectTimeoutMs` | number | `15000` | WebSocket connect/open handshake timeout in milliseconds for providers that support WebSocket transports. Set to `0` to disable. |
82
+ |---|---|---|---|
83
+ | `branchSummary.reserveTokens` | number | `16384` | Tokens reserved when summarizing branch history. |
84
+ | `branchSummary.skipPrompt` | boolean | `false` | Skip the branch-summary prompt and default to no summary. |
240
85
 
241
- ### Terminal & Images
86
+ ## Terminal and display
242
87
 
243
88
  | Setting | Type | Default | Description |
244
- |---------|------|---------|-------------|
245
- | `terminal.showImages` | boolean | `true` | Show images in terminal (if supported) |
246
- | `terminal.imageWidthCells` | number | `60` | Preferred inline image width in terminal cells |
247
- | `terminal.clearOnShrink` | boolean | `false` | Clear empty rows when content shrinks (can cause flicker) |
248
- | `terminal.hyperlinks` | boolean or `"auto"` | `"auto"` | Override OSC 8 hyperlink support (advanced, JSON-only) |
249
- | `terminal.images` | string or boolean | `"auto"` | Override image protocol support with `"kitty"`, `"iterm2"`, `false`, or `"auto"` (advanced, JSON-only) |
250
- | `terminal.trueColor` | boolean or `"auto"` | `"auto"` | Override truecolor support (advanced, JSON-only) |
251
- | `images.autoResize` | boolean | `true` | Resize images to 2000x2000 max. Applies to `@file` attachments, `read`, and images returned by tools |
252
- | `images.blockImages` | boolean | `false` | Block all images from being sent to LLM |
253
-
254
- ### Shell
89
+ |---|---|---|---|
90
+ | `theme` | string | `"system"` | Built-in or custom theme name. `system` derives colors from the terminal theme. |
91
+ | `quietStartup` | boolean | `false` | Hide the startup header. |
92
+ | `tuiMode` | `"regular" \| "fullscreen"` | `"regular"` | Interactive terminal UI mode. |
93
+ | `fullscreenExitOutput` | `"transcript" \| "resume-hint"` | `"transcript"` | Output printed when fullscreen mode exits. |
94
+ | `fullscreenScrollbar` | `"auto" \| "always" \| "hidden"` | `"auto"` | Fullscreen transcript scrollbar behavior. |
95
+ | `fullscreenCopyOnSelect` | boolean | `true` | Copy selected text automatically in fullscreen mode. |
96
+ | `fullscreenWheelScrollLines` | `"auto"` \| number | `"auto"` | Lines per mouse-wheel event in fullscreen mode, from 1 to 100. `"auto"` moves one line per event in local macOS terminals, which already accelerate wheel and trackpad input; elsewhere, and over SSH, it speeds up fast wheel spins to at most 6 lines per event. Alt+wheel moves five times as far. |
97
+ | `editorPaddingX` | number | `0` | Horizontal editor padding from 0 to 3 cells. |
98
+ | `outputPad` | `0 \| 1` | `1` | Horizontal transcript padding. |
99
+ | `autocompleteMaxVisible` | number | `5` | Visible autocomplete entries, from 3 to 20. |
100
+ | `showHardwareCursor` | boolean | `false` | Show the terminal cursor while Pi positions it for input methods. |
101
+ | `terminal.showImages` | boolean | `true` | Display inline images when supported. |
102
+ | `terminal.imageWidthCells` | number | `60` | Preferred inline image width in terminal cells. |
103
+ | `terminal.clearOnShrink` | boolean | `false` | Clear empty rows when rendered content shrinks. |
104
+ | `terminal.showTerminalProgress` | boolean | `false` | Show OSC 9;4 progress in the terminal tab. |
105
+ | `terminal.hyperlinks` | `boolean \| "auto"` | `"auto"` | Override OSC 8 hyperlink detection. |
106
+ | `terminal.images` | `"kitty" \| "iterm2" \| "auto" \| false` | `"auto"` | Override inline-image protocol detection. |
107
+ | `terminal.trueColor` | `boolean \| "auto"` | `"auto"` | Override true-color detection. |
108
+ | `images.autoResize` | boolean | `true` | Resize images to at most 2000 by 2000 pixels before sending them to a model. |
109
+ | `images.blockImages` | boolean | `false` | Prevent images from being sent to models. |
110
+ | `markdown.codeBlockIndent` | string | `" "` | Prefix used to indent rendered code blocks. |
111
+ | `markdown.mermaid` | `"off" \| "final" \| "streaming"` | `"streaming"` | Mermaid rendering mode. |
112
+
113
+ See [Themes](themes.md) and [Terminal Setup](terminal-setup.md) for format and platform details.
114
+
115
+ ## Network and retries
255
116
 
256
117
  | Setting | Type | Default | Description |
257
- |---------|------|---------|-------------|
258
- | `shellPath` | string | - | Custom shell path (e.g., for Cygwin on Windows); supports a leading `~` for the home directory |
259
- | `shellCommandPrefix` | string | - | Prefix for every bash command (e.g., `"shopt -s expand_aliases"`) |
260
- | `npmCommand` | string[] | - | Command argv used for npm package lookup/install operations (e.g., `["mise", "exec", "node@20", "--", "npm"]`) |
261
-
262
- Windows paths in JSON must use forward slashes or escaped backslashes:
263
-
264
- ```json
265
- {
266
- "shellPath": "C:/Program Files/Git/bin/bash.exe"
267
- }
268
- ```
269
-
270
- ```json
271
- {
272
- "shellPath": "C:\\Program Files\\Git\\bin\\bash.exe"
273
- }
274
- ```
275
-
276
- ```json
277
- {
278
- "npmCommand": ["mise", "exec", "node@20", "--", "npm"]
279
- }
280
- ```
281
-
282
- `npmCommand` is used for all npm package-manager operations, including installs, uninstalls, and dependency installs inside git packages. User-scoped npm packages install under `~/.pi/agent/npm/`; project-scoped npm packages install under `.pi/npm/`. Use argv-style entries exactly as the process should be launched. When `npmCommand` is configured, git package dependency installs use plain `install` to avoid npm-specific flags in wrappers or alternate package managers.
283
-
284
- ### Tools
285
-
286
- | Setting | Type | Default | Description |
287
- |---------|------|---------|-------------|
288
- | `defaultTools` | string[] | - | Built-in tools enabled initially. When omitted, Pi uses its standard defaults |
289
-
290
- `defaultTools` selects the built-in tools enabled at startup. Extension and SDK custom tools remain enabled. Available built-ins are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`:
291
-
292
- ```json
293
- {
294
- "defaultTools": ["bash", "edit", "write"]
295
- }
296
- ```
297
-
298
- On Windows, select `powershell` instead of `bash`, or include both:
118
+ |---|---|---|---|
119
+ | `transport` | `"auto" \| "sse" \| "websocket" \| "websocket-cached"` | `"auto"` | Preferred transport for AI providers that support multiple transports. |
120
+ | `httpProxy` | string | None | Proxy URL applied as `HTTP_PROXY` and `HTTPS_PROXY` for Pi-managed HTTP clients. **Can only be set in agent-directory settings.** |
121
+ | `httpIdleTimeoutMs` | number | `300000` | HTTP header and body idle timeout in milliseconds. Set to `0` to disable. |
122
+ | `websocketConnectTimeoutMs` | number | `15000` | WebSocket connection timeout in milliseconds. Set to `0` to disable. |
123
+ | `nonStreaming` | boolean | `false` | Request a single non-streaming response from capable providers. Currently supported by `openai-completions` APIs. |
124
+ | `retry.enabled` | boolean | `true` | Enable automatic agent-level retry. |
125
+ | `retry.maxRetries` | number or null | `null` | Maximum agent-level retry attempts; `null` retries without a limit. |
126
+ | `retry.baseDelayMs` | number | `2000` | Base delay for agent-level exponential backoff. |
127
+ | `retry.maxBackoffMs` | number | `600000` | Maximum agent-level backoff delay (10 minutes). |
128
+ | `retry.maxUnauthorizedRetries` | number | `5` | Maximum retry attempts for HTTP 401/authentication failures. |
129
+ | `retry.provider.timeoutMs` | number | `httpIdleTimeoutMs` | Provider request timeout in milliseconds. |
130
+ | `retry.provider.maxRetries` | number | `0` | Provider-level retry attempts. |
131
+ | `retry.provider.maxRetryDelayMs` | number | `60000` | Maximum server-requested delay in milliseconds. Set to `0` to disable the limit. |
299
132
 
300
- ```json
301
- {
302
- "defaultTools": ["read", "powershell", "edit", "write"]
303
- }
304
- ```
133
+ Agent-level retry covers HTTP provider errors, transport and stream disconnections, empty assistant responses, and responses containing only thinking without text or tool calls. HTTP 401/authentication failures remain bounded by `retry.maxUnauthorizedRetries`; other retryable failures use `retry.maxRetries`, which is unlimited by default. Exponential backoff never exceeds `retry.maxBackoffMs`.
305
134
 
306
- An empty array starts with no built-in tools while preserving extension and SDK custom tools. `--tools` replaces this behavior with a strict allowlist for all tools, `--no-tools` disables all tools, and `--no-builtin-tools` disables the built-in defaults. `--exclude-tools` filters the resulting list. A project `defaultTools` array replaces the global array.
135
+ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are required. Provider retries can delay Pi from handling quota and usage-limit errors itself.
307
136
 
308
- ### Sessions
137
+ ## Shell
309
138
 
310
139
  | Setting | Type | Default | Description |
311
- |---------|------|---------|-------------|
312
- | `sessionDir` | string | - | Directory where session files are stored. Accepts absolute or relative paths, plus `~`. |
140
+ |---|---|---|---|
141
+ | `shellPath` | string | Platform default | Custom shell executable path. Supports a leading `~`. |
142
+ | `shellCommandPrefix` | string | None | Prefix prepended to every shell command. |
143
+ | `npmCommand` | `string[]` | `npm` | Command and arguments used for npm package lookup and installation. |
313
144
 
314
- ```json
315
- { "sessionDir": ".pi/sessions" }
316
- ```
317
-
318
- When multiple sources specify a session directory, precedence is `--session-dir`, `PI_CODING_AGENT_SESSION_DIR`, then `sessionDir` in settings.json.
319
-
320
- ### Model Cycling
321
-
322
- | Setting | Type | Default | Description |
323
- |---------|------|---------|-------------|
324
- | `enabledModels` | string[] | - | Model patterns for Ctrl+P cycling (same format as `--models` CLI flag) |
145
+ See [Shell aliases](shell-aliases.md) for shell setup and [Pi Packages](packages.md) for package-manager behavior.
325
146
 
326
- ```json
327
- {
328
- "enabledModels": ["claude-*", "gpt-4o", "gemini-2*"]
329
- }
330
- ```
147
+ ## Resources
331
148
 
332
- ### Markdown
149
+ Resource paths in user settings resolve from the agent directory. Paths in project settings resolve from the project `.pi` directory. Absolute paths and `~` are supported.
333
150
 
334
151
  | Setting | Type | Default | Description |
335
- |---------|------|---------|-------------|
336
- | `markdown.codeBlockIndent` | string | `" "` | Indentation for code blocks |
337
- | `markdown.mermaid` | string | `"streaming"` | Mermaid rendering mode: `"off"`, `"final"`, or `"streaming"` |
152
+ |---|---|---|---|
153
+ | `packages` | array | `[]` | npm, git, or local Pi package sources. See [Pi Packages](packages.md). |
154
+ | `extensions` | `string[]` | `[]` | Extension files or directories. |
155
+ | `skills` | `string[]` | `[]` | Skill files or directories. |
156
+ | `prompts` | `string[]` | `[]` | Prompt-template files or directories. |
157
+ | `themes` | `string[]` | `[]` | Theme files or directories. |
158
+ | `enableSkillCommands` | boolean | `true` | Register skills as `/skill:name` commands. |
338
159
 
339
- ### Resources
160
+ Resource arrays support glob exclusions with `!pattern`, exact inclusion with `+path`, and exact exclusion with `-path`. Pi loads resources listed in both user-level and project settings.
340
161
 
341
- These settings define where to load extensions, skills, prompts, and themes from.
162
+ The built-in extensions are named `builtin:mcp`, `builtin:llama.cpp`, `builtin:codemode`, and `builtin:tool-search` in `extensions`. They load by default; `-builtin:mcp` disables one. A `+builtin:<name>` or `-builtin:<name>` entry in project settings overrides the user setting. `pi config` lists them under Built-in. `--no-extensions` disables them too, and `-e builtin:<name>` loads one explicitly.
342
163
 
343
- Paths in `~/.pi/agent/settings.json` resolve relative to `~/.pi/agent`. Paths in `.pi/settings.json` resolve relative to `.pi`. Absolute paths and `~` are supported.
164
+ ## Updates, telemetry, and warnings
344
165
 
345
166
  | Setting | Type | Default | Description |
346
- |---------|------|---------|-------------|
347
- | `packages` | array | `[]` | npm/git packages to load resources from |
348
- | `extensions` | string[] | `[]` | Local extension file paths or directories |
349
- | `skills` | string[] | `[]` | Local skill file paths or directories |
350
- | `prompts` | string[] | `[]` | Local prompt template paths or directories |
351
- | `themes` | string[] | `[]` | Local theme file paths or directories |
352
- | `enableSkillCommands` | boolean | `true` | Register skills as `/skill:name` commands |
353
-
354
- Arrays support glob patterns and exclusions. Use `!pattern` to exclude. Use `+path` to force-include an exact path and `-path` to force-exclude an exact path.
355
-
356
- #### packages
357
-
358
- String form loads all resources from a package:
359
-
360
- ```json
361
- {
362
- "packages": ["pi-skills", "@org/my-extension"]
363
- }
364
- ```
365
-
366
- Object form filters which resources to load:
367
-
368
- ```json
369
- {
370
- "packages": [
371
- {
372
- "source": "pi-skills",
373
- "skills": ["brave-search", "transcribe"],
374
- "extensions": []
375
- }
376
- ]
377
- }
378
- ```
379
-
380
- See [packages.md](packages.md) for package management details.
381
-
382
- ## Example
383
-
384
- ```json
385
- {
386
- "defaultProvider": "anthropic",
387
- "defaultModel": "claude-sonnet-4-20250514",
388
- "defaultThinkingLevel": "medium",
389
- "modelThinkingLevels": {
390
- "anthropic/claude-sonnet-4-20250514": "high"
391
- },
392
- "theme": "dark",
393
- "compaction": {
394
- "enabled": true,
395
- "reserveTokens": 16384,
396
- "keepRecentTokens": 20000
397
- },
398
- "retry": {
399
- "enabled": true,
400
- "maxRetries": null
401
- },
402
- "enabledModels": ["claude-*", "gpt-4o"],
403
- "warnings": {
404
- "anthropicExtraUsage": true
405
- },
406
- "packages": ["pi-skills"]
407
- }
408
- ```
409
-
410
- ## Project Overrides
411
-
412
- Project settings (`.pi/settings.json`) override global settings. Nested objects are merged:
413
-
414
- ```json
415
- // ~/.pi/agent/settings.json (global)
416
- {
417
- "theme": "dark",
418
- "compaction": { "enabled": true, "reserveTokens": 16384 }
419
- }
420
-
421
- // .pi/settings.json (project)
422
- {
423
- "compaction": { "reserveTokens": 8192 }
424
- }
425
-
426
- // Result
427
- {
428
- "theme": "dark",
429
- "compaction": { "enabled": true, "reserveTokens": 8192 }
430
- }
431
- ```
167
+ |---|---|---|---|
168
+ | `collapseChangelog` | boolean | `false` | Show a condensed changelog after an update. |
169
+ | `enableInstallTelemetry` | boolean | `true` | Enable anonymous install/update reporting and selected provider attribution headers. Does not control update checks. |
170
+ | `enableAnalytics` | boolean | `false` | Opt in to analytics data sharing. Currently used only by the experimental first-run setup. |
171
+ | `warnings.anthropicExtraUsage` | boolean | `true` | Warn when Anthropic subscription authentication may use paid extra usage. |