@kliebhan/pi-prompt-autocomplete 0.2.5 → 0.3.0

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  All notable changes to this package are documented here. This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## [0.3.0] - 2026-10-13
6
+
7
+ ### Changed
8
+
9
+ - Supports Pi 1.x. Ghost text recognizes Pi 1.x fake-cursor markers next to the inverse-video cursor of Pi 0.x and the `\x1b[27m` variant of forked hosts, so suggestions keep rendering on all three. The compatibility matrix now covers Pi `0.80.6`, `0.83.0`, and `1.2.0`; the supported baseline stays `0.80.6`.
10
+ - On Pi 1.x, autocomplete requests route through the session's model registry instead of the global `pi-ai` compat functions. Those only serve Pi's built-in APIs on Pi 1.x, so a model from a provider that another extension registers with its own streaming implementation failed with "No API provider registered"; the registry serves those providers and resolves each provider's stored credential itself. No pre-resolved key is passed, because an explicit key would make Pi skip the stored credential and with it an OAuth-derived endpoint such as GitHub Copilot Enterprise's; header-only and ambient credentials are accepted on this path. Hosts without a registry entry point keep the compat functions, which still require an API key.
11
+ - On Pi 1.x, autocomplete context follows the model-visible session projection: messages that a `context_edit` omitted or replaced, for example to redact them, are omitted or replaced in autocomplete requests too, so autocomplete never sends what the model itself no longer sees. A failing projection sends no conversation context instead of the raw history. Older hosts, which have no context edits, keep using the raw branch. Besides user and assistant message text, autocomplete context includes only the newest compaction summary (see Added). The projection scans the whole session, so it is rebuilt only when the context-relevant conversation changes, not on every keystroke.
12
+ - Cache and stream currency now follow the newest conversation entry that affects autocomplete context, not Pi's raw leaf. Custom, label, and session-info entries can move the leaf without discarding an otherwise identical cached suggestion.
13
+ - Automatic suggestions wait for `agent_settled` on hosts that emit it, so a retry or queued continuation cannot use unfinished conversation context. Hosts without that event still settle on `agent_end`. Manual `Ctrl+.` remains an explicit one-shot.
14
+ - The read-only commands `status`, `stats`, and `inspect` now also run on hosts that can show notifications but have no interactive editor, such as RPC; there `status` reports `host=non-interactive` and `editor=unavailable`. Commands that change state or touch the editor stay TUI-only, and no provider seam is reachable outside the TUI. An extension enabled on such a host says once per process that it cannot issue requests.
15
+ - When another extension replaces the editor during a request, the request is now released at the first streamed progress or terminal response the old editor observes, instead of running to completion. Its result is never painted and the foreign editor is never touched.
16
+ - The documentation no longer claims that `stream`, `while-streaming`, and `debug-*` decisions survive `/new`: Pi replaces the extension runtime on `/new`, `/resume`, `/fork`, and `/reload`, so these runtime-only decisions end with it, while `on`/`off`, `min-chars`, and `set` persist through the settings file.
17
+ - The Gallery video now records a real Pi 1.2.0 session: streamed ghost text with alternatives, argument completion with runtime tuning, `inspect`, and an exhausted session budget. A local demo provider answers, so the recording needs no credentials and makes no network request.
18
+
19
+ ### Added
20
+
21
+ - `/prompt-autocomplete set` persists the remaining runtime knobs (`debounce-ms`, `max-chars`, `max-alternatives`, and `model`) through the settings file that already stores the enable decision and `min-chars`. Bare `set` prints `status`. Interactive out-of-range values are rejected rather than clamped. A dedicated model is validated against the registry and auth before commit; `active` is an explicit sentinel that commits while no active model is known yet but is rejected when the known active model is unusable; mixed-case model identifiers are preserved; a cross-provider change restates the privacy notice, comparing configured destinations so an unusable previous model still triggers it. Request-identity changes cancel in-flight work without starting a replacement; debounce-only changes drop a waiting timer without aborting an in-flight call. `/prompt-autocomplete min-chars` remains the canonical command. Success notices only claim durability when the settings file was actually written.
22
+ - `--prompt-autocomplete-max-requests <n|off>` and `/prompt-autocomplete budget <n|off>` cap provider requests per session; the default `off` preserves existing behaviour. Only real invocations count, including failed and aborted ones and those made while the ceiling was off, while exact-cache hits, prefix reuse, and in-flight joins stay free. The reservation is taken synchronously after auth and immediately before the provider call, so concurrent requests cannot overshoot and a request whose credentials do not resolve consumes nothing. An exhausted budget blocks automatic and manual requests, reports itself once per exhaustion state, and never starts a replacement request. Usage and ceiling are snapshotted into the session's own non-LLM entries — never into `settings.json` — so `/new` and `/fork` start with a fresh usage count while a graceful `/reload` or `/resume` restores usage and ceiling; restoration scans the whole session and never lets usage go backwards, so branch switches cannot buy extra requests. A session that never touched the budget writes no entries. A ceiling set with `/prompt-autocomplete budget` belongs to the session as well: `/reload` and `/resume` restore it, `/new` and `/fork` start from the CLI flag. `status` and `stats` report `used/limit` with its source.
23
+ - `/prompt-autocomplete inspect [draft text]` previews locally what a request would send: resolved and requested model, the conversation sections with sizes and sanitized excerpts, the transmitted draft tail, the exact request size, output and token ceilings, and the shared request policy for automatic and manual requests. It renders the same request snapshot as the provider path, makes no provider request, persists nothing, and never shows credentials or headers. Without draft text it reports the conversation sections only instead of inventing a draft.
24
+ - `/prompt-autocomplete` completes its arguments in Pi's command menu, including nested forms such as `set debounce-ms`, `set model active`, `budget off`, and `stream on`. Values replace the whole argument span; an already complete command such as `stats` or `stream` opens no menu, so one `Enter` still submits it. Completion is local and synchronous and installs no global autocomplete provider. One grammar table now drives command dispatch, the usage texts (unchanged byte for byte), the completions, and a test that the README documents every command and `set` key.
25
+ - After a compaction, autocomplete requests include the newest compaction summary as a separate background section, bounded to 1,500 characters with the middle elided so the goal and the next steps survive. It applies on hosts with Pi's model-visible session projection (Pi 1.x), where the summarized messages are no longer part of the context; older hosts keep sending the raw messages instead. The compaction's system checkpoint, custom messages, and tool results are never sent. The summary is part of the request cache identity, and `/prompt-autocomplete inspect` shows its size and an excerpt.
26
+
5
27
  ## [0.2.5] - 2026-08-07
