pi v0.80.8 版本更新介绍
发布日期: 2026-07-16
版本号: v0.80.8
此次更新统一了模型运行时和提供商认证,通过
ModelRuntime集中管理模型配置、提供商登录及动态目录;支持/model命令后台刷新模型目录并新增pi update --models命令强制刷新;同时添加了 xAI 设备代码 OAuth 登录和 Grok 4.5 思考级别支持。重大变更包括用异步modelRuntime选项替代原有认证存储选项、移除冗余的模型运行时查询方法、替换认证组装方式、将扩展接口ModelRegistry.refresh()改为异步等。此外,新增了提供商/login发现、文件动态目录、扩展模型刷新支持等功能,并调整了运行时对内置提供商、配置文件与扩展的组合方式,以及/model的显示逻辑。修复内容涵盖模型目录刷新机制、思考块渲染、Codex 会话 ID 长度限制、终端输出格式、Windows 终端标题显示及 Bun 二进制文件的 OAuth 适配器打包等问题。
更新内容 (中文)
新功能
- 统一的模型运行时和提供商身份验证 ——
ModelRuntime集中了模型配置、提供商拥有的/login以及动态提供商目录。参阅 提供商。 - 实时模型目录刷新 ——
/model在后台刷新已配置的提供商,pi update --models可强制立即刷新。参阅 安装与管理。 - xAI 设备代码 OAuth 与 Grok 4.5 响应支持 —— 使用设备代码登录 xAI,并以低、中或高思考级别使用 Grok 4.5。参阅 xAI。
破坏性变更
- 用异步
modelRuntime选项替换了 SDK 的CreateAgentSessionOptions.authStorage和modelRegistry选项。AuthStorage及其存储后端不再导出;请使用ModelRuntime(或自定义 pi-aiCredentialStore),或使用readStoredCredential()一次性读取 auth.json。 - 移除了冗余的
ModelRuntime.getAll()、find()、getSnapshot()和getAuthOptions()投影方法。请直接使用 pi-aiModels的getModels()、getModel()、getProviders()和checkAuth()方法。 - 用
ModelRuntime.getAuth()替换了通过ModelRegistry.getApiKeyAndHeaders()进行的 SDK 请求认证组装。传递提供商 ID 返回提供商范围内的认证信息;传递模型还会解析内置、models.json和扩展模型头。 - 将面向扩展的
ModelRegistry.refresh()从同步void更改为Promise<void>,因为models.json加载是异步的。扩展在进行同步注册表读取之前必须等待其完成。 - 将规范的动态目录刷新移至异步
ModelRuntime.refresh()/pi-aiModels.refresh()。传统的扩展 OAuthmodifyModels在凭证初始化后仍作为同步兼容性投影提供支持。
新增内容
- 添加了
ModelRuntime作为规范的异步 SDK 和内部模型/身份验证门面,同时保留了面向扩展的同步ModelRegistryAPI。ModelRuntime.create()通过其credentials选项接受任何 pi-aiCredentialStore。 - 添加了从注册的 pi-ai 提供商直接发现提供商拥有的
/login功能,包括环境身份验证状态和信息链接。 - 添加了在
models-store.json中基于文件的动态目录、每个提供商的 pi.dev 目录覆盖以及 Radius 网关支持,包括从传统凭证缓存目录离线迁移。 - 添加了扩展提供商
refreshModels(context)支持,用于动态模型发现,可选地由提供商控制持久化。 - 添加了
pi update --models,可强制立即刷新模型目录,而无需更新 pi 或扩展。 - 添加了继承的 xAI 设备代码 OAuth 登录和 Grok 4.5 OpenAI Responses 支持,具有低、中和高思考级别(#6651 由 @Jaaneek 贡献)。
变更
- 更改了
ModelRuntime以通过临时的 pi-ai 提供商方法组合内置提供商、不可变的models.json配置和扩展覆盖。 - 更改了
ModelRuntime以拥有最终的请求组装:getAuth(model)包括已配置的模型头,流方法一次解析身份验证,before_provider_headers作为仅限模型的头转换在提供商分发前运行。 - 更改了
/model以立即渲染当前模型快照,在后台刷新已配置的提供商,并在超时时使用部分结果或错误更新打开的选择器。
修复
- 修复了已配置提供商的目录刷新,以解析 pi.dev 的按模型 ID 键控的响应,将检查节流至每四小时一次,发送带版本的 pi 用户代理,将未实现的路由视为不可用覆盖,并在
/model中显示简洁的刷新状态。 - 修复了相邻的助手思考块渲染为单个思考部分的问题。
- 修复了继承的 OpenAI Codex 会话 ID 超过 64 个字符以符合 API 限制的问题(#6630)。
- 修复了继承的终端输出以一致地规范化制表符的问题(#6697 由 @xz-dev 贡献)。
- 修复了检查 npm 包后的 Windows 终端标题问题(#6629)。
- 修复了 Bun 独立二进制文件以捆绑用于交互式登录的 OAuth 适配器的问题。
更新内容 (原始)
New Features
- Unified model runtime and provider authentication —
ModelRuntimecentralizes model configuration, provider-owned/login, and dynamic provider catalogs. See Providers. - Live model catalog refresh —
/modelrefreshes configured providers in the background, andpi update --modelsforces an immediate refresh. See Install and Manage. - xAI device-code OAuth and Grok 4.5 Responses support — Sign in to xAI with a device code and use Grok 4.5 with low, medium, or high thinking. See xAI.
Breaking Changes
- Replaced the SDK’s
CreateAgentSessionOptions.authStorageandmodelRegistryoptions with the asyncmodelRuntimeoption.AuthStorageand its storage backends are no longer exported; useModelRuntime(or a custom pi-aiCredentialStore), orreadStoredCredential()for one-off reads of auth.json. - Removed redundant
ModelRuntime.getAll(),find(),getSnapshot(), andgetAuthOptions()projections. Use the pi-aiModelsmethodsgetModels(),getModel(),getProviders(), andcheckAuth()directly. - Replaced SDK request-auth assembly through
ModelRegistry.getApiKeyAndHeaders()withModelRuntime.getAuth(). Passing a provider ID returns provider-scoped auth; passing a model also resolves built-in,models.json, and extension model headers. - Changed extension-facing
ModelRegistry.refresh()from synchronousvoidtoPromise<void>becausemodels.jsonloading is asynchronous. Extensions must await it before making synchronous registry reads. - Moved canonical dynamic catalog refresh to async
ModelRuntime.refresh()/pi-aiModels.refresh(). Legacy extension OAuthmodifyModelsremains supported as a synchronous compatibility projection after credential initialization.
Added
- Added
ModelRuntimeas the canonical async SDK and internal model/auth facade while preserving the synchronous extension-facingModelRegistryAPI.ModelRuntime.create()accepts any pi-aiCredentialStorethrough itscredentialsoption. - Added provider-owned
/logindiscovery directly from registered pi-ai providers, including ambient auth status and informational links. - Added file-backed dynamic catalogs in
models-store.json, per-provider pi.dev catalog overlays, and Radius gateway support including offline migration from legacy credential-cached catalogs. - Added extension provider
refreshModels(context)support for dynamic model discovery with optional provider-controlled persistence. - Added
pi update --modelsto force an immediate model catalog refresh without updating pi or extensions. - Added inherited xAI device-code OAuth login and Grok 4.5 OpenAI Responses support, with low, medium, and high thinking levels (#6651 by @Jaaneek).
Changed
- Changed
ModelRuntimeto compose built-in providers, immutablemodels.jsonconfiguration, and extension overlays through ad-hoc pi-ai provider methods. - Changed
ModelRuntimeto own final request assembly:getAuth(model)includes configured model headers, stream methods resolve auth once, andbefore_provider_headersruns as the Models-only header transform before provider dispatch. - Changed
/modelto render the current model snapshot immediately, refresh configured providers in the background, and update the open selector with partial results or timeout errors.
Fixed
- Fixed configured-provider catalog refresh to parse pi.dev’s model-ID keyed responses, throttle checks to once per four hours, send the versioned pi user agent, treat unimplemented routes as unavailable overlays, and show concise refresh status in
/model. - Fixed adjacent assistant thinking blocks to render as one thinking section.
- Fixed inherited OpenAI Codex session IDs longer than 64 characters to meet the API limit (#6630).
- Fixed inherited terminal output to normalize tab characters consistently (#6697 by @xz-dev).
- Fixed the Windows terminal title after checking npm packages (#6629).
- Fixed Bun standalone binaries to bundle OAuth adapters for interactive logins.