@kingingwang/pi-darwin-arm64 0.84.4 → 0.86.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 (71) hide show
  1. package/bin/CHANGELOG.md +185 -5
  2. package/bin/README.md +4 -2
  3. package/bin/docs/compaction.md +39 -13
  4. package/bin/docs/containerization.md +45 -0
  5. package/bin/docs/custom-provider.md +22 -13
  6. package/bin/docs/development.md +23 -4
  7. package/bin/docs/docs.json +4 -0
  8. package/bin/docs/environment-variables.md +3 -0
  9. package/bin/docs/extensions.md +62 -45
  10. package/bin/docs/json.md +4 -4
  11. package/bin/docs/keybindings.md +5 -2
  12. package/bin/docs/models.md +37 -3
  13. package/bin/docs/providers.md +10 -2
  14. package/bin/docs/rpc.md +1 -1
  15. package/bin/docs/sdk.md +9 -2
  16. package/bin/docs/security.md +1 -1
  17. package/bin/docs/session-format.md +82 -40
  18. package/bin/docs/sessions.md +27 -0
  19. package/bin/docs/settings.md +60 -5
  20. package/bin/docs/skills.md +1 -1
  21. package/bin/docs/terminal-setup.md +15 -0
  22. package/bin/docs/termux.md +0 -1
  23. package/bin/docs/themes.md +8 -6
  24. package/bin/docs/tui.md +21 -2
  25. package/bin/docs/usage.md +1 -0
  26. package/bin/examples/README.md +3 -0
  27. package/bin/examples/extensions/README.md +0 -1
  28. package/bin/examples/extensions/custom-provider-anthropic/index.ts +18 -12
  29. package/bin/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  30. package/bin/examples/extensions/custom-provider-anthropic/package.json +1 -1
  31. package/bin/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
  32. package/bin/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  33. package/bin/examples/extensions/dynamic-resources/dynamic.json +2 -0
  34. package/bin/examples/extensions/gondolin/package-lock.json +2 -2
  35. package/bin/examples/extensions/gondolin/package.json +1 -1
  36. package/bin/examples/extensions/prompt-customizer.ts +19 -67
  37. package/bin/examples/extensions/sandbox/package-lock.json +2 -2
  38. package/bin/examples/extensions/sandbox/package.json +1 -1
  39. package/bin/examples/extensions/with-deps/package-lock.json +2 -2
  40. package/bin/examples/extensions/with-deps/package.json +1 -1
  41. package/bin/examples/plugins/pi-example-plugin/README.md +38 -0
  42. package/bin/examples/plugins/pi-example-plugin/package.json +10 -0
  43. package/bin/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
  44. package/bin/examples/plugins/pi-example-plugin/src/session.ts +23 -0
  45. package/bin/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
  46. package/bin/native/darwin/prebuilds/darwin-arm64/{darwin-modifiers.node → darwin-platform.node} +0 -0
  47. package/bin/package.json +24 -23
  48. package/bin/pi +2 -2
  49. package/bin/theme/dark.json +2 -1
  50. package/bin/theme/light.json +2 -1
  51. package/bin/theme/theme-schema.json +6 -2
  52. package/package.json +1 -1
  53. package/bin/examples/extensions/kimi-deferred-tools.ts +0 -61
  54. package/bin/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
  55. package/bin/node_modules/@mariozechner/clipboard/Cargo.toml +0 -45
  56. package/bin/node_modules/@mariozechner/clipboard/README.md +0 -60
  57. package/bin/node_modules/@mariozechner/clipboard/build.rs +0 -5
  58. package/bin/node_modules/@mariozechner/clipboard/clipboard.darwin-arm64.node +0 -0
  59. package/bin/node_modules/@mariozechner/clipboard/exp.ts +0 -12
  60. package/bin/node_modules/@mariozechner/clipboard/index.d.ts +0 -37
  61. package/bin/node_modules/@mariozechner/clipboard/index.js +0 -606
  62. package/bin/node_modules/@mariozechner/clipboard/package.json +0 -56
  63. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +0 -307
  64. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +0 -93
  65. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +0 -313
  66. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +0 -471
  67. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +0 -252
  68. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +0 -431
  69. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +0 -712
  70. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +0 -916
  71. package/bin/node_modules/@mariozechner/clipboard/src/lib.rs +0 -194