6
28
 
7
29
  ### Added
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Inline AI completions for the [Pi coding agent](https://github.com/earendil-works/pi-mono), rendered as unobtrusive ghost text in the prompt editor.
4
4
 
5
- [Watch the demo](https://github.com/KLIEBHAN/pi-extensions/releases/download/pi-prompt-autocomplete-v0.2.5/prompt-autocomplete-demo.mp4)
5
+ [Watch the demo](https://github.com/KLIEBHAN/pi-extensions/releases/download/pi-prompt-autocomplete-v0.3.0/prompt-autocomplete-demo.mp4)
6
6
 
7
7
  ## Install
8
8
 
@@ -24,7 +24,7 @@ Prompt Autocomplete is **disabled by default**. Enable it explicitly for a proce
24
24
  pi --prompt-autocomplete
25
25
  ```
26
26
 
27
- Or enable it for the current interactive session:
27
+ Or enable it from inside an interactive session; the decision is saved for later sessions:
28
28
 
29
29
  ```text
30
30
  /prompt-autocomplete on
@@ -40,12 +40,20 @@ Or enable it for the current interactive session:
40
40
  | Previous alternative | `Ctrl+,` |
41
41
  | Dismiss the suggestion for this draft | `Escape` |
42
42
  | Enable, disable, or inspect configuration | `/prompt-autocomplete on\|off\|toggle\|status` |
43
- | Show current-session effectiveness and cost | `/prompt-autocomplete stats` |
43
+ | Show in-memory effectiveness and cost counters | `/prompt-autocomplete stats` |
44
+ | Preview what a request would send, locally | `/prompt-autocomplete inspect [draft text]` |
44
45
  | Toggle streamed response previews | `/prompt-autocomplete stream on\|off\|toggle` |
46
+ | Allow suggestions while the main agent works | `/prompt-autocomplete while-streaming on\|off\|toggle` |
45
47
  | Set and persist the minimum draft length | `/prompt-autocomplete min-chars <n>` |
48
+ | Cap provider requests for this session | `/prompt-autocomplete budget <n\|off>` |
49
+ | Persist remaining runtime knobs | `/prompt-autocomplete set debounce-ms\|max-chars\|max-alternatives\|model` |
50
+ | Inspect effective runtime knobs | `/prompt-autocomplete set` |
51
+ | Show or hide the debug status line | `/prompt-autocomplete debug-on\|debug-off\|debug-toggle` |
46
52
 
47
53
  Legacy fallbacks are available for terminals that forward them: `Ctrl+Tab`, `Alt+[`, and `Alt+]`.
48
54
 
55
+ After `/prompt-autocomplete ` and a few letters, Pi's command menu completes the arguments, including nested forms such as `set debounce-ms` or `set model active`; `Tab` or `Enter` inserts the selection. A command that is already complete, such as `stats` or `stream on`, opens no menu, so `Enter` still submits it at once. Completion is local and installs no global autocomplete provider.
56
+
49
57
  Built-in slash-command and file/path completion keeps precedence over ghost suggestions.
50
58
 
51
59
  ### Configuration
@@ -58,7 +66,8 @@ pi \
58
66
  --prompt-autocomplete-min-chars 1 \
59
67
  --prompt-autocomplete-debounce-ms 250 \
60
68
  --prompt-autocomplete-max-chars 240 \
61
- --prompt-autocomplete-max-alternatives 3
69
+ --prompt-autocomplete-max-alternatives 3 \
70
+ --prompt-autocomplete-max-requests off
62
71
  ```
63
72
 
64
73
  - The active Pi model is used unless `--prompt-autocomplete-model provider/model` selects a dedicated authenticated model; `active` selects the session model explicitly. An explicitly requested model is never substituted: if it is unknown, unauthenticated, or malformed, autocomplete stays inactive and reports why.
@@ -67,19 +76,33 @@ pi \
67
76
  - Changing `/prompt-autocomplete stream` cancels active autocomplete work but does **not** start a replacement request; the selected path applies to the next edit or manual one-shot.
68
77
  - Partial text advances monotonically: Latin text waits for complete word boundaries, while CJK and other no-space scripts remain grapheme-safe. Alternatives appear only after the response finishes.
69
78
  - `Tab` accepts all partial text currently visible. `Ctrl+Space` accepts only its next visible word/chunk. Both cancel that stream, and unlike accepting a completed suggestion, neither automatically starts another paid request.
70
- - Suggestions pause while the **main agent** is streaming by default. This is separate from streamed autocomplete responses. Use `--prompt-autocomplete-while-streaming` or `/prompt-autocomplete while-streaming on` to change that behavior.
79
+ - Suggestions pause while the **main agent** is working by default, and stay paused until `agent_settled` on hosts that emit it. This is separate from streamed autocomplete responses. Use `--prompt-autocomplete-while-streaming` or `/prompt-autocomplete while-streaming on` to change that behavior.
71
80
  - `Ctrl+.` with no active suggestion is an explicit one-shot request and may bypass the main-agent-streaming, cooldown, and minimum-length gates. Model, authentication, slash-command, and path safety checks still apply.
72
81
  - Use `--prompt-autocomplete-debug` or `/prompt-autocomplete debug-on` for troubleshooting.
73
82
 
74
- Slash-command toggles (`on`, `off`, `stream`, `while-streaming`, `debug-*`) outrank the CLI flags for the rest of the process, including in sessions started later. `status` labels each toggle with its source, `(flag)`, `(saved)`, or `(session)`. Settings you never toggled keep following their flag.
83
+ Slash-command decisions outrank the CLI flags. `on`, `off`, `min-chars`, and `set` are also saved for later sessions and processes (see [Persistent settings](#persistent-settings)). `stream`, `while-streaming`, and `debug-*` live only in the current extension runtime: Pi replaces that runtime on `/new`, `/resume`, `/fork`, and `/reload`, after which their flags apply again. `status` labels each value with its source, `(flag)`, `(saved)`, or `(session)`. Settings you never toggled keep following their flag. Interactive `set` values outside the documented range are rejected rather than clamped; CLI flags still clamp.
84
+
85
+ Changing `max-chars`, `max-alternatives`, or `model` cancels in-flight autocomplete work and drops the request caches. It does **not** start a replacement request. Changing `debounce-ms` only drops a waiting timer; an already-started provider call continues. Debug toggles change neither.
86
+
87
+ #### Session request budget
88
+
89
+ `--prompt-autocomplete-max-requests <n|off>` and `/prompt-autocomplete budget <n|off>` cap how many provider requests one session may issue. The default `off` keeps the 0.2 behaviour.
90
+
91
+ - Only real provider invocations count, including failed and aborted ones, and including invocations made while the ceiling was off — enabling a ceiling later cannot hand out an allowance that ignores what the session already spent. Exact-cache hits, prefix reuse, and joining an in-flight request are free and keep working above the ceiling.
92
+ - A request whose credentials do not resolve consumes nothing: the reservation happens after credentials resolve and immediately before the provider call, so two concurrent requests can never overshoot a ceiling of one. If a credential fails only inside the provider call, for example an OAuth token revoked in between, that counts like any failed call.
93
+ - An exhausted budget blocks automatic **and** manual (`Ctrl+.`) requests and reports itself once per exhaustion state. Raise the ceiling with `/prompt-autocomplete budget <n>` or lift it with `/prompt-autocomplete budget off`; neither starts a replacement request.
94
+ - The budget is **session-scoped**, not process-wide: usage and ceiling are snapshotted into the session's own non-LLM entries and never into `settings.json`. `/new` and `/fork` therefore start with a fresh usage count, while a graceful `/reload` or `/resume` of the same session restores usage and ceiling. Restoration scans the whole session rather than the current branch and never lets usage go backwards, so switching branches cannot buy extra requests. A session that never touched the budget writes no entries at all; once a ceiling has been set or restored, accounting stays durable even while the ceiling is off. A crash before the last snapshot, or a host without `pi.appendEntry`, can lose that durability — the in-process ceiling still applies.
95
+ - A ceiling set with `/prompt-autocomplete budget` belongs to the session as well: `/reload` and `/resume` restore it, while `/new` and `/fork` start from the CLI flag or `off`. A CLI flag applies to its invocation, and `status` labels the ceiling `(flag)`, `(saved)`, or `(session)`.
96
+ - Interactive values outside `1`–`100000` are rejected; the CLI flag clamps. `budget` without an argument, `status`, and `stats` all report `used/limit` with the source of the ceiling. The budget counter and the `stats` block have different scopes: `stats` covers the current extension runtime and restarts after a reload, while the budget counter covers the physical session and survives one.
97
+ - This is a request ceiling only: there is no token or dollar budget.
75
98
 
76
99
  #### Persistent settings
77
100
 
78
- `/prompt-autocomplete on`, `off`, and `min-chars <n>` are durable: the decision is saved to `$XDG_CONFIG_HOME/pi-prompt-autocomplete/settings.json` (falling back to `~/.config`; override the location with `PI_PROMPT_AUTOCOMPLETE_SETTINGS`) and applies to later processes without any CLI flag. An explicit CLI flag still outranks the saved value for that invocation — for `min-chars`, passing the default (`1`) is indistinguishable from not passing the flag and defers to the saved value. An enable decision is only recorded when the host actually installs the editor. The file stores nothing but these decisions; deleting it restores flag-only behaviour. `status` labels each value with its source.
101
+ `/prompt-autocomplete on`, `off`, `min-chars <n>`, and `/prompt-autocomplete set` (`debounce-ms`, `max-chars`, `max-alternatives`, `model`) are durable: the decision is saved to `$XDG_CONFIG_HOME/pi-prompt-autocomplete/settings.json` (falling back to `~/.config`; override the location with `PI_PROMPT_AUTOCOMPLETE_SETTINGS`) and applies to later processes without any CLI flag. `/prompt-autocomplete min-chars` remains the canonical command; `set min-chars` dispatches to it. An explicit CLI flag still outranks the saved value for that invocation — for numeric knobs and the model flag, passing the registered default is indistinguishable from not passing the flag and defers to the saved value. `set model` validates syntax, registry presence, and auth before saving: a dedicated model must resolve, and `active` commits while no active model is known yet but is rejected when the known active model is unusable. `active` is an explicit sentinel for the session model, mixed-case model ids are preserved, and a cross-provider change restates the privacy notice. An enable decision is only recorded when the host actually installs the editor. The file stores nothing but these decisions; deleting it restores flag-only behaviour. `status` labels each value with its source, and success notices only claim durability when the file was actually written.
79
102
 
80
103
  ### Usage and cost accounting
81
104
 
82
- `/prompt-autocomplete stats` gives the current session a dedicated, readable report:
105
+ `/prompt-autocomplete stats` gives the in-memory counters a dedicated, readable report:
83
106
 
84
107
  ```text
85
108
  Prompt Autocomplete — current session
@@ -88,6 +111,7 @@ Cache: 5 hits (2 exact, 3 prefix)
88
111
  Suggestions: 8 offered, 3 accepted (2 full, 1 word/chunk)
89
112
  Usage: 1832 tokens, estimated cost ~$0.00214
90
113
  Mean provider latency: 410 ms (4 samples)
114
+ Budget: 4/25 (session)
91
115
  ```
92
116
 
93
117
  `/prompt-autocomplete status` keeps its existing compact `usage=4 req, 5 cached, …` field for configuration troubleshooting.
@@ -101,7 +125,15 @@ Mean provider latency: 410 ms (4 samples)
101
125
  - Token counts come from the provider.
102
126
  - **The cost is an estimate, not an invoice.** Pi derives it locally by multiplying the reported tokens with its own model price table, so it can disagree with what your provider actually bills.
103
127
  - A trailing `+` (`1832 tokens+`, `estimated cost ~$0.00214+`; compact `status`: `1832 tok+`, `~$0.00214 est+`) means at least one request did not report that metric, so the true total may be higher than shown. Tokens and cost are marked independently, because a response can report tokens without a cost figure.
104
- - Counters live only in memory, are scoped to the current session, and reset when a new session starts.
128
+ - Counters live only in memory and belong to the current extension runtime: they restart whenever Pi replaces it — a new session, `/resume`, `/fork`, or `/reload`. The session request budget is the exception and survives `/reload` and `/resume` (see [Session request budget](#session-request-budget)).
129
+
130
+ ### Inspecting a request
131
+
132
+ `/prompt-autocomplete inspect [draft text]` shows locally what an autocomplete request would send. It makes no provider request, persists nothing, and never shows credentials or headers; at most it warms the in-memory context cache that the next request in the same conversation reuses.
133
+
134
+ - The report renders the same request snapshot the provider path uses: the resolved and requested model, the latest assistant and user messages, the recent-conversation summary, the compaction summary, the transmitted draft tail, the exact request size, and the output and token ceilings. Long sections appear as character counts with short sanitized excerpts.
135
+ - Without draft text the report covers the conversation sections only. The slash command replaced the editor text when you submitted it, so the draft a real request would carry cannot be recovered and is not invented; pass one explicitly to preview a complete request. Pi trims trailing whitespace from submitted commands.
136
+ - `Shared policy` evaluates only the gates every editor shares — enabled state, editor ownership, the main-agent gate, model and auth, `min-chars` and slash/path detection for the given draft, and the session budget — separately for automatic requests and the manual `Ctrl+.` one-shot. Cursor position, the built-in autocomplete menu, Escape dismissal, the per-editor error cooldown, and cached responses belong to the live editor and are not evaluated.
105
137
 
106
138
  ## Privacy, providers, and cost
107
139
 
@@ -109,25 +141,31 @@ Enabling Prompt Autocomplete permits additional model requests. Streaming change
109
141
 
110
142
  - the current prompt draft or its bounded tail,
111
143
  - the latest user and assistant messages,
112
- - a bounded recent-conversation summary.
144
+ - a bounded recent-conversation summary,
145
+ - on hosts with Pi's model-visible session projection (Pi 1.x), the newest compaction summary, bounded to 1,500 characters with the middle elided.
113
146
 
114
- The active conversation leaf identity is used only in the local in-memory cache key and is not sent to the provider.
147
+ The newest conversation entry that affects autocomplete context is used only in the local in-memory cache key and is not sent to the provider. Custom, label, and session-info entries can move Pi's raw leaf without invalidating that key.
115
148
 
116
149
  By default, requests use the active model. A dedicated `--prompt-autocomplete-model` may send this context to a different provider, so an explicitly requested model that cannot be used suppresses requests instead of falling back to the active one. Requests can incur token charges and consume provider rate limits.
117
150
 
118
151
  Provider errors, raw responses, model identifiers, and host diagnostics are stripped of terminal control sequences and of bidirectional or invisible formatting characters before they are displayed, so untrusted text cannot repaint the terminal, hide output, drive OSC clipboard and hyperlink escapes, or misrepresent what it names.
119
152
 
120
- Successful results are cached only in memory for up to 60 seconds; a terminal entry retains its base draft in process memory for the prefix comparison. If the draft then grows by an exact prefix of a cached suggestion, Prompt Autocomplete removes the text you typed and shows the remaining suffix locally instead of issuing another provider request. Prefix reuse is forward-only, stays scoped to the same conversation leaf, model, bounded context and output configuration, and never uses partial streamed text. Divergence, expiry or any context change falls through to a fresh request. The caches are bounded and are cleared on session reset or when the extension is disabled. Provider failures are not cached.
153
+ Successful results are cached only in memory for up to 60 seconds; a terminal entry retains its base draft in process memory for the prefix comparison. If the draft then grows by an exact prefix of a cached suggestion, Prompt Autocomplete removes the text you typed and shows the remaining suffix locally instead of issuing another provider request. Prefix reuse is forward-only, stays scoped to the same context-relevant conversation, model, bounded context and output configuration, and never uses partial streamed text. Divergence, expiry or any context change falls through to a fresh request. The caches are bounded and are cleared on session reset or when the extension is disabled. Provider failures are not cached.
121
154
 
122
155
  The extension makes no autocomplete request while disabled. Automatic empty-draft requests are also disabled by default.
123
156
 
124
157
  ## Compatibility and editor ownership
125
158
 
126
159
  - Supported baseline: Pi `0.80.6`, Node.js `22.19.0` or newer.
127
- - Interactive ghost text requires Pi's TUI mode. RPC, JSON, and print modes do not install a custom editor.
160
+ - Every release is verified against Pi `0.80.6`, `0.83.0`, and `1.2.0`. Pi 1.x draws the editor cursor through fake-cursor markers instead of inverse video; ghost text supports both forms.
161
+ - On hosts that expose Pi's model-visible session projection (Pi 1.x), autocomplete context follows it: a message that `context_edit` omitted or replaced, for example to redact it, is omitted or replaced in autocomplete requests too. If that projection fails, requests carry no conversation context rather than the raw history. Besides user and assistant message text, autocomplete sends only the newest compaction summary, so suggestions keep the summarized background after a compaction; custom messages, tool results, and the compaction's system checkpoint are not sent.
162
+ - Interactive ghost text requires Pi's TUI mode. RPC, JSON, and print modes do not install a custom editor and never reach a provider.
163
+ - The read-only commands `status`, `stats`, and `inspect` also work on hosts that can show notifications, such as RPC; there `status` reports `host=non-interactive` and `editor=unavailable`. Every command that changes state or touches the editor stays TUI-only. If the extension is enabled on such a host, it says once per process that no autocomplete request will be issued.
128
164
  - Forks of Pi's extension API whose `ExtensionContext` predates `mode`, such as [prime-agent](https://www.npmjs.com/package/prime-agent), are supported. For those hosts the extension first requires UI availability and a custom-editor slot, and then verifies that the host actually installed the editor. A front-end that accepts an editor factory without installing it, as forked RPC and daemon modes do, is detected on the first attempt and stays inactive: it is not retried, not left enabled, and can neither render ghost text nor issue a provider request.
165
+ - On Pi 1.x, requests go through the session's model registry, which resolves each provider's stored credential itself. Models from providers that other extensions register therefore work as well, as do OAuth credentials that derive their own endpoint (such as GitHub Copilot Enterprise) and header-only or ambient credentials. Older hosts use the simple completion API below and need an API key.
129
166
  - The simple completion API is imported from the `@earendil-works/pi-ai` root specifier, which Pi maps to its compat entrypoint and such forks export directly. If a host exposes that module without `streamSimple`, the extension uses the completion path instead of failing requests.
130
167
  - Prompt Autocomplete requires exclusive ownership of Pi's custom-editor slot. It refuses to replace another custom editor and never removes a later replacement editor.
168
+ - If another extension replaces the editor while a request runs, the request is released at the next boundary the old editor observes — an edit, streamed progress, or the terminal response — and its result is never painted. Pi exposes no editor-change event, so a provider that never yields cannot be interrupted earlier.
131
169
 
132
170
  ## Development
133
171