chore(deps): upgrade pi-ai to 1.2.0

This commit is contained in:
Tianyi Cui committed 2026-10-17 22:44:26 +08:00
1 parent d849cfdd15
commit 8fd91f311e
11 files changed
+97 -27

No files matched your search

+1 -1
View File
@@ -145,7 +145,7 @@ External packages installed for runtime use or distributed inside the prebuilt b
pnpm applies local patches to the following packages at install time, so shipped artifacts carry modified copies; each patch file is the complete record of the modification:
- `@earendil-works/pi-ai@1.1.0` — [`patches/@earendil-works__pi-ai@1.1.0.patch`](patches/@earendil-works__pi-ai@1.1.0.patch)
- `@earendil-works/pi-ai@1.2.0` — [`patches/@earendil-works__pi-ai@1.2.0.patch`](patches/@earendil-works__pi-ai@1.2.0.patch)
- `@electron/[email protected]` — [`patches/@[email protected]`](patches/@[email protected])
- `@fortune-sheet/[email protected]` — [`patches/@[email protected]`](patches/@[email protected])
- `@fortune-sheet/[email protected]` — [`patches/@[email protected]`](patches/@[email protected])
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.1-alpha.4/pi-ai-model-catalog/guide.md
/:
en: 3d2fec5fa8405395
zh: b8617482168609b1
/pi-ai-model-catalog:
en: ad7d66838bb7f924
zh: d4b120332acf786f
/pi-ai-model-catalog/change:
en: 0948c8c82d4f8256
zh: 763504917909d130
/pi-ai-model-catalog/migration:
en: 6db9f70e6db44b3c
zh: 34156f7446a78bc1
@@ -0,0 +1,27 @@
---
kind: upgrade-guide
description: "The pi-ai 1.2.0 catalog removes model IDs and lowers the default context limit for Anthropic Sonnet 4.5."
---
# pi-ai model catalog
English | [中文](guide.zh.md)
## Change
The pi-ai dependency changes from 1.1.0 to 1.2.0. Routes that use its catalog lose the following model IDs. Stored `modelOverrides` for these IDs report a missing-catalog diagnostic; new overrides are rejected. An explicit `models` entry can still declare an ID, but it loses its catalog defaults.
| Provider | Removed model IDs |
|---|---|
| `google-vertex` | `gemini-flash-latest`, `gemini-flash-lite-latest` |
| `opencode` | `fledge-alpha-free` |
| `openrouter` | `inclusionai/ling-3.0-flash-sante:free`, `qwen/qwen-plus-2025-07-28`, `qwen/qwen3-235b-a22b`, `qwen/qwen3-30b-a3b-thinking-2507`, `qwen/qwen3-8b`, `qwen/qwen3-coder-plus`, `qwen/qwen3-max`, `qwen/qwen3-max-thinking`, `qwen/qwen3-vl-235b-a22b-thinking`, `qwen/qwen3-vl-32b-instruct`, `qwen/qwen3-vl-8b-thinking`, `qwen/qwen3.6-max-preview`, `sao10k/l3.1-euryale-70b` |
| `vercel-ai-gateway` | `alibaba/qwen-3.6-max-preview`, `alibaba/qwen3-235b-a22b-thinking`, `alibaba/qwen3-coder-plus`, `alibaba/qwen3-max`, `alibaba/qwen3-max-preview`, `alibaba/qwen3-vl-235b-a22b-instruct`, `alibaba/qwen3-vl-thinking`, `anthropic/claude-3-haiku`, `anthropic/claude-opus-4` |
For the `anthropic` provider, `claude-sonnet-4-5` and `claude-sonnet-4-5-20250929` have a default `contextWindow` of 200,000 tokens, down from 1,000,000. Explicit configuration overrides still take precedence. The `vercel-ai-gateway` model `alibaba/qwen-3-235b` is now declared non-reasoning.
## Migration
1. In Settings → Models, select a model from the updated provider catalog. Check that its endpoint, capabilities, and price fit your use; removed IDs have no automatic replacement.
2. Update model selections in your profile's `cordis.patch.yml`, preset patches, and affected Sessions. Remove obsolete `providers.<provider>.modelOverrides.<id>` entries. Replace removed IDs in explicit `providers.<provider>.models` lists with supported models and review their declared capacities and capabilities. See the [pi-ai configuration reference](../../../../packages/llm/llm-pi-ai/README.md).
3. Review explicit Sonnet 4.5 context overrides against the endpoint's supported limit. Start the affected profile, confirm its model has no configuration diagnostic, and send a short prompt to verify the selected route.
@@ -0,0 +1,27 @@
---
kind: upgrade-guide
description: "pi-ai 1.2.0 目录移除了部分模型 ID,并降低了 Anthropic Sonnet 4.5 的默认上下文限制。"
---
# pi-ai 模型目录
[English](guide.md) | 中文
## 变更
pi-ai 依赖从 1.1.0 升级到 1.2.0。使用其目录的路由不再包含以下模型 ID。已保存的 `modelOverrides` 若引用这些 ID,会报告目录条目缺失的诊断;新的覆盖配置会被拒绝。显式 `models` 条目仍可声明这些 ID,但会失去目录默认值。
| 提供商 | 已移除的模型 ID |
|---|---|
| `google-vertex` | `gemini-flash-latest`, `gemini-flash-lite-latest` |
| `opencode` | `fledge-alpha-free` |
| `openrouter` | `inclusionai/ling-3.0-flash-sante:free`, `qwen/qwen-plus-2025-07-28`, `qwen/qwen3-235b-a22b`, `qwen/qwen3-30b-a3b-thinking-2507`, `qwen/qwen3-8b`, `qwen/qwen3-coder-plus`, `qwen/qwen3-max`, `qwen/qwen3-max-thinking`, `qwen/qwen3-vl-235b-a22b-thinking`, `qwen/qwen3-vl-32b-instruct`, `qwen/qwen3-vl-8b-thinking`, `qwen/qwen3.6-max-preview`, `sao10k/l3.1-euryale-70b` |
| `vercel-ai-gateway` | `alibaba/qwen-3.6-max-preview`, `alibaba/qwen3-235b-a22b-thinking`, `alibaba/qwen3-coder-plus`, `alibaba/qwen3-max`, `alibaba/qwen3-max-preview`, `alibaba/qwen3-vl-235b-a22b-instruct`, `alibaba/qwen3-vl-thinking`, `anthropic/claude-3-haiku`, `anthropic/claude-opus-4` |
在 `anthropic` 提供商中,`claude-sonnet-4-5` 和 `claude-sonnet-4-5-20250929` 的默认 `contextWindow` 从 1,000,000 token 降为 200,000 token。显式配置的覆盖值仍然优先。`vercel-ai-gateway` 的 `alibaba/qwen-3-235b` 模型现在被声明为非推理模型。
## 迁移
1. 在“设置 → 模型”中,从更新后的提供商目录选择模型。确认其端点、能力和价格符合用途;已移除的 ID 没有自动替代项。
2. 更新 profile 的 `cordis.patch.yml`、preset patch 和受影响 Session 中的模型选择。移除过时的 `providers.<provider>.modelOverrides.<id>` 条目。将显式 `providers.<provider>.models` 列表中已移除的 ID 替换为受支持的模型,并检查其声明的容量和能力。参见 [pi-ai 配置参考](../../../../packages/llm/llm-pi-ai/README.zh.md)。
3. 根据端点支持的限制检查显式 Sonnet 4.5 上下文覆盖值。启动受影响的 profile,确认模型没有配置诊断,再发送一个简短提示,验证所选路由。
+2 -2
View File
@@ -90,8 +90,8 @@
en: b6bd570c0159ba08
zh: 7d2d91eea6a8d830
/deepseek-ai-dsh-llm-pi-ai/known-limitations-and-deferred-work:
en: ee870ac2ac87decc
zh: 9e66c5e7400c4bc6
en: 21b4435e0a9f3564
zh: 7bc2dba9294b0da3
/deepseek-ai-dsh-llm-pi-ai/known-limitations-and-deferred-work/dev-note:
en: 3678dd0f6642c2a5
zh: 75cbdd064cc64282
+1 -1
View File
@@ -257,7 +257,7 @@ These limits define where the adapter stops and future work begins. They are cur
- **Images are accepted only in user and tool-result messages** — images in system, developer, or assistant history fail with `UNSUPPORTED_CONTENT` on both conversion paths.
- **Provider HTTP status is unavailable** — pi-ai error events do not expose a stable HTTP status across providers.
- **Retry policy is provider-owned, not an SDK retry** — pi-ai SDK retries stay disabled so durable agent steps and `llm/retry` events own every visible attempt, and direct `ctx.llm.stream()` calls remain single-attempt.
- **Streamed JSON tool-call arguments avoid per-delta reparsing** — the installed pi-ai carries [`patches/@earendil-works__pi-ai@1.1.0.patch`](../../../patches/@earendil-works__pi-ai@1.1.0.patch), which removes the per-delta re-parse of the whole accumulated argument JSON in every stream adapter (upstream [earendil-works/pi#9265](https://github.com/earendil-works/pi/issues/9265)); unpatched, a multi-megabyte argument stream costs O(n²) CPU on the event loop and stalls every session in the process. Completion events supply parsed arguments; Responses may parse at both argument completion and output-item completion. This adapter reads only delta strings and finalized arguments. Re-apply or retire the patch on every pi-ai upgrade.
- **Streamed JSON tool-call arguments avoid per-delta reparsing** — the installed pi-ai carries [`patches/@earendil-works__pi-ai@1.2.0.patch`](../../../patches/@earendil-works__pi-ai@1.2.0.patch), which removes the per-delta re-parse of the whole accumulated argument JSON in every stream adapter (upstream [earendil-works/pi#9265](https://github.com/earendil-works/pi/issues/9265)); unpatched, a multi-megabyte argument stream costs O(n²) CPU on the event loop and stalls every session in the process. Completion events supply parsed arguments; Responses may parse at both argument completion and output-item completion. This adapter reads only delta strings and finalized arguments. Re-apply or retire the patch on every pi-ai upgrade.
<a id="dev-note"></a>
### Dev Note
+1 -1
View File
@@ -257,7 +257,7 @@ pi-ai 事件变成 harness 的推理、文本、工具调用、用量与 finish
- **图片只在 user 与工具结果消息中被接受**——system、developer 或 assistant 历史中的图片在两条转换路径上都会以 `UNSUPPORTED_CONTENT` 失败。
- **提供方 HTTP 状态不可用**——pi-ai 错误事件不跨提供方暴露稳定 HTTP 状态。
- **重试策略由提供方自有,而非 SDK 重试**——pi-ai SDK 重试保持禁用,因此持久 agent(智能体)步骤与 `llm/retry` 事件拥有每个可见尝试,直接 `ctx.llm.stream()` 调用仍是单次尝试。
- **流式 JSON 工具调用参数避免逐 delta 重复解析**——安装的 pi-ai 带有 [`patches/@earendil-works__pi-ai@1.1.0.patch`](../../../patches/@earendil-works__pi-ai@1.1.0.patch),它移除了每个流适配器中对整段累计参数 JSON 的逐 delta 重新解析(上游 [earendil-works/pi#9265](https://github.com/earendil-works/pi/issues/9265));未打补丁时,数 MB 的参数流会在事件循环上消耗 O(n²) CPU,并使进程内所有会话停滞。完成事件提供解析后的参数;Responses 可能在参数完成和输出项完成时分别解析。本适配器只读取 delta 字符串与最终参数。每次升级 pi-ai 时都要重新应用或撤销该补丁。
- **流式 JSON 工具调用参数避免逐 delta 重复解析**——安装的 pi-ai 带有 [`patches/@earendil-works__pi-ai@1.2.0.patch`](../../../patches/@earendil-works__pi-ai@1.2.0.patch),它移除了每个流适配器中对整段累计参数 JSON 的逐 delta 重新解析(上游 [earendil-works/pi#9265](https://github.com/earendil-works/pi/issues/9265));未打补丁时,数 MB 的参数流会在事件循环上消耗 O(n²) CPU,并使进程内所有会话停滞。完成事件提供解析后的参数;Responses 可能在参数完成和输出项完成时分别解析。本适配器只读取 delta 字符串与最终参数。每次升级 pi-ai 时都要重新应用或撤销该补丁。
<a id="dev-note"></a>
### 开发备注
+1 -1
View File
@@ -43,7 +43,7 @@
"@deepseek-ai/dsh-brand": "workspace:*",
"@deepseek-ai/dsh-util-values": "workspace:*",
"@deepseek-ai/schemastery": "workspace:~",
"@earendil-works/pi-ai": "^1.1.0"
"@earendil-works/pi-ai": "^1.2.0"
},
"devDependencies": {
"@deepseek-ai/cordis": "workspace:~",
@@ -1,8 +1,8 @@
diff --git a/dist/api/anthropic-messages.js b/dist/api/anthropic-messages.js
index 38571b31e143e913c2bf59dad73382982e93664a..950e546197d8e84cb3edfca0012939f1db2488d8 100644
index d0a5b0f1bcd77e4afff2c92b068a6e3150dcdd86..999a32b27b53838851eb0578fafadea5cb1343f6 100644
--- a/dist/api/anthropic-messages.js
+++ b/dist/api/anthropic-messages.js
@@ -553,7 +553,6 @@ export const stream = (model, context, options) => {
@@ -585,7 +585,6 @@
const block = blocks[index];
if (block && block.type === "toolCall") {
block.partialJson += event.delta.partial_json;
@@ -14,7 +14,7 @@ diff --git a/dist/api/bedrock-converse-stream.js b/dist/api/bedrock-converse-str
index ca40f1b4a4e99f441503cf364822073a7a6c478a..14c204261b3f6c47f8950cf44f0fb9f86cf2cda7 100644
--- a/dist/api/bedrock-converse-stream.js
+++ b/dist/api/bedrock-converse-stream.js
@@ -461,7 +461,6 @@ function handleContentBlockDelta(event, blocks, output, stream) {
@@ -461,7 +461,6 @@
}
else if (delta?.toolUse && block?.type === "toolCall") {
block.partialJson = (block.partialJson || "") + (delta.toolUse.input || "");
@@ -23,10 +23,10 @@ index ca40f1b4a4e99f441503cf364822073a7a6c478a..14c204261b3f6c47f8950cf44f0fb9f8
}
else if (delta?.reasoningContent) {
diff --git a/dist/api/mistral-conversations.js b/dist/api/mistral-conversations.js
index 2fc3ad343af090a919f5b71454b29f23b009fc21..64aa8a4ab2461484f22066913455518f69157857 100644
index eb52675006e4f048aeefde05acceb474e918473e..0cfa1ebc2b277d38fa9515262ca4445c7e22a23e 100644
--- a/dist/api/mistral-conversations.js
+++ b/dist/api/mistral-conversations.js
@@ -554,7 +554,6 @@ async function consumeChatStream(model, output, stream, mistralStream, onProvide
@@ -570,7 +570,6 @@
? toolCall.function.arguments
: JSON.stringify(toolCall.function.arguments || {});
block.partialArgs = (block.partialArgs || "") + argsDelta;
@@ -38,7 +38,7 @@ diff --git a/dist/api/openai-completions.js b/dist/api/openai-completions.js
index a60f39352b776d71497e55b33b3334bacfbeb2f5..6c9b98e35606c52e4f0fb29d8fd0b5ba02d92e09 100644
--- a/dist/api/openai-completions.js
+++ b/dist/api/openai-completions.js
@@ -438,7 +438,6 @@ export const stream = (model, context, options) => {
@@ -438,7 +438,6 @@
if (toolCall.function?.arguments) {
delta = toolCall.function.arguments;
block.partialArgs = (block.partialArgs ?? "") + toolCall.function.arguments;
@@ -50,7 +50,7 @@ diff --git a/dist/api/openai-responses-shared.js b/dist/api/openai-responses-sha
index f413fe5f2a1abcac39c38bbd4a77b38c349a5918..108f599ae1d985d2f465e8cdf99ce0624acea6aa 100644
--- a/dist/api/openai-responses-shared.js
+++ b/dist/api/openai-responses-shared.js
@@ -548,7 +548,6 @@ export async function processResponsesStream(openaiStream, output, stream, model
@@ -548,7 +548,6 @@
if (!slot || slot.block.partialJson === undefined)
continue;
slot.block.partialJson += event.delta;
@@ -62,7 +62,7 @@ diff --git a/dist/api/pi-messages.js b/dist/api/pi-messages.js
index 7da1c45de8a106a68411cf79bec75f553534a1c7..296d131b59b1cf75f2516c39e85bba72972b2c17 100644
--- a/dist/api/pi-messages.js
+++ b/dist/api/pi-messages.js
@@ -155,8 +155,6 @@ function createEventConverter(model) {
@@ -155,8 +155,6 @@
case "toolcall_delta": {
const json = `${toolJson.get(event.contentIndex) ?? ""}${event.delta}`;
toolJson.set(event.contentIndex, json);
+10 -10
View File
@@ -10,7 +10,7 @@ overrides:
'@deepseek-ai/schemastery': link:vendor/schemastery
patchedDependencies:
'@earendil-works/pi-ai@1.1.0': 66eaf960054f10441b93ac3857114e96c1901f6d183713e2f21437b007111644
'@earendil-works/pi-ai@1.2.0': 4202cd05e0250bf7bc1b010b9aa8a50eb4bb7d0c5364195397842d26972b4b6f
'@electron/[email protected]': 280e7b2816caf01423097d24e79107a66afeb563a348630ce9928ae8499a5861
'@fortune-sheet/[email protected]': 8791a230763dbf853fd65d627c68c31de37209992851377855e16cf08ea70532
'@fortune-sheet/[email protected]': 2932e52e79afcd4ced08cfa123b5eded786c85043da32f622f3e80af6fc96c37
@@ -11167,8 +11167,8 @@ importers:
specifier: link:../../../vendor/schemastery
version: link:../../../vendor/schemastery
'@earendil-works/pi-ai':
specifier: ^1.1.0
version: 1.1.0(patch_hash=66eaf960054f10441b93ac3857114e96c1901f6d183713e2f21437b007111644)(@aws-sdk/[email protected])(@modelcontextprotocol/[email protected]([email protected])([email protected]))(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])
specifier: ^1.2.0
version: 1.2.0(patch_hash=4202cd05e0250bf7bc1b010b9aa8a50eb4bb7d0c5364195397842d26972b4b6f)(@aws-sdk/[email protected])(@modelcontextprotocol/[email protected]([email protected])([email protected]))(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])
devDependencies:
'@deepseek-ai/cordis':
specifier: workspace:~
@@ -16591,13 +16591,13 @@ packages:
search-insights:
optional: true
'@earendil-works/pi-ai@1.1.0':
resolution: {integrity: sha512-1T7LAkc/5Bvc0v6w4vAGVdCrli0o/E0pEmYKTnixu95vSFArBjvbhS/G4ZwI0RUePgf0Imcu0VyqlM4EcXxqfw==}
'@earendil-works/pi-ai@1.2.0':
resolution: {integrity: sha512-U5/1zXqfV1on7/9sbez03tT4Ru49Lvfb4+zXSDK3DBKF5cRk6KxvAOTOY3HJ4jimlZth+rs7vbJqN6iBQAoNuQ==}
engines: {node: '>=22.19.0'}
hasBin: true
'@earendil-works/pi-telemetry@1.1.0':
resolution: {integrity: sha512-8gAK05/2pPozZZz6hCLOi8x2vsqzvsmO9gG92kbvuvTPm0qMHaFlaXX98ndXsrOi5pmzha7vNLguuG4+0Rgxjw==}
'@earendil-works/pi-telemetry@1.2.0':
resolution: {integrity: sha512-NZ3aJE6dr7aTgzzXDe53OW7BsAsF8ZUKHPJTtnjaQcxtlagkUT0Ew8Qas0EvYQsZqR/KpF1lB+z209XBzIC7xg==}
engines: {node: '>=22.19.0'}
'@electron-internal/[email protected]':
@@ -24342,11 +24342,11 @@ snapshots:
transitivePeerDependencies:
- '@algolia/client-search'
'@earendil-works/pi-ai@1.1.0(patch_hash=66eaf960054f10441b93ac3857114e96c1901f6d183713e2f21437b007111644)(@aws-sdk/[email protected])(@modelcontextprotocol/[email protected]([email protected])([email protected]))(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])':
'@earendil-works/pi-ai@1.2.0(patch_hash=4202cd05e0250bf7bc1b010b9aa8a50eb4bb7d0c5364195397842d26972b4b6f)(@aws-sdk/[email protected])(@modelcontextprotocol/[email protected]([email protected])([email protected]))(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])':
dependencies:
'@anthropic-ai/sdk': 0.129.0([email protected])
'@aws-sdk/client-bedrock-runtime': 3.1127.0
'@earendil-works/pi-telemetry': 1.1.0
'@earendil-works/pi-telemetry': 1.2.0
'@google/genai': 2.21.0(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected])
'@smithy/node-http-handler': 4.12.1
http-proxy-agent: 9.1.0([email protected])
@@ -24367,7 +24367,7 @@ snapshots:
- ws
- zod
'@earendil-works/pi-telemetry@1.1.0': {}
'@earendil-works/pi-telemetry@1.2.0': {}
'@electron-internal/[email protected]': {}
+3 -3
View File
@@ -64,8 +64,8 @@ minimumReleaseAgeExclude:
- '@deepseek-ai/[email protected]'
# Fresh pi-ai releases carry the model catalog updates that are the whole
# point of bumping it; waiting out the release age would defeat that.
- '@earendil-works/pi-ai@1.1.0'
- '@earendil-works/pi-telemetry@1.1.0'
- '@earendil-works/pi-ai@1.2.0'
- '@earendil-works/pi-telemetry@1.2.0'
# This addon release recognizes the Electron 44.7.0 Node/V8 fingerprint used by Desktop.
- [email protected]
- [email protected]
@@ -106,7 +106,7 @@ minimumReleaseAgeExclude:
# Desktop packaging requires this Electron fingerprint with node-addon-require-builtin 0.1.9.
- [email protected]
patchedDependencies:
'@earendil-works/pi-ai@1.1.0': patches/@earendil-works__pi-ai@1.1.0.patch
'@earendil-works/pi-ai@1.2.0': patches/@earendil-works__pi-ai@1.2.0.patch
'@electron/[email protected]': patches/@[email protected]
'@fortune-sheet/[email protected]': patches/@[email protected]
'@fortune-sheet/[email protected]': patches/@[email protected]