发布日期: 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.authStoragemodelRegistry 选项。AuthStorage 及其存储后端不再导出;请使用 ModelRuntime(或自定义 pi-ai CredentialStore),或使用 readStoredCredential() 一次性读取 auth.json。
  • 移除了冗余的 ModelRuntime.getAll()find()getSnapshot()getAuthOptions() 投影方法。请直接使用 pi-ai ModelsgetModels()getModel()getProviders()checkAuth() 方法。
  • ModelRuntime.getAuth() 替换了通过 ModelRegistry.getApiKeyAndHeaders() 进行的 SDK 请求认证组装。传递提供商 ID 返回提供商范围内的认证信息;传递模型还会解析内置、models.json 和扩展模型头。
  • 将面向扩展的 ModelRegistry.refresh() 从同步 void 更改为 Promise<void>,因为 models.json 加载是异步的。扩展在进行同步注册表读取之前必须等待其完成。
  • 将规范的动态目录刷新移至异步 ModelRuntime.refresh()/pi-ai Models.refresh()。传统的扩展 OAuth modifyModels 在凭证初始化后仍作为同步兼容性投影提供支持。

新增内容

  • 添加了 ModelRuntime 作为规范的异步 SDK 和内部模型/身份验证门面,同时保留了面向扩展的同步 ModelRegistry API。ModelRuntime.create() 通过其 credentials 选项接受任何 pi-ai CredentialStore
  • 添加了从注册的 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 authenticationModelRuntime centralizes model configuration, provider-owned /login, and dynamic provider catalogs. See Providers.
  • Live model catalog refresh/model refreshes configured providers in the background, and pi update --models forces 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.authStorage and modelRegistry options with the async modelRuntime option. AuthStorage and its storage backends are no longer exported; use ModelRuntime (or a custom pi-ai CredentialStore), or readStoredCredential() for one-off reads of auth.json.
  • Removed redundant ModelRuntime.getAll(), find(), getSnapshot(), and getAuthOptions() projections. Use the pi-ai Models methods getModels(), getModel(), getProviders(), and checkAuth() directly.
  • Replaced SDK request-auth assembly through ModelRegistry.getApiKeyAndHeaders() with ModelRuntime.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 synchronous void to Promise<void> because models.json loading is asynchronous. Extensions must await it before making synchronous registry reads.
  • Moved canonical dynamic catalog refresh to async ModelRuntime.refresh()/pi-ai Models.refresh(). Legacy extension OAuth modifyModels remains supported as a synchronous compatibility projection after credential initialization.

Added

  • Added ModelRuntime as the canonical async SDK and internal model/auth facade while preserving the synchronous extension-facing ModelRegistry API. ModelRuntime.create() accepts any pi-ai CredentialStore through its credentials option.
  • Added provider-owned /login discovery 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 --models to 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 ModelRuntime to compose built-in providers, immutable models.json configuration, and extension overlays through ad-hoc pi-ai provider methods.
  • Changed ModelRuntime to own final request assembly: getAuth(model) includes configured model headers, stream methods resolve auth once, and before_provider_headers runs as the Models-only header transform before provider dispatch.
  • Changed /model to 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.

下载链接