package/bin/CHANGELOG.md CHANGED
@@ -1,5 +1,181 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.86.1] - 2026-09-20
4
+
5
+ ### New Features
6
+
7
+ - **Meta Muse provider** — Sign in with Meta using `/login meta` or use `META_API_KEY` to access Muse Spark models. See [Meta (Muse subscription)](docs/providers.md#meta-muse-subscription).
8
+
9
+ ### Added
10
+
11
+ - Added Meta (Muse subscription) login via `/login meta` with automatic Model API key refresh, plus `META_API_KEY` support ([#9096](https://github.com/earendil-works/pi/pull/9096) by [@xl0](https://github.com/xl0)).
12
+
13
+ ### Changed
14
+
15
+ - Enabled Node's persistent compile cache before loading the bundled CLI runtime, reducing repeat launch time.
16
+
17
+ ### Fixed
18
+
19
+ - Fixed `/bug` descriptions dropping line breaks from pasted diagnostics.
20
+ - Fixed `/bug` hints appearing for user cancellations and retryable provider failures such as service unavailability.
21
+ - Fixed clipboard copy failing in containers and WSL without WSLg by restoring the OSC 52 fallback when no display is available, and added a verified Windows clipboard backend for WSL ([#9688](https://github.com/earendil-works/pi/issues/9688)).
22
+ - Fixed inherited z.ai `Prompt too long` errors not being recognized as context overflow ([#9805](https://github.com/earendil-works/pi/issues/9805)).
23
+ - Fixed inherited Cerebras models advertising unsupported strict tool schemas, which caused HTTP 400 errors when strict and non-strict tools were mixed ([#9804](https://github.com/earendil-works/pi/pull/9804) by [@EdenGottlieb](https://github.com/EdenGottlieb)).
24
+
25
+ ## [0.86.0] - 2026-09-19
26
+
27
+ ### New Features
28
+
29
+ - **Prompt cache warming** — Keep valuable prompt caches alive during long tool runs and optionally while idle using cost-aware refreshes. See [Cache Warming](docs/settings.md#cache-warming).
30
+ - **Bug reporting** — Report problems with `/bug` using redacted diagnostics, optional transcripts, or exported ZIP archives. See [Reporting Bugs](docs/sessions.md#reporting-bugs).
31
+ - **Transcript-aware prompt and tool updates** — Preserve instruction and tool changes across resume and branch navigation while retaining cached prefixes. See [`before_agent_start`](docs/extensions.md#before_agent_start).
32
+ - **Offline Radius model catalog** — Select Radius models immediately, with cached and live catalogs overlaid when available. See [Radius](docs/providers.md#radius).
33
+ - **Per-model compaction budgets** — Configure reserved and recent-token budgets by model. See [Per-model overrides](docs/compaction.md#per-model-overrides).
34
+
35
+ ### Breaking Changes
36
+
37
+ - Changed inherited pi-ai provider stream inputs from `Context` to normalized `TranscriptContext` values. Custom providers must read system prompts and tool declarations from `context.messages` with `getCurrentSystemPrompt()` and `getCurrentTools()`. See [Custom Streaming API](docs/custom-provider.md#custom-streaming-api).
38
+ - Restricted inherited `ToolCall.arguments` and `ToolResultMessage.details` to JSON-compatible values, changed `ToolResultMessage` into a conditional type, and made `JsonValue` arrays readonly.
39
+ - `user_bash` now fails closed: errors or invalid defined results abort the command without invoking later handlers or executing locally. Return `undefined` to continue propagation; otherwise return `{ operations }` or `{ result }` ([#9068](https://github.com/earendil-works/pi/issues/9068)).
40
+
41
+ ### Added
42
+
43
+ - Added transcript-backed mid-conversation system prompt and tool changes so instruction and tool updates survive resume and branch navigation while preserving cached prefixes on supported models. See [`before_agent_start`](docs/extensions.md#before_agent_start) and [Entry Types](docs/session-format.md#entry-types) ([#9548](https://github.com/earendil-works/pi/pull/9548)).
44
+ - Added inherited native deferred tool loading for Fireworks Messages models. Use `ToolSearch` or `tool_search` as the loader name for prompt-prefix deferral ([#9323](https://github.com/earendil-works/pi/issues/9323)).
45
+ - Added click toggling for branch summaries, compaction summaries, and skill invocation entries.
46
+ - Added the public Radius model catalog for immediate and offline model selection, with cached and live gateway catalogs overlaid when available.
47
+ - Added `ctx.modelRegistry.stream()` and `streamSimple()` for extension model calls through configured providers with resolved authentication ([#8964](https://github.com/earendil-works/pi/issues/8964)).
48
+ - Added per-model `reserveTokens` and `keepRecentTokens` settings through `compaction.modelOverrides`, with ordinary compaction settings as fallback ([#8133](https://github.com/earendil-works/pi-mono/issues/8133)).
49
+ - Added `compat.allowedFallbackModels` configuration for overriding or disabling Anthropic server-side fallback models ([#9294](https://github.com/earendil-works/pi/issues/9294)).
50
+ - Added an unsubscribe function from `pi.on()` so extensions can drop event handlers. Handlers added or removed during a dispatch apply to later dispatches, not the current one ([#8967](https://github.com/earendil-works/pi/issues/8967)).
51
+ - Exported extension hook event and result types that were previously omitted from the package entry points ([#9642](https://github.com/earendil-works/pi/pull/9642)).
52
+ - Added `/bug [description]` to report a bug to the Pi developers. The report bundles environment, model, provider, extension, and settings metadata (secrets redacted), assistant message diagnostics from the session, optionally the session transcript, or a model-written summary of what went wrong instead. It is uploaded to Radius (no login required; attributed when logged in) or exported as a zip archive, and the report id is recorded in the session as a `pi.bug-report` entry. Crashes are recorded in `~/.pi/agent/crashes.json`, announced once on the next start, and attached to the next report; unexplained errors and exhausted retries point at `/bug` once per session.
53
+ - Added cost-aware prompt-cache warming during long tool runs and optionally while idle, with configurable modes, model cache-lifetime metadata, `/session` diagnostics, transcript notices, and the `cache_warming_decision` extension event. See [Cache Warming](docs/settings.md#cache-warming) ([#9668](https://github.com/earendil-works/pi/pull/9668)).
54
+
55
+ ### Changed
56
+
57
+ - Enabled Node's persistent compile cache before loading the bundled CLI runtime, reducing repeat launch time.
58
+ - Made `--resume` session results appear progressively, using file modification times to prioritize all-folder loading and cancelling outstanding transcript reads after selection.
59
+ - Reduced `--continue` startup time by checking candidate session headers in modification-time order and stopping after the newest matching session.
60
+ - Replaced the external native clipboard dependency with bundled asynchronous macOS, Windows, and X11 helpers while preserving platform command and OSC 52 fallbacks ([#9163](https://github.com/earendil-works/pi/pull/9163)).
61
+ - Reduced inherited fuzzy search latency for long texts by using native substring search instead of scanning each character in JavaScript ([#9267](https://github.com/earendil-works/pi/issues/9267)).
62
+ - Moved compaction, branch summarization, and retry spinners into the editor border alongside the working indicator. Custom editors use the same embedding opt-in for all status spinners.
63
+ - Enabled strict-prefer JSON-schema sampling by default for built-in `read`, `bash`, `powershell`, `edit`, and `write` tools, without requiring `PI_EXPERIMENTAL`. Extensions can re-register tool definitions with `constrainedSampling: false`.
64
+ - Formatted Bash and PowerShell tool durations of at least one minute as minutes and seconds, with hours when needed ([#9628](https://github.com/earendil-works/pi/issues/9628)).
65
+ - Deferred the extension compiler and bundled virtual modules until a filesystem extension is loaded, reducing the baseline SDK import cost ([#9540](https://github.com/earendil-works/pi/issues/9540)).
66
+
67
+ ### Fixed
68
+
69
+ - Fixed GitHub Copilot GPT models, including GPT-6 Astra, using the Chat Completions adapter instead of the required Responses adapter ([#9253](https://github.com/earendil-works/pi/pull/9253) by [@petrroll](https://github.com/petrroll)).
70
+ - Fixed inherited DeepSeek V4.1 thinking levels on OpenRouter and OpenCode Go preserving provider effort metadata ([#9485](https://github.com/earendil-works/pi/issues/9485)).
71
+ - Fixed inherited bodyless HTTP 400/413 errors from non-Cerebras providers being misclassified as context overflow ([#9482](https://github.com/earendil-works/pi/issues/9482)).
72
+ - Fixed inherited Vercel AI Gateway replaying unsigned thinking as assistant text ([#9676](https://github.com/earendil-works/pi/issues/9676)).
73
+ - Fixed inherited Google Generative AI and Vertex AI using unsupported thinking levels when reasoning is omitted or when model capabilities differ within a Gemini family ([#9455](https://github.com/earendil-works/pi/issues/9455)).
74
+ - Fixed inherited Anthropic-compatible relays breaking signed thinking replay when they report a different response model, while preserving fallback pricing ([#9188](https://github.com/earendil-works/pi/issues/9188)).
75
+ - Fixed inherited Amazon Bedrock one-hour cache writes being priced at the five-minute rate ([#9457](https://github.com/earendil-works/pi/issues/9457)).
76
+ - Fixed inherited quadratic CPU usage when draining buffered `EventStream` events ([#9055](https://github.com/earendil-works/pi/issues/9055)).
77
+ - Fixed inherited Mistral Medium reasoning requests to use `reasoning_effort` for all reasoning-capable `mistral-medium-*` model IDs instead of the unsupported `prompt_mode` ([#8700](https://github.com/earendil-works/pi/issues/8700)).
78
+ - Fixed inherited OpenCode and OpenCode Go requests to send `x-opencode-session` from `sessionId` across all supported API adapters ([#9326](https://github.com/earendil-works/pi/issues/9326)).
79
+ - Fixed inherited OpenAI Codex requests to send the model's Off reasoning effort instead of omitting it, while respecting unsupported Off mappings ([#9191](https://github.com/earendil-works/pi/issues/9191)).
80
+ - Fixed inherited Fireworks unsigned thinking replay and reasoning effort selection using catalog metadata, with verified DeepSeek V4 and Qwen3.8 fallbacks and removal of redundant GLM 5.2 and Kimi K3 effort aliases ([#9323](https://github.com/earendil-works/pi/issues/9323)).
81
+ - Fixed inherited OpenRouter requests to send `x-session-id` from `sessionId` for Chat Completions and Anthropic Messages models when prompt caching is enabled ([#9102](https://github.com/earendil-works/pi/issues/9102)).
82
+ - Fixed the inherited DeepSeek catalog to advertise `deepseek-flash` for DeepSeek V4.1 Flash instead of retired Flash aliases, and refreshed DeepSeek pricing metadata ([#9423](https://github.com/earendil-works/pi/issues/9423)).
83
+ - Fixed inherited Mistral-hosted GLM-5.2 reasoning requests to use `reasoning_effort` instead of the ignored `prompt_mode` ([#9375](https://github.com/earendil-works/pi/issues/9375)).
84
+ - Fixed inherited OpenAI-compatible Responses errors to identify the actual provider instead of always labeling them as OpenAI errors ([#9298](https://github.com/earendil-works/pi/issues/9298)).
85
+ - Fixed inherited Baseten requests to send session-affinity headers from `sessionId` for automatic prompt-cache routing ([#9629](https://github.com/earendil-works/pi/issues/9629)).
86
+ - Fixed inherited retry classification for Cloudflare 520 responses ([#9627](https://github.com/earendil-works/pi/issues/9627)).
87
+ - Fixed inherited retry classification for transient Azure peak-load capacity errors ([#9669](https://github.com/earendil-works/pi/issues/9669)).
88
+ - Fixed session tree navigation racing with active compaction and replacing its progress UI ([#9179](https://github.com/earendil-works/pi/pull/9179) by [@acmerfight](https://github.com/acmerfight)).
89
+ - Fixed exact session ID lookup scanning complete transcript bodies instead of reading session headers ([#9601](https://github.com/earendil-works/pi/pull/9601) by [@metaist](https://github.com/metaist)).
90
+ - Fixed repeated Anthropic thinking-drop notices being shown for the same dropped blocks, and shortened notices while retaining details in the session ([#9391](https://github.com/earendil-works/pi/issues/9391)).
91
+ - Fixed mid-run threshold compaction silently skipping oversized trailing tool results ([#9740](https://github.com/earendil-works/pi/issues/9740)).
92
+ - Fixed signal-terminated local shell commands being reported as successful with partial output ([#9577](https://github.com/earendil-works/pi/issues/9577) by [@BrendanJMurphy](https://github.com/BrendanJMurphy)).
93
+ - Fixed local clipboard failures reporting success when the terminal ignored the fallback OSC 52 write, and added platform-specific setup guidance when no clipboard backend works ([#9618](https://github.com/earendil-works/pi/issues/9618)).
94
+ - Capped agent-level retry backoff at `retry.maxAgentDelayMs` (60s by default) so long retry runs stay responsive during prolonged transient outages ([#8826](https://github.com/earendil-works/pi/issues/8826)).
95
+ - Fixed direct RPC `steer` and `follow_up` commands bypassing extension `input` handlers ([#8718](https://github.com/earendil-works/pi/issues/8718)).
96
+ - Fixed premature missing-model errors after login by waiting for catalog discovery. Radius now defaults to `balanced`, falling back to the first available Radius model when needed.
97
+ - Fixed fullscreen mode reserving a blank row for custom footers that render zero rows ([#8919](https://github.com/earendil-works/pi/issues/8919)).
98
+ - Fixed extension tools without parameter schemas to be rejected during registration instead of breaking provider requests ([#9300](https://github.com/earendil-works/pi/issues/9300)).
99
+ - Fixed `before_agent_start` handlers returning `systemPrompt` (and `forceSystemPrompt`) on models with mid-conversation system messages: the forced prompt is now sent as the provider's leading system prompt instead of being appended as a section patch after the original prompt.
100
+ - Fixed loaded llama.cpp models with `enable_thinking` chat templates ignoring Pi's thinking level ([#9528](https://github.com/earendil-works/pi/issues/9528)).
101
+ - Fixed cancellation races that could start automatic compaction, leave stale retry state, or miss cancellation while waiting for summarization authentication ([#9340](https://github.com/earendil-works/pi/issues/9340), [#9777](https://github.com/earendil-works/pi/issues/9777)).
102
+ - Fixed asynchronous Kitty image conversion replacing newer partial tool output images ([#8743](https://github.com/earendil-works/pi/pull/8743) by [@wutongyuonce](https://github.com/wutongyuonce)).
103
+ - Fixed inherited skill slash-command autocomplete ranking the `skill:` prefix instead of the bare skill name ([#9120](https://github.com/earendil-works/pi/pull/9120) by [@yearth](https://github.com/yearth)).
104
+ - Fixed inherited file autocomplete boundaries and path quoting around CJK punctuation ([#9746](https://github.com/earendil-works/pi/pull/9746) by [@haoqixu](https://github.com/haoqixu)).
105
+ - Fixed inherited LaTeX legacy font switches falling back to raw source, centered `cases` layouts around surrounding equations, and vertically laid out unsupported and nested display scripts ([#8827](https://github.com/earendil-works/pi/issues/8827), [#9564](https://github.com/earendil-works/pi/issues/9564), [#7929](https://github.com/earendil-works/pi/issues/7929)).
106
+ - Fixed inherited fullscreen Kitty images being erased by later row clears in WezTerm ([#9169](https://github.com/earendil-works/pi/issues/9169)).
107
+
108
+ ### Removed
109
+
110
+ - Removed unavailable inherited GPT-5.4 and GPT-5.4 mini models from OpenAI Codex selection ([#9394](https://github.com/earendil-works/pi/issues/9394)).
111
+
112
+ ## [0.85.1] - 2026-09-05
113
+
114
+ ### New Features
115
+
116
+ - **GPT-6 Astra** — Available through OpenAI API keys and OpenAI Codex subscriptions. See [API Keys](docs/providers.md#api-keys) and [OpenAI Codex](docs/providers.md#openai-codex).
117
+
118
+ ### Added
119
+
120
+ - Added GPT-6 Astra for OpenAI API keys and OpenAI Codex subscriptions.
121
+ - Added five-times-faster mouse wheel scrolling while holding Alt in fullscreen mode ([#9166](https://github.com/earendil-works/pi/pull/9166) by [@xl0](https://github.com/xl0)).
122
+
123
+ ### Fixed
124
+
125
+ - Fixed configurable save keybindings in the model and thinking selectors ([#9149](https://github.com/earendil-works/pi/pull/9149) by [@rwachtler](https://github.com/rwachtler)).
126
+ - Fixed SDK import failures caused by unintentionally publishing internal experimental code and dependencies in 0.85.0. The experimental `client` and `experimental/plugin` subpaths and server/client commands are now source-only through `pi-test.sh`; the supported local SDK and stdio RPC API are unchanged ([#9132](https://github.com/earendil-works/pi/issues/9132)).
127
+ - Fixed mouse hover changing selection and recentering autocomplete and settings lists, causing clicks to target a different item.
128
+ - Fixed long prompt-cache requests for GPT-5.6+ Responses models to use `prompt_cache_options.ttl: "30m"` instead of `prompt_cache_retention: "24h"`.
129
+
130
+ ## [0.85.0] - 2026-09-04
131
+
132
+ ### New Features
133
+
134
+ - **Persistent Claude thinking effort** — Supported Anthropic transports preserve per-turn effort and recover safely from signed-thinking mismatches. See [Model Configuration](docs/models.md#model-configuration).
135
+ - **Fullscreen transcript controls** — Jump to the latest message from a scrolled transcript and use the embedded working indicator. See [TUI Fullscreen Viewport](docs/keybindings.md#tui-fullscreen-viewport).
136
+ - **Restorable in-memory sessions** — Resume externally stored session entries through the SDK. See [Session Management](docs/sdk.md#session-management).
137
+
138
+ ### Added
139
+
140
+ - Added `SessionManager.inMemory()` support for restoring externally managed session entries ([#8980](https://github.com/earendil-works/pi/pull/8980) by [@y-nk](https://github.com/y-nk)).
141
+ - Added inherited OpenAI-compatible `vllmPriority` and `supportsMaxOutputTokens` model settings for vLLM scheduler priority and OpenAI Responses output-token limits ([#9004](https://github.com/earendil-works/pi/pull/9004) by [@AppleDannyClegg](https://github.com/AppleDannyClegg), [#8941](https://github.com/earendil-works/pi/pull/8941) by [@scturtle](https://github.com/scturtle)).
142
+ - Added inherited LaTeX rendering for relational algebra join symbols ([#9050](https://github.com/earendil-works/pi/pull/9050) by [@haoqixu](https://github.com/haoqixu)).
143
+ - Added a clickable "Jump to latest message" label with the `tui.altScreen.bottom` shortcut to the fullscreen transcript while it is scrolled up ([#9080](https://github.com/earendil-works/pi/pull/9080) by [@rwachtler](https://github.com/rwachtler)).
144
+ - Added Meta (Muse subscription) login via `/login meta` with automatic Model API key refresh, plus `META_API_KEY` support.
145
+
146
+ ### Changed
147
+
148
+ - Moved the streaming working indicator into the default editor border and matched its default spinner and label to the thinking-level border color. Custom editors retain the standalone indicator unless they opt in to embedding it ([#8799](https://github.com/earendil-works/pi/pull/8799) by [@cristinaponcela](https://github.com/cristinaponcela)).
149
+ - Reduced inherited fullscreen transcript search latency on large transcripts by caching unchanged search results, indexing ASCII runs, and limiting highlight work to visible matches ([#8800](https://github.com/earendil-works/pi/pull/8800) by [@cristinaponcela](https://github.com/cristinaponcela)).
150
+
151
+ ### Fixed
152
+
153
+ - Fixed managed `fd` and ripgrep downloads on Linux musl systems ([#9070](https://github.com/earendil-works/pi/pull/9070) by [@Charlie0113-T](https://github.com/Charlie0113-T)).
154
+ - Removed the unavailable inherited Grok Build 0.1 model from `/model` ([#9093](https://github.com/earendil-works/pi/pull/9093) by [@Jaaneek](https://github.com/Jaaneek)).
155
+ - Fixed inherited provider streams emitting incompatible event sequences and custom tool-call deltas.
156
+ - Restored the `@earendil-works/pi-coding-agent/client` compatibility entry point.
157
+ - Fixed the inherited Qwen Token Plan Individual catalog to include Qwen3.8 Flash ([#9021](https://github.com/earendil-works/pi/issues/9021)).
158
+ - Fixed inherited OpenAI Codex SSE parsing to process terminal events that are not followed by a blank line ([#9047](https://github.com/earendil-works/pi/issues/9047)).
159
+ - Fixed inherited GitHub Copilot Claude Fable 5 requests so selected reasoning levels are sent ([#8961](https://github.com/earendil-works/pi/issues/8961)).
160
+ - Fixed inherited Baseten GLM-5.2 models incorrectly advertising image input support ([#8293](https://github.com/earendil-works/pi/pull/8293) by [@Panoplos](https://github.com/Panoplos)).
161
+ - Fixed skills being unavailable when Bash is the only enabled tool ([#8552](https://github.com/earendil-works/pi/pull/8552) by [@xl0](https://github.com/xl0)).
162
+ - Fixed concurrent session shares overwriting one another ([#8613](https://github.com/earendil-works/pi/pull/8613) by [@wutongyuonce](https://github.com/wutongyuonce)).
163
+ - Fixed image orientation detection skipping EXIF data after non-EXIF APP1 segments ([#8616](https://github.com/earendil-works/pi/pull/8616) by [@wutongyuonce](https://github.com/wutongyuonce)).
164
+ - Fixed imported sessions overwriting an existing session with the same filename ([#8985](https://github.com/earendil-works/pi/pull/8985) by [@wutongyuonce](https://github.com/wutongyuonce)).
165
+ - Fixed session forks losing their compaction boundary ([#8990](https://github.com/earendil-works/pi/pull/8990) by [@acmerfight](https://github.com/acmerfight)).
166
+ - Fixed in-memory session forks before an active turn settled ([#8937](https://github.com/earendil-works/pi/pull/8937) by [@acmerfight](https://github.com/acmerfight)).
167
+ - Fixed inherited Fireworks GLM models using the wrong API adapter.
168
+ - Fixed inherited `NO_PROXY` matching for root domains and subdomains ([#8737](https://github.com/earendil-works/pi/pull/8737) by [@MeiSiristhebest](https://github.com/MeiSiristhebest)).
169
+ - Fixed `bash`, `edit`, `find`, `grep`, `ls`, `read`, and `write` tools ignoring `ctx.cwd` ([#8627](https://github.com/earendil-works/pi/pull/8627) by [@vmizg](https://github.com/vmizg)).
170
+ - Fixed inherited terminal startup under restricted seccomp policies that reject the `SIGWINCH` self-signal ([#8898](https://github.com/earendil-works/pi/pull/8898) by [@bartlomiejkida](https://github.com/bartlomiejkida)).
171
+ - Fixed inherited Zed terminal image capability detection ([#8828](https://github.com/earendil-works/pi/pull/8828) by [@Perlence](https://github.com/Perlence)).
172
+ - Fixed drag selection continuing over the fullscreen editor.
173
+ - Fixed managed `fd` and ripgrep downloads requiring the GitHub Releases API ([#8708](https://github.com/earendil-works/pi/pull/8708) by [@Terminator666666](https://github.com/Terminator666666)).
174
+ - Fixed branch summaries failing when reasoning consumes the previous 2048-token output cap ([#8845](https://github.com/earendil-works/pi/issues/8845)).
175
+ - Fixed the write tool reporting UTF-16 code-unit counts as byte counts by removing the misleading count ([#8979](https://github.com/earendil-works/pi/issues/8979)).
176
+ - Fixed proxied plain-HTTP provider requests hanging after a tool call by tunneling them with CONNECT ([#8134](https://github.com/earendil-works/pi/issues/8134)).
177
+ - Fixed RPC `abort` reporting success without cancelling an in-progress manual compaction ([#8920](https://github.com/earendil-works/pi/issues/8920)).
178
+
3
179
  ## [0.84.4] - 2026-08-28
4
180
 
5
181
  ### New Features
@@ -12,6 +188,8 @@
12
188
 
13
189
  ### Added
14
190
 
191
+ - Added `supportsMidConvoEffort` to custom Anthropic Messages model compatibility settings.
192
+ - Added transcript notices for Anthropic thinking blocks dropped during provider recovery when cache miss notices are enabled.
15
193
  - Added `ui_prompt_start` and `ui_prompt_end` extension events so host integrations can distinguish active agent work from waiting on user-facing `ctx.ui` prompts ([#8355](https://github.com/earendil-works/pi/pull/8355) by [@cristinaponcela](https://github.com/cristinaponcela)).
16
194
  - Added `detectSupportedImageMimeTypeFromFile()` to the public library exports ([#8600](https://github.com/earendil-works/pi/pull/8600) by [@xl0](https://github.com/xl0)).
17
195
  - Added inherited experimental vision-capable `deepseek-v4-flash-vision-exp` model support.
@@ -20,6 +198,11 @@
20
198
  - Added environment variables and advanced settings for overriding auto-detected terminal hyperlink, image, and truecolor capabilities ([#8665](https://github.com/earendil-works/pi/issues/8665)).
21
199
  - Added `fullscreenCopyOnSelect` to disable automatic fullscreen selection copy; when disabled, `Ctrl+X` copies the active text selection before falling back to the last assistant message, while `/tree` still copies the selected message ([#7720](https://github.com/earendil-works/pi/issues/7720)).
22
200
 
201
+ ### Changed
202
+ - Changed fullscreen scrollbars to reveal on pointer entry, support optional `scrollbarTrack` and `scrollbarThumb` theme colors with muted and text fallbacks, keep one thumb color across normal and expanded states, and support track-click jumping.
203
+ - Changed fullscreen transcript search arrows to underline on hover and capitalized the search placeholder.
204
+ - Changed selectors in `/thinking`, `/model`, `/scoped-models`, `/trust`, per-model thinking settings, and theme settings to keep active options marked while browsing. `/scoped-models` now uses consistent per-item toggles and strikes through unavailable models ([#8900](https://github.com/earendil-works/pi/pull/8900)).
205
+
23
206
  ### Fixed
24
207
 
25
208
  - Fixed toggling thinking visibility clearing partial output from running Bash tools ([#8611](https://github.com/earendil-works/pi/issues/8611)).
@@ -57,11 +240,7 @@
57
240
  - Added an optional `powershell` tool for Windows, configurable through `defaultTools` and the SDK. See [PowerShell Tool](docs/windows.md#powershell-tool).
58
241
  - Added a `/thinking` selector and searchable default choices to the model and thinking selectors; Ctrl+S saves the selected model as the global default. See [Models and Thinking](docs/keybindings.md#models-and-thinking).
59
242
  - Added optional routing session IDs to exported compaction summary helpers so callers can preserve provider routing without enabling prompt cache writes.
60
- - Added
61
-
62
-
63
-
64
- usage notices for compaction and branch summaries when cache miss notices are enabled.
243
+ - Added transcript usage notices for compaction and branch summaries when cache miss notices are enabled.
65
244
  - Added `session_compact_failed` extension events so compaction failures and aborts expose their reason, retry state, source, and error message to handlers ([#8175](https://github.com/earendil-works/pi/issues/8175)).
66
245
  - Added inherited provider-neutral `toolChoice` support to simple stream requests.
67
246
  - Added inherited automatic Anthropic server-side refusal fallback for supported first-party models, including returned-model usage pricing ([#8017](https://github.com/earendil-works/pi/issues/8017)).
@@ -135,6 +314,7 @@ usage notices for compaction and branch summaries when cache miss notices are en
135
314
 
136
315
  ### Added
137
316
 
317
+ - Added per-block fullscreen mouse expansion for thinking sections and tool results, while preserving drag selection and link activation.
138
318
  - Added fullscreen transcript search with `Ctrl+Shift+F`, incremental match highlighting, configurable search match theme colors, and next/previous navigation with `Enter`/`Ctrl+G` and `Shift+Enter`/`Ctrl+Shift+G`.
139
319
  - Added experimental strict JSON-schema constrained sampling for the default `read`, `bash`, `edit`, and `write` tools under `PI_EXPERIMENTAL=1`.
140
320
  - Added a fullscreen exit output setting to choose between printing the final transcript and only a session resume hint.
package/bin/README.md CHANGED
@@ -130,6 +130,7 @@ For each built-in provider, pi maintains a list of tool-capable models. Configur
130
130
  - Together AI
131
131
  - Baseten
132
132
  - Kimi For Coding
133
+ - Meta
133
134
  - MiniMax
134
135
  - Xiaomi MiMo
135
136
  - Xiaomi MiMo Token Plan (China)
@@ -152,7 +153,7 @@ The interface from top to bottom:
152
153
 
153
154
  - **Startup header** - Shows shortcuts (`/hotkeys` for all), loaded AGENTS.md files, prompt templates, skills, and extensions
154
155
  - **Messages** - Your messages, assistant responses, tool calls and results, notifications, errors, and extension UI
155
- - **Editor** - Where you type; border color indicates thinking level
156
+ - **Editor** - Where you type; border color indicates thinking level and the border shows the streaming working indicator
156
157
  - **Footer** - Working directory, session name, total token/cache usage (`↑` input, `↓` output, `R` cache read, `W` cache write, `CH` latest cache hit rate), cost, context usage, current model. Totals include assistant responses, usage reported by tools, and summary generation.
157
158
 
158
159
  The editor can be temporarily replaced by other UI, like built-in `/settings` or custom UI from extensions (e.g., a Q&A tool that lets the user answer model questions in a structured format). [Extensions](#extensions) can also replace the editor, add widgets above/below it, a status line, custom footer, or overlays.
@@ -195,6 +196,7 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
195
196
  | `/export [file]` | Export session to HTML or JSONL file |
196
197
  | `/import <file>` | Import and resume a session from a JSONL file |
197
198
  | `/share` | Upload as private GitHub gist with shareable HTML link |
199
+ | `/bug [description]` | Report a bug to the Pi developers; see [Sessions](docs/sessions.md#reporting-bugs) |
198
200
  | `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
199
201
  | `/hotkeys` | Show all keyboard shortcuts |
200
202
  | `/changelog` | Display version history |
@@ -255,7 +257,7 @@ Use `/session` in interactive mode to see the current session ID before reusing
255
257
 
256
258
  ### Branching
257
259
 
258
- **`/tree`** - Navigate the session tree in-place. Select any previous point, continue from there, and switch between branches. All history preserved in a single file.
260
+ **`/tree`** - Navigate the session tree in-place. Select any previous point, continue from there, and switch between branches. All history preserved in a single file. Selecting a point while the model is responding cancels that response. Navigation cannot proceed while compaction or another tree navigation is still running; wait for it to finish and retry.
259
261
 
260
262
  <p align="center"><img src="docs/images/tree-view.png" alt="Tree View" width="600"></p>
261
263
 
@@ -2,12 +2,12 @@
2
2
 
3
3
  LLMs have limited context windows. When conversations grow too long, Pi uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
4
4
 
5
- **Source files** ([pi-mono](https://github.com/earendil-works/pi-mono)):
6
- - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
7
- - [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
8
- - [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
9
- - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
10
- - [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
5
+ **Source files** ([pi](https://github.com/earendil-works/pi)):
6
+ - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
7
+ - [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
8
+ - [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
9
+ - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
10
+ - [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
11
11
 
12
12
  For TypeScript definitions in your project, inspect `node_modules/@earendil-works/pi-coding-agent/dist/`.
13
13
 
@@ -120,7 +120,7 @@ Never cut at tool results (they must stay with their tool call).
120
120
 
121
121
  ### CompactionEntry Structure
122
122
 
123
- Defined in [`session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
123
+ Defined in [`session-manager.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/session-manager.ts):
124
124
 
125
125
  ```typescript
126
126
  interface CompactionEntry<T = unknown> {
@@ -145,7 +145,7 @@ interface CompactionDetails {
145
145
 
146
146
  Extensions can store any JSON-serializable data in `details`. The default compaction tracks file operations, but custom extension implementations can use their own structure. Generated and extension-provided summaries store their LLM `usage` when available so session totals include summarization work.
147
147
 
148
- See [`prepareCompaction()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation. For direct programmatic summarization, `generateSummary()` returns the summary text and `generateSummaryWithUsage()` returns `{ text, usage }`.
148
+ See [`prepareCompaction()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation. For direct programmatic summarization, `generateSummary()` returns the summary text and `generateSummaryWithUsage()` returns `{ text, usage }`.
149
149
 
150
150
  ## Branch Summarization
151
151
 
@@ -188,7 +188,7 @@ This means file tracking accumulates across multiple compactions or nested branc
188
188
 
189
189
  ### BranchSummaryEntry Structure
190
190
 
191
- Defined in [`session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
191
+ Defined in [`session-manager.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/session-manager.ts):
192
192
 
193
193
  ```typescript
194
194
  interface BranchSummaryEntry<T = unknown> {
@@ -212,7 +212,7 @@ interface BranchSummaryDetails {
212
212
 
213
213
  Same as compaction, extensions can store custom data in `details`.
214
214
 
215
- See [`collectEntriesForBranchSummary()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
215
+ See [`collectEntriesForBranchSummary()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
216
216
 
217
217
  ## Summary Format
218
218
 
@@ -256,7 +256,7 @@ path/to/changed.ts
256
256
 
257
257
  ### Message Serialization
258
258
 
259
- Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
259
+ Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
260
260
 
261
261
  ```
262
262
  [User]: What they said
@@ -272,7 +272,7 @@ Tool results are truncated to 2000 characters during serialization. Content beyo
272
272
 
273
273
  ## Custom Summarization via Extensions
274
274
 
275
- Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
275
+ Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
276
276
 
277
277
  ### session_before_compact
278
278
 
@@ -288,7 +288,7 @@ pi.on("session_before_compact", async (event, ctx) => {
288
288
  // preparation.fileOps - extracted file operations
289
289
  // preparation.tokensBefore - context tokens before compaction
290
290
  // preparation.firstKeptEntryId - where kept messages start
291
- // preparation.settings - compaction settings
291
+ // preparation.settings - effective settings after applying model overrides
292
292
 
293
293
  // branchEntries - all entries on current branch (for custom state)
294
294
  // reason - "manual" (/compact), "threshold", or "overflow"
@@ -416,3 +416,29 @@ Configure compaction in `~/.pi/agent/settings.json` or `<project-dir>/.pi/settin
416
416
  | `keepRecentTokens` | `20000` | Recent tokens to keep (not summarized) |
417
417
 
418
418
  Disable auto-compaction with `"enabled": false`. You can still compact manually with `/compact`.
419
+
420
+ ### Per-model overrides
421
+
422
+ Use `compaction.modelOverrides` to tune token budgets for different models:
423
+
424
+ ```json
425
+ {
426
+ "compaction": {
427
+ "reserveTokens": 16384,
428
+ "keepRecentTokens": 20000,
429
+ "modelOverrides": {
430
+ "some-provider/big-model": {
431
+ "reserveTokens": 400000
432
+ }
433
+ }
434
+ }
435
+ }
436
+ ```
437
+
438
+ For a model with a 1M context window, this override triggers compaction above 600K tokens and keeps the ordinary 20000 recent tokens. Other models retain the ordinary 16384-token reserve. `reserveTokens` also influences summarization output limits, capped by the model's maximum output tokens; it is not solely a trigger threshold.
439
+
440
+ Keys are exact, case-sensitive `provider/modelId` values, including any slashes within the model ID. Each `reserveTokens` and `keepRecentTokens` value falls back independently from the model override to the ordinary setting to the built-in default. 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. `enabled` remains global, not model-specific.
441
+
442
+ These resolved values are used for manual compaction, all automatic threshold checks, overflow recovery, and extension-visible `preparation.settings`. Model switches affect subsequent checks and compactions without changing ordinary settings. Compaction already in progress uses the model and settings captured for that operation. Branch summarization settings are unaffected.
443
+
444
+ Overrides work in both global and project settings. The files merge recursively before lookup, so a global model-specific value beats a project-wide fallback; a project must override that model entry to change it. See [settings.md](settings.md#per-model-compaction-overrides) for details.
@@ -13,6 +13,7 @@ There are two general options. You can either
13
13
  | Gondolin extension | Built-in tools and `!` commands | Local micro-VM isolation while keeping auth on host | See [`examples/extensions/gondolin/`](../examples/extensions/gondolin/). |
14
14
  | Plain Docker | Whole `pi` process in a local container | Simple local isolation | Provider API keys enter the container. |
15
15
  | OpenShell | Whole `pi` process in a policy-controlled sandbox | Local or remote managed sandbox | Requires an OpenShell gateway |
16
+ | Docker Sandboxes | Whole `pi` process in a managed sandbox | Local isolation with provider keys kept on the host | Requires Docker Sandboxes (`sbx`). |
16
17
 
17
18
  Extensions run wherever the `pi` process runs. If you run host `pi` with a tool-routing extension, other custom extension tools still run on the host unless they also delegate their operations.
18
19
 
@@ -109,3 +110,47 @@ openshell sandbox download pi-sandbox /workspace/repo ./repo-out
109
110
  OpenShell providers can keep raw model API keys outside the sandbox.
110
111
  When inference routing is configured, code inside the sandbox can call `https://inference.local`, and the gateway injects the configured provider credentials upstream.
111
112
  Configure Pi to use the corresponding OpenAI-compatible or Anthropic-compatible endpoint if you want model traffic to use this route.
113
+
114
+ ## Docker Sandboxes
115
+
116
+ [Docker Sandboxes](https://docs.docker.com/ai/sandboxes/) is a managed sandbox runtime from Docker that runs the whole `pi` process inside a sandbox.
117
+ It is one of the container boundaries [No Built-in Sandbox](security.md#no-built-in-sandbox) points to.
118
+
119
+ Unlike the Plain Docker pattern above, the provider credential is not passed into the container.
120
+ The sandbox receives a sentinel value instead, and the `sbx` proxy substitutes the real credential on egress to `api.anthropic.com`.
121
+ Credentials are wired at creation time, so store yours on the host before you create the sandbox.
122
+
123
+ For a Claude Pro/Max subscription, run `claude setup-token` on a machine with Claude Code, then store the result on the host.
124
+ If an `anthropic` secret is already bound, remove it first: otherwise the proxy adds an `x-api-key` header alongside the Bearer token and Anthropic rejects the request.
125
+ `sbx secret set-custom` reads the token from stdin, so it stays out of shell history.
126
+
127
+ ```bash
128
+ sbx secret rm anthropic
129
+
130
+ sbx secret set-custom \
131
+ --host api.anthropic.com \
132
+ --env ANTHROPIC_OAUTH_TOKEN \
133
+ --placeholder 'sk-ant-oat01-{rand}'
134
+ ```
135
+
136
+ The sandbox gets an OAuth-shaped placeholder, not the real token, and the proxy swaps it on egress to that host; `ANTHROPIC_OAUTH_TOKEN` is a variable pi already reads and prefers over an API key, so no extra pi configuration is needed.
137
+
138
+ For an API key, store it with `sbx secret set anthropic` instead. The kit wires it the same way, as a sentinel the proxy substitutes on egress.
139
+
140
+ With the credential stored, launch `pi` from the project you want mounted:
141
+
142
+ ```bash
143
+ sbx run --kit "docker.io/sbx/pi-kit:latest" pi
144
+ ```
145
+
146
+ The kit pre-bakes `pi` into its image, so the sandbox starts without installing anything, and the current directory is the sandbox workspace.
147
+
148
+ Do not authenticate from inside the sandbox: `/login` there writes a real token into the container and defeats the proxy model.
149
+
150
+ Scripted use works the same way:
151
+
152
+ ```bash
153
+ sbx exec <sandbox-name> -- pi -p "list the failing tests"
154
+ ```
155
+
156
+ See the [kit documentation](https://github.com/docker/sbx-kits-contrib/tree/main/pi) for the full credential matrix, troubleshooting, and pinning.
@@ -397,34 +397,40 @@ interface OAuthCredentials {
397
397
  For providers with non-standard APIs, implement `streamSimple`. Study the existing API implementations before writing your own:
398
398
 
399
399
  **Reference implementations:**
400
- - [anthropic-messages.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/api/anthropic-messages.ts) - Anthropic Messages API
401
- - [mistral-conversations.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/api/mistral-conversations.ts) - Mistral Conversations API
402
- - [openai-completions.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/api/openai-completions.ts) - OpenAI Chat Completions
403
- - [openai-responses.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/api/openai-responses.ts) - OpenAI Responses API
404
- - [google-generative-ai.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/api/google-generative-ai.ts) - Google Generative AI
405
- - [bedrock-converse-stream.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/api/bedrock-converse-stream.ts) - AWS Bedrock
400
+ - [anthropic-messages.ts](https://github.com/earendil-works/pi/blob/main/packages/ai/src/api/anthropic-messages.ts) - Anthropic Messages API
401
+ - [mistral-conversations.ts](https://github.com/earendil-works/pi/blob/main/packages/ai/src/api/mistral-conversations.ts) - Mistral Conversations API
402
+ - [openai-completions.ts](https://github.com/earendil-works/pi/blob/main/packages/ai/src/api/openai-completions.ts) - OpenAI Chat Completions
403
+ - [openai-responses.ts](https://github.com/earendil-works/pi/blob/main/packages/ai/src/api/openai-responses.ts) - OpenAI Responses API
404
+ - [google-generative-ai.ts](https://github.com/earendil-works/pi/blob/main/packages/ai/src/api/google-generative-ai.ts) - Google Generative AI
405
+ - [bedrock-converse-stream.ts](https://github.com/earendil-works/pi/blob/main/packages/ai/src/api/bedrock-converse-stream.ts) - AWS Bedrock
406
406
 
407
407
  ### Stream Pattern
408
408
 
409
- All providers follow the same pattern:
409
+ All providers follow the same pattern. The context is a normalized transcript: the system prompt and tool declarations live in its system messages, so read them with `getCurrentSystemPrompt(context.messages)` and `getCurrentTools(context.messages)` rather than expecting `context.systemPrompt` or `context.tools`. Models that accept system messages mid-conversation can send them in place; otherwise call `collapseSystemMessages(context)` first to fold later system messages into the leading one.
410
410
 
411
411
  ```typescript
412
412
  import {
413
413
  type AssistantMessage,
414
414
  type AssistantMessageEventStream,
415
- type Context,
416
415
  type Model,
417
416
  type SimpleStreamOptions,
417
+ type TranscriptContext,
418
418
  calculateCost,
419
+ collapseSystemMessages,
419
420
  createAssistantMessageEventStream,
421
+ getCurrentSystemPrompt,
422
+ getCurrentTools,
420
423
  } from "@earendil-works/pi-ai";
421
424
 
422
425
  function streamMyProvider(
423
426
  model: Model<any>,
424
- context: Context,
427
+ context: TranscriptContext,
425
428
  options?: SimpleStreamOptions
426
429
  ): AssistantMessageEventStream {
427
430
  const stream = createAssistantMessageEventStream();
431
+ const transcript = collapseSystemMessages(context);
432
+ const systemPrompt = getCurrentSystemPrompt(transcript.messages);
433
+ const tools = getCurrentTools(transcript.messages);
428
434
 
429
435
  (async () => {
430
436
  // Initialize output message
@@ -571,7 +577,7 @@ When a request exceeds the model's context window, pi can recover automatically
571
577
  Detection runs on the finalized assistant message:
572
578
 
573
579
  - `stopReason === "error"`
574
- - `errorMessage` matches one of pi's known overflow patterns (see [`packages/ai/src/utils/overflow.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/utils/overflow.ts))
580
+ - `errorMessage` matches one of pi's known overflow patterns (see [`packages/ai/src/utils/overflow.ts`](https://github.com/earendil-works/pi/blob/main/packages/ai/src/utils/overflow.ts))
575
581
 
576
582
  If your provider returns overflow errors with a message pi does not recognize, normalize the error from the same extension that registers the provider. Use a `message_end` handler to rewrite the assistant message so its `errorMessage` starts with a phrase pi recognizes. The generic fallback `context_length_exceeded` is the safest choice.
577
583
 
@@ -634,7 +640,7 @@ pi.registerProvider("my-provider", {
634
640
 
635
641
  ## Testing Your Implementation
636
642
 
637
- Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/earendil-works/pi-mono/tree/main/packages/ai/test):
643
+ Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/earendil-works/pi/tree/main/packages/ai/test):
638
644
 
639
645
  | Test | Purpose |
640
646
  |------|---------|
@@ -668,10 +674,10 @@ interface ProviderConfig {
668
674
  /** API type for streaming. Required at provider or model level when defining models. */
669
675
  api?: Api;
670
676
 
671
- /** Custom streaming implementation for non-standard APIs. */
677
+ /** Custom streaming implementation for non-standard APIs. Receives a normalized transcript. */
672
678
  streamSimple?: (
673
679
  model: Model<Api>,
674
- context: Context,
680
+ context: TranscriptContext,
675
681
  options?: SimpleStreamOptions
676
682
  ) => AssistantMessageEventStream;
677
683
 
@@ -727,6 +733,9 @@ interface ProviderModelConfig {
727
733
  cacheWrite: number;
728
734
  };
729
735
 
736
+ /** Best-effort prompt cache lifetime in seconds per retention tier. Unset disables cache warming. */
737
+ promptCache?: { short?: number; long?: number };
738
+
730
739
  /** Maximum context window size in tokens. */
731
740
  contextWindow: number;
732
741
 
@@ -1,12 +1,12 @@
1
1
  # Development
2
2
 
3
- See [AGENTS.md](https://github.com/earendil-works/pi-mono/blob/main/AGENTS.md) for additional guidelines.
3
+ See [AGENTS.md](https://github.com/earendil-works/pi/blob/main/AGENTS.md) for additional guidelines.
4
4
 
5
5
  ## Setup
6
6
 
7
7
  ```bash
8
- git clone https://github.com/earendil-works/pi-mono
9
- cd pi-mono
8
+ git clone https://github.com/earendil-works/pi
9
+ cd pi
10
10
  npm install
11
11
  npm run build
12
12
  ```
@@ -14,11 +14,24 @@ npm run build
14
14
  Run from source:
15
15
 
16
16
  ```bash
17
- /path/to/pi-mono/pi-test.sh
17
+ /path/to/pi/pi-test.sh
18
18
  ```
19
19
 
20
20
  The script can be run from any directory. Pi keeps the caller's current working directory.
21
21
 
22
+ ### Experimental remote harness
23
+
24
+ The remote harness server/client integration is development-only. Run it from the repository with:
25
+
26
+ ```bash
27
+ PI_EXPERIMENTAL=1 ./pi-test.sh server
28
+ PI_EXPERIMENTAL=1 ./pi-test.sh client
29
+ ```
30
+
31
+ `PI_SERVER_DIR` overrides the server profile and socket directory (default: `~/.pi/server`). `PI_SERVER_ID` selects the logical server ID when `--server-id` is omitted.
32
+
33
+ The `client` and `experimental/plugin` package subpaths resolve only under the `source` condition in a checkout. Their implementations and the server/client commands are excluded from npm packages and standalone binaries. `pi-client`, `pi-protocol`, and `pi-server` are development dependencies of coding-agent, not runtime dependencies. The local SDK and stdio RPC API are unchanged.
34
+
22
35
  ## Forking / Rebranding
23
36
 
24
37
  Configure via `package.json`:
@@ -60,6 +73,12 @@ npm test # Run all tests
60
73
  npm test -- test/specific.test.ts # Run specific test
61
74
  ```
62
75
 
76
+ ### Published package smoke test
77
+
78
+ After building, run `npm run check:package-install`. It packs the public packages and installs only coding-agent as a direct dependency in a temporary directory outside the repository. Local tarball overrides select declared transitive dependencies without installing development-only packages. The check verifies SDK imports and CLI startup without credentials or model requests.
79
+
80
+ `npm run check` also checks runtime dependency declarations and rejects excluded development sources pulled into a package's build through imports.
81
+
63
82
  ## Project Structure
64
83
 
65
84
  ```
@@ -81,6 +81,10 @@
81
81
  {
82
82
  "title": "Reference",
83
83
  "items": [
84
+ {
85
+ "title": "Environment Variables",
86
+ "path": "environment-variables.md"
87
+ },
84
88
  {
85
89
  "title": "Session Format",
86
90
  "path": "session-format.md"
@@ -86,6 +86,7 @@ These variables are read by Pi itself:
86
86
  | `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no` |
87
87
  | `PI_CACHE_RETENTION` | Set to `long` for extended provider prompt caching where supported |
88
88
  | `PI_SHARE_VIEWER_URL` | Override the base URL used by `/share` |
89
+ | `PI_RADIUS_GATEWAY` | Override the Radius gateway origin used by `/bug` uploads and Radius relay connections |
89
90
  | `PI_HARDWARE_CURSOR` | Set to `1` to show the hardware cursor; see [Terminal setup](terminal-setup.md) |
90
91
  | `PI_HYPERLINKS` | Override OSC 8 hyperlink detection with `1`, `0`, or `auto` |
91
92
  | `PI_IMAGE_PROTOCOL` | Override inline image detection with `kitty`, `iterm2`, `none`, or `auto` |
@@ -95,3 +96,5 @@ These variables are read by Pi itself:
95
96
  | `HTTP_PROXY`, `HTTPS_PROXY` | Proxy outbound HTTP requests |
96
97
 
97
98
  Provider credentials such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and cloud-provider configuration are listed in [Providers](providers.md#environment-variables-or-auth-file).
99
+
100
+ `PI_SERVER_DIR` and `PI_SERVER_ID` apply only to the source-only [experimental remote harness](development.md#experimental-remote-harness), not distributed builds.