pi-quiver 6.16.2 → 6.16.3
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 +4 -0
- package/README.md +1 -1
- package/extensions/fast-mode.ts +10 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
Format follows sibling pi packages (e.g. [`pi-condense`](https://github.com/jjuraszek/pi-condense/blob/main/CHANGELOG.md)):
|
|
4
4
|
one entry per `vX.Y.Z` tag, newest first, terse bullets, dated.
|
|
5
5
|
|
|
6
|
+
## v6.16.3 - 2026-11-17
|
|
7
|
+
|
|
8
|
+
- `fast-mode` applies to a custom provider entry whose `baseUrl` host is `api.anthropic.com`, not only to pi's built-in `anthropic` provider. Proxy providers stay excluded. (#41)
|
|
9
|
+
|
|
6
10
|
## v6.16.2 - 2026-11-15
|
|
7
11
|
|
|
8
12
|
- `fast-mode` covers every model in Anthropic's fast-mode availability table: Claude Fable 5.2 and Mythos 5.2 join Opus 5.5, Opus 5, and Opus 4.8. The `fast-mode-2026-02-01` beta header goes only to Opus 5 (research preview) and Opus 4.8 (deprecated), the two models Anthropic still requires it on; Fable 5.2, Mythos 5.2, and Opus 5.5 get `speed: "fast"` alone and keep the `anthropic-beta` header pi built. Opus 5.5 previously got the header through the `claude-opus-5` prefix, which dropped pi's `message-threads-2026-08-12` beta and cost a rejected first attempt on every request. Cost correction stays 2x, checked against the rate card for all five models. (#40)
|
package/README.md
CHANGED
|
@@ -210,7 +210,7 @@ survive untouched.
|
|
|
210
210
|
|
|
211
211
|
`swordHeader` swaps the header at `session_start`, which runs after pi has already drawn its built-in pixel logo, so the logo shows for a moment before the sword replaces it. To skip that flash set pi's own `"quietStartup": true` in `~/.pi/agent/settings.json`: pi then draws an empty header slot at startup and the sword fills it. Quiet startup also drops pi's key-hint lines, which the sword header does not reproduce.
|
|
212
212
|
|
|
213
|
-
`fastMode` only affects `claude-fable-5-2`, `claude-mythos-5-2`, `claude-opus-5-5`, `claude-opus-5`, and `claude-opus-4-8` requests on Anthropic's `anthropic-messages` API - the models in Anthropic's [fast-mode availability table](https://platform.claude.com/docs/en/build-with-claude/fast-mode#feature-availability); enabling it opts into premium fast-mode pricing. `--fast` forces it on for one launch; `/fast on|off` toggles live.
|
|
213
|
+
`fastMode` only affects `claude-fable-5-2`, `claude-mythos-5-2`, `claude-opus-5-5`, `claude-opus-5`, and `claude-opus-4-8` requests on Anthropic's `anthropic-messages` API - the models in Anthropic's [fast-mode availability table](https://platform.claude.com/docs/en/build-with-claude/fast-mode#feature-availability); enabling it opts into premium fast-mode pricing. `--fast` forces it on for one launch; `/fast on|off` toggles live. The provider must be pi's built-in `anthropic` or a custom provider whose `baseUrl` host is `api.anthropic.com`; proxy providers (opencode, cloudflare-ai-gateway) are excluded. Fable 5.2, Mythos 5.2, and Opus 5.5 get `speed: "fast"` alone, and pi's `anthropic-beta` header goes out as pi built it. Opus 5 (research preview) and Opus 4.8 (deprecated by Anthropic, removal date 2026-11-30) also get the `fast-mode-2026-02-01` beta header. That header injection needs the `before_provider_headers` hook (pi bundling `@earendil-works/pi-coding-agent` >= 0.80.5); on older pi the beta header is silently not sent. The `anthropic-beta` header is discovered at request time by probing pi's own request assembly (no network), so conditional betas pi adds - e.g. `server-side-fallback-2026-07-01` for models with server-side fallback - are preserved alongside `fast-mode-2026-02-01`. If the probe fails, the header falls back to the static OAuth-identity + fast-mode list. See [doc/fetch.md](doc/fetch.md) and [doc/doc-to-md.md](doc/doc-to-md.md) for the ingestion tools' full reference; session-name/sword-header behavior above is complete.
|
|
214
214
|
|
|
215
215
|
`pi-ai` prices every fast request at standard rates - it has no `usage.speed` support and no request-level pricing modifier - so `fastMode` corrects the reported cost itself: a `message_end` handler scales all four `usage.cost` components by `FAST_MODE_COST_MULTIPLIER` (2x) and returns the corrected message. Persisted session JSONL and pi's own native cost display are always exact, since they're written from this corrected message. pi-cohort's live `Σ$` reflects the correction only when pi-quiver's `message_end` handler runs before pi-cohort's - best-effort, depending on extension load order - and is reconciled on pi-cohort's next `session_start` regardless. The upstream fix (teaching `pi-ai`'s `Usage`/`calculateCost` about `usage.speed`) is the better long-term path and is tracked separately.
|
|
216
216
|
|
package/extensions/fast-mode.ts
CHANGED
|
@@ -95,7 +95,15 @@ export function coerce(raw: unknown): Partial<Config> | undefined {
|
|
|
95
95
|
return undefined;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
type ModelLike = { id?: string; api?: string; provider?: string } | undefined;
|
|
98
|
+
type ModelLike = { id?: string; api?: string; provider?: string; baseUrl?: string } | undefined;
|
|
99
|
+
|
|
100
|
+
// Proxies and cloud platforms reuse Anthropic's model ids on anthropic-messages
|
|
101
|
+
// and must never see fast-mode signals, so the endpoint has to be Anthropic's
|
|
102
|
+
// own: pi's built-in provider, or a custom provider entry aimed at the same host.
|
|
103
|
+
function isAnthropicEndpoint(model: NonNullable<ModelLike>): boolean {
|
|
104
|
+
if (model.provider === "anthropic") return true;
|
|
105
|
+
return URL.parse(model.baseUrl ?? "")?.hostname === "api.anthropic.com";
|
|
106
|
+
}
|
|
99
107
|
|
|
100
108
|
function fastModeModel(model: ModelLike) {
|
|
101
109
|
const id = model?.id;
|
|
@@ -105,7 +113,7 @@ function fastModeModel(model: ModelLike) {
|
|
|
105
113
|
|
|
106
114
|
export function shouldInject(enabled: boolean, model: ModelLike): boolean {
|
|
107
115
|
if (!enabled || !model) return false;
|
|
108
|
-
if (model
|
|
116
|
+
if (!isAnthropicEndpoint(model)) return false;
|
|
109
117
|
if (model.api !== "anthropic-messages") return false;
|
|
110
118
|
return fastModeModel(model) !== undefined;
|
|
111
119
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-quiver",
|
|
3
|
-
"version": "6.16.
|
|
3
|
+
"version": "6.16.3",
|
|
4
4
|
"description": "Personal pack of Pi coding-agent extensions: context-safe fetch, doc_to_md PDF/DOCX/PPTX-to-Markdown conversion, session naming, a themed ASCII startup header, Anthropic fast mode, and a provider-stall watchdog.",
|
|
5
5
|
"author": "Jacek Juraszek",
|
|
6
6
|
"license": "MIT",
|