外部精选
Pi 0.99.2
本文来自外部来源,不是黄奕彬的原创文章。本站提供原文入口,并在采集端生成 AI 结构化摘要、解读与中文翻译(如有),一切以原文为准。
阅读原文(pi.dev)结构化摘要 AI 生成
背景与问题
本文是 Pi 在 2026-09-30 发布的 0.99.2 版本官方更新日志,面向使用 Pi 的开发者,尤其是集成 MCP(Model Context Protocol)服务器、使用 codemode 与扩展的用户。
要解决的问题包括:默认 codemode 暴露的 MCP 服务器撑长了 codemode 描述并阻塞首条提示;MCP 认证选项不足;以及会话变长导致提示提交变慢、模型目录合并呈平方级耗时、多项崩溃与错误处理缺陷。
方法或内容
发布说明按四部分组织:
- 新特性:MCP 服务器不再挡路;更多 MCP 认证选项;Anthropic 工作负载身份联合;
/reload启用新增的defaultTools工具。 - Added:
pi mcp add --description描述字段、describeNamespace()辅助函数、oauth.clientName设置、auth.provider认证方式、三个ANTHROPIC_*环境变量支持。 - Changed:codemode 描述精简,服务器信息移至
mcp_servers系统提示节;首条提示不再等待 MCP 服务器。 - Fixed:约 15 项缺陷修复,多数附 GitHub issue 编号。
关键发现 / 结果
codemode-deferred成为codemode的别名;默认 codemode 暴露的 MCP 服务器不再列于 codemode 描述,改列于mcp_servers系统提示节,变更节会追加进会话(#10212)- 首条提示不再等待无直接工具的 MCP 服务器,改为后台连接、按需等待(#10212)
- 新增
oauth.clientName(#10226)与"auth": { "provider": "<provider>" }(仅限全局mcp.与扩展,除回环主机外要求 https,令牌每次请求重新读取) - 新增 Anthropic 身份联合环境变量
ANTHROPIC_FEDERATION_RULE_ID、ANTHROPIC_ORGANIZATION_ID、ANTHROPIC_IDENTITY_TOKEN_FILE(#10177、#10242) /reload现会启用新增到defaultTools的工具(#10245)- 修复:提示提交随会话变长变慢(每条助手消息查一次模型目录,#10198);远程目录合并平方级耗时;
image()接受畸形 base64 导致后续请求 HTTP 400(#10215);工具名仅-/_差异时调错工具,现统一用_并加哈希后缀(#10239)等
结论与意义
发布说明未给出整体性结论或适用边界论述;其隐含取向是让 MCP 服务器『不挡路』(默认延迟暴露、按需搜索、不阻塞首条提示)、扩充认证方式并修复性能与稳定性问题。所有描述仅针对 0.99.2 版本;对后续版本的兼容性承诺原文未说明。
AI 解读 AI 生成
方法:按「时空变量」分析(时间 / 空间 / 变量,严格区分包含、相关与因果),对象包括原文作者、署名人员与关键技术及其实际原理;结论用「元反空」(元思考、反思考、空思考、综合)整理。
时间:何时发生,现在是否仍成立
内容对应发布日期 2026-09-30(原文标注 Sep 30, 2026;来源日期 UTC 2026年9月30日 08:00(北京时间),即北京时间 2026-09-30 08:00)。所有变更均针对当时的 0.99.2 版本;这些行为在后续版本中是否保留、是否被再次修改,原文未说明。
空间:谁的环境 / 场景
适用于 Pi 0.99.2 用户,具体场景包括:
- 使用 codemode 与 MCP 服务器的脚本(
searchTools()、describeNamespace()) - 通过 OAuth 或 provider
/login令牌认证 HTTP MCP 服务器(auth.provider仅限全局mcp.与扩展,除回环主机外要求 https) - 使用 Anthropic API 环境变量身份联合的部署
- Windows 独立可执行文件(codemode 脚本 worker 修复)
- 涉及 Z.AI CN 端点的上下文溢出检测,以及
built-in-tool-renderer.ts、minimal-mode.ts等扩展示例
变量:实际改变了什么
- codemode 描述:从包含延迟工具、工具计数、MCP 服务器指令 → 不再包含,服务器信息移至
mcp_servers系统提示节 - 首条提示:从等待 MCP 服务器 → 不再等待,服务器后台连接
- MCP 工具/命名空间命名:
mcp__my-server__x改为mcp__my_server__x(-替换为_),同服务器冲突工具加哈希后缀,仅-/_不同的服务器名会被拒绝 Retry-After头含不可解析日期时:从立即重试改为指数退避/reload:现会启用新增到defaultTools的工具;--tools、--no-tools、--no-builtin-tools仍可覆盖该设置codemode.mode: "only"的系统提示工具列表不再误列 read、bash、edit、write
区分:包含 ≠ 相关 ≠ 因果
有明确因果证据的:各修复项均给出缺陷与根因,如『提示提交随会话变慢,因为模型选择每条助手消息查询一次模型目录』(#10198)、『远程目录合并呈平方级耗时』、『Retry-After 含不可解析日期导致立即重试』。
设计性因果:默认 codemode 暴露的服务器不再列于 codemode 描述,因此描述不再随 MCP 服务器连接或工具变化而改变。仅为包含/相关关系的:describeNamespace() 返回命名空间的指令与工具名、searchTools() 接受 mcp__dev-radius/mcp__dev_radius/dev-radius/dev_radius 四种写法,属功能描述,原文未声称因果。
对象:作者/署名与关键技术原理
作者/署名:结构化作者字段为空,原文未标注本发布说明的作者/署名(正文仅以 issue 编号提及个别 PR 贡献者,不构成署名)。关键技术及原文描述的原理:
- MCP 服务器管理:
pi mcp add --description、--oauth-client-name、全局mcp. - codemode 延迟工具暴露:脚本用
searchTools()搜索、describeNamespace(name)读取命名空间指令与工具名 oauth.clientName:改变 OAuth 客户端注册时发送的客户端名,面向只接受已知客户端的服务器auth.provider:每次请求读取 provider 当前/login令牌作为 bearer token,provider 刷新即生效- Anthropic 工作负载身份联合:基于三个
ANTHROPIC_*环境变量实现(内部机制原文未详述)
元反空综合结论
元:这条发布说明回答『Pi 0.99.2 改了什么』,本质是降低 MCP 集成的提示词开销与启动阻塞、补齐认证方式、修复性能与健壮性缺陷。
反:最可能有边界的部分——工具/命名空间命名从 - 改为 _ 可能破坏引用旧名的现有脚本与配置;auth.provider 使用受限(仅全局 mcp. 与扩展、非回环主机要求 https);所有行为仅承诺于 0.99.2,后续版本是否延续原文未说明。
空:去掉叙事后剩下的必要事实是一份带 GitHub issue 编号的变更清单——若干新特性、3 项 Changed、约 15 项 Fixed,发布于北京时间 2026-09-30。
综合:这是一次以 MCP 易用性与性能为主的常规补丁版本;各项变更均附 issue 编号可追溯,但原文未提供性能基准数据或验证方法,性能改进幅度(如提交变慢修复)原文未量化。
中文译文 AI 生成
更新日志 发布说明 2026 年 9 月 30 日 Pi 0.99.2 GitHub release npm
新特性
- MCP 服务器不再碍事:采用默认
codemode暴露方式的服务器不再列在codemode描述中,也不再阻塞第一条提示。它们出现在 system prompt 的一个简短小节中,脚本通过searchTools()和describeNamespace()找到其工具。参见 Control tool exposure。 - 更多 MCP 认证选项:
oauth.clientName用于仅接受已知 OAuth 客户端的服务器;"auth": { "provider": "<provider>" }用于以提供商的/login令牌对 HTTP 服务器进行认证。参见 Authenticate with OAuth。 - 通过 Anthropic SDK 环境变量实现 Anthropic 工作负载身份联合。参见 Use an API key from the environment。
/reload可启用新增到defaultTools设置中的工具。参见 Tools。
新增
- 为 MCP 服务器新增 description 字段(
pi mcp add --description),该字段在 system prompt 中随服务器一起显示,并用于在工具搜索中对该服务器的工具进行排序;同时新增 codemode 辅助函数describeNamespace(name),返回某个命名空间的指令和工具名称。describeNamespace()和searchTools()接受的命名空间可写为mcp__dev-radius、mcp__dev_radius、dev-radius或dev_radius。 - 为 MCP 服务器新增
oauth.clientName设置(pi mcp add --oauth-client-name),用于更改 OAuth 客户端注册时发送的客户端名称,适用于仅接受已知客户端的服务器(#10226)。 - 为 HTTP MCP 服务器新增
"auth": { "provider": "<provider>" },改为发送提供商当前的/login令牌作为 bearer 令牌,而非使用 MCP OAuth。该令牌在每次请求时都会读取,因此提供商的刷新会生效。仅允许在全局mcp.json中以及从扩展中使用,且除 loopback 主机外要求 https。 - 新增通过
ANTHROPIC_FEDERATION_RULE_ID、ANTHROPIC_ORGANIZATION_ID和ANTHROPIC_IDENTITY_TOKEN_FILE环境变量实现的 Anthropic 工作负载身份联合(参见 Providers)(#10177、#10242,由 @philfreo 贡献)。 /reload现在会启用新增到defaultTools设置中的工具。从中移除的工具保持启用,会话期间被关闭的工具除非重新加入否则保持关闭,而--tools、--no-tools和--no-builtin-tools仍会覆盖该设置(#10245)。
变更
- 采用默认
codemode暴露方式的 MCP 服务器不再出现在codemode描述中;脚本通过searchTools()找到它们。codemode-deferred现在是codemode的别名。对希望模型无需搜索即可看到的工具,请使用 direct 暴露方式(#10212)。 codemode描述不再包含延迟暴露的工具、工具数量或 MCP 服务器指令,因此在 MCP 服务器连接或更改其工具时,描述不再随之变化。出于同样的原因,tool_search的描述不再列出其工具可被加载的那些服务器。服务器改为列在 system prompt 的mcp_servers小节中,附带一行摘要,并在每次提示开始时更新;发生变化的小节会被追加到对话中。
脚本通过 describeNamespace() 读取服务器指令(#10212)。
- 第一条提示不再等待没有直接暴露工具的 MCP 服务器。这些服务器在后台连接,当
codemode脚本点名它们、脚本搜索工具或tool_search运行时才会等待它们(#10212)。
修复
- 修复了当保存的默认模型属于某个由扩展注册且带有已存储凭据的原生提供商时,新会话偶发忽略该默认模型或警告没有可用模型的问题(#9962、#10190,由 @davidbrai 贡献)。
- 修复了
/mcp登录 URL 跨行换行后不可点击的问题,现将其作为终端超链接输出,并像/login一样带有 Cmd/Ctrl+点击打开的提示行(#10186)。 - 修复了
codemode的image()接受格式错误的 base64 数据或不受支持的图像类型的问题,此前这会持久化一个无效图像块,导致之后每一次提供商请求都以 HTTP 400 失败(#10215)。 - 修复了
codemode无法从独立 Windows 可执行文件启动其脚本 worker 的问题(#10204)。 - 修复了提示提交随会话长度增加而变慢的问题,原因是解析会话的模型选择时,每条助手消息都会查询一次模型目录(#10198)。
- 修复了使用已刷新 pi.dev 目录的提供商模型查询变慢的问题,原因是合并远程目录模型的耗时为平方级。
- 修复了
built-in-tool-renderer.ts和minimal-mode.ts扩展示例会将内置工具的摘要和使用指南从 system prompt 中移除的问题(#10072、#10193,由 @christianklotz 贡献)。 - 修复了对 Z.AI CN 端点 “Prompt exceeds max length” 错误的上下文溢出检测(#10208)。
- 修复了当工具 schema 使用 Anthropic 严格工具使用所拒绝的关键字(如
minimum/maximum)时 Anthropic 请求失败的问题;此类工具现在以非严格方式发送(#9953)。 - 修复了当
Retry-After头包含无法解析的日期时提供商重试立即触发的问题;现在改用指数退避(#9571)。 - 修复了未以字符串名称注册或缺少 handler 的扩展命令在输入
/时导致 pi 崩溃的问题;现在该扩展会改为加载失败并报错(#10054)。 - 修复了折叠状态下
codemode和 MCP 工具结果在输出为单条长行(如压缩后的 JSON)时占满屏幕的问题。与 bash 输出一样,预览现在按换行后的行数而非逻辑行数进行限制。 - 修复了
codemode.mode: "only"在 system prompt 的工具列表中列出read、bash、edit和write的问题,尽管请求中只声明了codemode(#10192)。 - 修复了两个工具名称仅在
-和_上不同(如read-file和read_file)时codemode脚本调用错误 MCP 工具的问题。与 Codex 一样,MCP 工具和命名空间名称现在会将-替换为_(mcp__my-server__x现在为mcp__my_server__x),服务器中发生冲突的工具都会加上哈希后缀,仅-和_不同的服务器名称会被拒绝(#10239)。
展开原文提取正文(采集端自动提取,可能有缺失)
ChangelogRelease notesSep 30, 2026Pi 0.99.2GitHub releasenpmNew Features
MCP servers stay out of the way: servers with the default codemode exposure are no longer listed in the codemode description and no longer block the first prompt. They appear in a short system prompt section, and scripts find their tools with searchTools() and describeNamespace(). See Control tool exposure. More MCP authentication options: oauth.clientName for servers that only accept known OAuth clients, and "auth": { "provider": "<provider>" } to authenticate HTTP servers with a provider's /login token. See Authenticate with OAuth. Anthropic workload identity federation from the Anthropic SDK environment variables. See Use an API key from the environment. /reload enables tools newly added to the defaultTools setting. See Tools.
Added
Added a description field for MCP servers (pi mcp add --description), shown with the server in the system prompt and used to rank its tools in tool search, and a describeNamespace(name) codemode helper that returns a namespace's instructions and tool names. describeNamespace() and searchTools() accept a namespace as mcp__dev-radius, mcp__dev_radius, dev-radius, or dev_radius. Added an oauth.clientName setting for MCP servers (pi mcp add --oauth-client-name) to change the client name sent during OAuth client registration, for servers that only accept known clients (#10226). Added "auth": { "provider": "<provider>" } for HTTP MCP servers to send a provider's current /login token as the bearer token instead of using MCP OAuth. The token is read on every request, so provider refreshes apply. Only allowed in the global mcp.json and from extensions, and requires https except on loopback hosts. Added Anthropic workload identity federation from the ANTHROPIC_FEDERATION_RULE_ID, ANTHROPIC_ORGANIZATION_ID, and ANTHROPIC_IDENTITY_TOKEN_FILE environment variables (see Providers) (#10177, #10242 by @philfreo). /reload now enables tools newly added to the defaultTools setting. Tools removed from it stay enabled, tools turned off during the session stay off unless newly added, and --tools, --no-tools, and --no-builtin-tools still override the setting (#10245).
Changed
MCP servers with the default codemode exposure no longer appear in the codemode description; scripts find them with searchTools(). codemode-deferred is now an alias for codemode. Use direct exposure for tools the model should see without searching (#10212). The codemode description no longer includes deferred tools, tool counts, or MCP server instructions, so it no longer changes when MCP servers connect or change their tools. The tool_search description no longer lists the servers whose tools it can load, for the same reason. Servers are listed instead in an mcp_servers system prompt section with a one-line summary, updated at the start of each prompt; a changed section is appended to the conversation. Scripts read server instructions with describeNamespace() (#10212). The first prompt no longer waits for MCP servers without direct tools. They connect in the background and are waited for when a codemode script names them, a script searches tools, or tool_search runs (#10212).
Fixed
Fixed new sessions intermittently ignoring the saved default model, or warning that no models are available, when it belongs to an extension-registered native provider with a stored credential (#9962, #10190 by @davidbrai). Fixed the /mcp sign-in URL not being clickable when it wraps across lines, by emitting it as a terminal hyperlink with a Cmd/Ctrl+click to open line like /login (#10186). Fixed codemode image() accepting malformed base64 data or unsupported image types, which persisted an invalid image block that made every later provider request fail with HTTP 400 (#10215). Fixed codemode failing to start its script worker from the standalone Windows executable (#10204). Fixed prompt submission slowing down with session length, because resolving the session's model selection looked up the model catalog once per assistant message (#10198). Fixed model lookups slowing down for providers with a refreshed pi.dev catalog, because merging remote catalog models took quadratic time. Fixed the built-in-tool-renderer.ts and minimal-mode.ts extension examples removing the built-in tools' summaries and guidelines from the system prompt (#10072, #10193 by @christianklotz). Fixed context overflow detection for Z.AI CN endpoint Prompt exceeds max length errors (#10208). Fixed Anthropic requests failing when a tool schema uses keywords Anthropic strict tool use rejects, such as minimum/maximum; such tools are now sent non-strict (#9953). Fixed provider retries firing immediately when a Retry-After header contains an unparseable date; they now use exponential backoff (#9571). Fixed extension commands registered without a string name or handler crashing pi when typing /; the extension now fails to load with an error instead (#10054). Fixed collapsed codemode and MCP tool results filling the screen when the output is one long line, such as minified JSON. Like bash output, the preview is now limited to wrapped lines instead of logical lines. Fixed codemode.mode: "only" listing read, bash, edit, and write in the system prompt's tool list although requests only declare codemode (#10192). Fixed codemode scripts calling the wrong MCP tool when two tool names differ only in - and _, such as read-file and read_file. Like in Codex, MCP tool and namespace names now replace - with _ (mcp__my-server__x is now mcp__my_server__x), colliding tools of a server all get a hash suffix, and server names that differ only in - and _ are rejected (#10239).
原文入口
阅读原文(pi.dev)原文将在新窗口打开。收录时间不是内容更新时间;正文、译文与解读的版权归原作者/来源所有,本站仅作个人阅读辅助并保留原文入口;页面时间均为北京时间。
了解来源批准与收录规则