外部精选
Pi 1.0.0
本文来自外部来源,不是黄奕彬的原创文章。本站提供原文入口,并在采集端生成 AI 结构化摘要、解读与中文翻译(如有),一切以原文为准。
阅读原文(pi.dev)结构化摘要 AI 生成
背景与问题
这是 Pi(一个带 TUI 界面、codemode 脚本能力与 MCP/OAuth 集成的命令行工具)1.0.0 版本的官方发布说明,面向其终端用户与脚本开发者。
它要解决的问题是:完整告知本版相对此前新增的功能、变更的默认行为与修复的缺陷,并提示需要用户配合调整的点——如恢复终端滚动缓冲、改写脚本中的工具探测写法、核对 MCP OAuth 凭据的存储方式。
方法或内容
发布内容按四节组织:
- New Features:TUI 默认全屏(
tuiMode设为"regular"可保留滚动缓冲);codemode 精简,prompt tokens 约减 40% 且报错附带恢复方法;codemode 新增models.generateImages()图像生成;/login一步完成 Radius 登录与其 MCP server 配置;Anthropic copy code 登录;MCP OAuth 加固;quietStartup: "header"。 - Added:
oauth.authServerMetadataUrl、quietStartup、models.generateImages()、copy code 登录。 - Changed:全屏默认、Radius 菜单、文档页重命名、凭据按服务器存储、codemode 精简与错误提示、标签措辞等。
- Fixed:13 项缺陷修复,覆盖 OAuth、终端渲染、内存与交互。
关键发现 / 结果
关键数据与变更点:
- codemode token:默认工具 + codemode 下,GPT-5.6 请求从约 5,300 tokens 降至约 3,300 tokens(约 40% 减少)。
- 内存:transcript 中长助手消息保留的堆内存约为原来的五分之一。
- 新增设置:
oauth.authServerMetadataUrl(覆盖错误或缺失的 OAuth 授权服务器发现,#10172)、quietStartup: "header"、tuiMode。 - 新增 API:
models.generateImages()(返回 base64 image blocks,由image()附到结果,用量计入 session cost)与ctx.modelRegistry.generateImages()。 - 行为变更:
--provider不带--model由静默忽略改为报错(#10236);脚本探测工具须从typeof tools.name改为"name" in tools。 - OAuth 修复:按 RFC 9207 拒绝 iss 指向其他授权服务器的响应;
"scope": ""等空值不再导致 Invalid scope;insufficient_scope重登不再丢失已授予 scope。
结论与意义
1.0.0 是一次包含破坏性默认行为变更的正式版本:全屏成为默认、脚本探测写法必须迁移、--provider 校验收紧,升级前需按说明调整配置或脚本。token 降幅数据针对 GPT-5.6 与默认工具集,其他模型或工具组合下的收益原文未说明。除此之外的适用边界原文未说明。
AI 解读 AI 生成
方法:按「时空变量」分析(时间 / 空间 / 变量,严格区分包含、相关与因果),对象包括原文作者、署名人员与关键技术及其实际原理;结论用「元反空」(元思考、反思考、空思考、综合)整理。
时间:何时发生,现在是否仍成立
来源日期为 2026年10月1日 08:00(北京时间),即北京时间 2026-10-01 08:00,对应当天发布的 Pi 1.0.0。所列变更在 1.0.0 版本内成立;发布之后版本是否维持这些默认行为(如全屏、凭据存储方式),原文未说明。
空间:谁的环境 / 场景
适用于 Pi 命令行/TUI 工具的 1.0.0 版本(同步发布于 GitHub release 与 npm)。覆盖场景:
- 终端显示:默认全屏 TUI,含 Apple Terminal 等具体终端的渲染修复。
- codemode 脚本环境:使用
tools、models等脚本全局对象。 - MCP 集成:OAuth 登录、凭据存储、Radius MCP server(写入全局
mcp.)。 - Anthropic 登录:含浏览器运行在另一台机器的无头(headless)环境。
- 图像模型:如 OpenRouter 的模型,经会话凭据调用。
变量:实际改变了什么
相对此前的实际变化:
- 默认 TUI 模式从普通改为全屏;可设
tuiMode: "regular"或传--tui-mode regular保留滚动缓冲。 - codemode prompt tokens 约减 40%(GPT-5.6 下 5,300 → 3,300)。
- MCP OAuth 凭据由按 URL 存储改为按服务器名 + URL 存储;仅按 URL 的旧凭据迁移到首个使用它的服务器(#10252)。
/login顶级新增 "Sign in with Radius" 为最后一项,登录后提议配置 Radius MCP server;取消登录返回原菜单。- 措辞:未配置 provider 从 "unconfigured" 改为 "not configured";仅订阅型 provider 显示 "subscription",其他 OAuth 显示 "account"。
- 文档页改名为 Providers,"Cloud Providers" 节改为 "Provider Specific Config" 并先写 Radius。
- transcript 渲染行从保存两份全宽副本改为一份;每条消息内存约为原来的五分之一。
区分:包含 ≠ 相关 ≠ 因果
有明确因果证据的:
- token 下降归因于具体改动——codemode 描述单行列出脚本全局、指向新的 Codemode 参考、工具声明压缩为一行、系统提示中 codemode 指引与 MCP 节变短。
- RFC 9207 修复使 iss 指向其他授权服务器的响应在兑换前被拒绝;scope 修复使空值不再报 Invalid scope。
- 内存修复直接使每条渲染消息保留堆内存减至约五分之一,且输出不变。
仅包含或相关、无因果声明的:
- 文档页重命名与 Radius 优先文档只是同一版本的并列变更,原文未说重命名由 Radius 引起。
models.generateImages()用量计入 session cost 是计费归属规则(类似models.classify()),非因果链。- copy code 登录与无头部署是适用场景关系。
对象:作者/署名与关键技术原理
作者/署名:原文未说明(结构化作者字段为空)。关键技术(按原文描述):
- TUI 全屏:TUI 默认全屏运行,
tuiMode控制显示模式。 - codemode:脚本环境,暴露
tools、models等全局对象;错误会说明恢复方式——不存在的成员给出近似名(tools.Bash提示tools.bash)、models.classify()与models.generateImages()对畸形参数报出期望形状、未知模型指向models.getAvailableOfType()、超大的store()值解释其用途。 models.generateImages():以会话凭据运行图像模型(如 OpenRouter 的),返回 base64 image blocks,由image()附到结果;扩展可调ctx.modelRegistry.generateImages()。- MCP OAuth:
oauth.authServerMetadataUrl在服务器宣告错误或缺失授权服务器时改用配置的元数据文档;RFC 9207 iss 校验;凭据按服务器名 + URL 存储。
元反空综合结论
- 元:这条内容本质在回答"1.0.0 改了什么、用户升级要改什么",是版本沟通与迁移指引。
- 反(最可能失效或有边界的主张):"约 40% 更少 tokens"绑定 GPT-5.6、默认工具与 codemode 组合,换模型或工具组合即不适用;全屏默认可能破坏依赖 scrollback 的工作流;
typeof tools.name改为"name" in tools是强制迁移,会破坏既有探测脚本;"内存约五分之一"针对长助手消息的特定场景;仅按 URL 的旧凭据会迁移到首个使用它的服务器,多服务器用户需自行核对。 - 空(去掉宣传叙事后的必要事实):2026-10-01 发布 1.0.0;新增
models.generateImages()、oauth.authServerMetadataUrl、quietStartup: "header";Radius 一步登录并配置 MCP server;OAuth 安全修复(RFC 9207、空 scope、scope 保留);十余项 UI、交互与内存修复;多处默认行为变更。 - 综合:这是一次含破坏性行为变更的正式版本,多数条目附 issue 编号与可复现机制,可信度较高。升级前应重点核对全屏、token、脚本探测与凭据存储四类变化;"Leaner""hardening"等表述均能落到具体机制,无空泛夸大。
中文译文 AI 生成
更新日志 发布说明2026年10月1日Pi 1.0.0 GitHub release npm
新功能
- 默认全屏 — TUI 现在以全屏方式运行。将
tuiMode设为"regular"可保留终端的正常回滚。参见 Terminal and display。 - 更精简的 codemode — prompt token 减少约 40%,并且错误会告诉模型如何恢复。参见 Codemode。
- codemode 中的图像生成 — 脚本使用会话凭据调用
models.generateImages()。参见 Generate images 与 Use image models。 /login中的 Radius — 一步完成 Radius 登录并设置其 MCP 服务器。参见 Radius。- Anthropic copy code 登录 — 在浏览器运行于另一台机器时登录。参见 Authenticate interactively。
- MCP OAuth 加固 —
oauth.authServerMetadataUrl、RFC 9207iss检查、按服务器存储凭据,以及保留已授予 scope 的升级登录。参见 Authenticate with OAuth。 - 仅 header 的静默启动 —
quietStartup: "header"保留版本和按键提示,隐藏其余内容。参见 Terminal and display。
新增
- 新增
oauth.authServerMetadataUrl设置,用于那些宣告了错误 OAuth 授权服务器或未宣告的 MCP 服务器。Pi 使用所配置的元数据文档而非 discovery(#10172)。 - 新增
quietStartup: "header",它保留包含版本和按键提示的启动 header,但隐藏 model scope 行和已加载资源列表。 - 为 codemode 脚本新增
models.generateImages():它使用会话凭据运行诸如 OpenRouter 的图像模型,并返回由image()附加到结果的 base64 图像块,其用量与models.classify()一样计入会话成本;扩展可以调用ctx.modelRegistry.generateImages()。参见 Use image models。 - 为 Anthropic
/login新增 copy code 登录方法,适用于浏览器运行在另一台机器上的无头环境(#10194,来自 @lucasmeijer)。
变更
- 将默认 TUI 模式改为全屏。将
tuiMode设为"regular"或传入--tui-mode regular可保留终端的正常回滚。 /login现在在顶层提供 "Sign in with Radius",作为最后一个选项,并显示其状态。完成 Radius 登录后,/login会提议在全局mcp.json中以"auth": { "provider": "radius" }配置 Radius MCP 服务器并重新加载。取消登录会返回其发起时的菜单。- provider 文档页面更名为 Providers,其 "Cloud Providers" 小节现为 "Provider Specific Config",并且最先介绍 Radius。
- MCP OAuth 凭据现在按服务器名称和 URL 存储,因此 URL 相同的 MCP 服务器可以用不同账户登录。仅按 URL 存储的凭据会迁移到第一个使用它们的服务器(#10252)。
- Codemode 消耗的 prompt token 少得多:在默认工具和 codemode 启用的情况下,一次 GPT-5.6 请求从约 5,300 token 缩减至 3,300 token。codemode 描述以每行一项列出脚本全局变量,并指向针对 models API 的新 Codemode 参考文档,模型在需要时会阅读它。声明的工具现在用一行说明脚本如何调用它们以及调用解析为什么,而不是重复完整声明;系统提示中的 codemode 指引和 MCP 服务器小节也更短了。
- Codemode 错误现在会说明如何恢复:读取不存在的工具或 models 成员时会列出相近匹配(
tools.Bash会提示tools.bash);models.classify()和models.generateImages()会拒绝格式错误的参数并附上期望的形状;未知模型会指向models.getAvailableOfType();过大的store()值会解释 store 的用途;生成图像却未展示的脚本会收到一条提示。之前用typeof tools.name探测工具的脚本必须使用"name" in tools。 /login和/logout现在将没有凭据的 provider 标注为 "not configured",而不是 "unconfigured"。- OAuth 浏览器页面现在显示彩色的 Pi 标志。
修复
- 修复 MCP OAuth 登录会接受其
iss参数指明另一个授权服务器的授权响应的问题;现在会在 code 被交换之前拒绝它(RFC 9207)。 - 修复当 token 响应包含
"scope": ""时 MCP OAuth 登录以 Invalid scope 失败的问题,以及由其他为空或为 null 的 OAuth 可选字段导致的类似失败(#10266)。 - 修复
/mcp login打印的登录 URL 在折行时无法点击的问题(#10186)。 - 修复
--provider不带--model时被静默忽略并运行来自另一个 provider 的默认模型的问题;现在会报错失败(#10236)。 - 修复请求更多 scope 的 MCP 服务器(
insufficient_scope)反复要求登录的问题。新的登录此前只请求缺失的 scope,导致新 token 失去上一个 token 拥有的访问权限;现在会保留已授予的 scope。 - 修复 transcript 中用户消息为每个渲染行保留两份完整宽度副本的问题;现在保留一份,输出完全相同。
- 修复
/login和/logout将包括 Radius 在内的每次 OAuth 登录都标注为 subscription 的问题;现在仅由订阅支持的 provider 显示 "subscription",其他 OAuth 登录显示 "account"。 - 修复启动 header 的 logo 在 Apple Terminal 中渲染出现间隙的问题;现在改为显示带版本号的彩色 "Pi"。
- 修复
tool_search加载的延迟 MCP 工具在 resume 和/reload时被丢弃的问题,即使其服务器在下一次提示前已重新连接;原因是会话在 MCP 服务器重新连接之前就恢复了其工具。 - 修复系统主题使 Catppuccin Frappe 这类粉彩调色板变得鲜艳得多的问题;调色板颜色现在保留其色度(#10255、#10293,来自 @dgtlntv)。
- 修复输入以空白字符开头时斜杠命令自动补全不触发的问题(#10218,来自 @haoqixu)。
- 修复全屏模式下当带样式的 token 在高亮边界处结束时,颜色溢出到鼠标选区和搜索高亮之外的问题(#10169)。
- 修复 transcript 中每个渲染消息保留的内存;长助手消息现在保留的堆内存约为之前的五分之一。
展开原文提取正文(采集端自动提取,可能有缺失)
ChangelogRelease notesOct 1, 2026Pi 1.0.0GitHub releasenpmNew Features
Fullscreen by default — The TUI now runs fullscreen. Set tuiMode to "regular" to keep the terminal's normal scrollback. See Terminal and display. Leaner codemode — About 40% fewer prompt tokens, and errors that tell the model how to recover. See Codemode. Image generation in codemode — Scripts call models.generateImages() with the session's credentials. See Generate images and Use image models. Radius in /login — Sign in with Radius and set up its MCP server in one step. See Radius. Anthropic copy code login — Sign in when the browser runs on another machine. See Authenticate interactively. MCP OAuth hardening — oauth.authServerMetadataUrl, RFC 9207 iss checks, credentials per server, and step-up sign-in that keeps granted scopes. See Authenticate with OAuth. Header-only quiet startup — quietStartup: "header" keeps the version and key hints and hides the rest. See Terminal and display.
Added
Added an oauth.authServerMetadataUrl setting for MCP servers that advertise a wrong OAuth authorization server or none. Pi uses the configured metadata document instead of discovery (#10172). Added quietStartup: "header", which keeps the startup header with version and key hints but hides the model scope line and loaded-resource listing. Added models.generateImages() to codemode scripts. It runs image models such as OpenRouter's with the session's credentials and returns base64 image blocks that image() attaches to the result; usage counts toward the session cost like models.classify(). Extensions can call ctx.modelRegistry.generateImages(). See Use image models. Added a copy code login method to Anthropic /login for headless setups where the browser runs on another machine (#10194 by @lucasmeijer).
Changed
Changed the default TUI mode to fullscreen. Set tuiMode to "regular" or pass --tui-mode regular to keep the terminal's normal scrollback. /login now offers "Sign in with Radius" at the top level, as the last option, with its status. After a Radius sign-in, /login offers to configure the Radius MCP server in the global mcp.json with "auth": { "provider": "radius" } and reloads. Cancelling a login returns to the menu it was started from. The provider docs page is renamed to Providers, its "Cloud Providers" section is now "Provider Specific Config", and it documents Radius first. MCP OAuth credentials are now stored per server name and URL, so MCP servers with the same URL can sign in with different accounts. Credentials stored by URL alone move to the first server that uses them (#10252). Codemode costs far fewer prompt tokens: with the default tools and codemode active, a GPT-5.6 request shrinks from about 5,300 to 3,300 tokens. The codemode description lists the script globals in one line each and points to the new Codemode reference for the models API, which the model reads when it needs it. Declared tools say in one line how scripts call them and what the call resolves to, instead of repeating their full declaration, and the system prompt's codemode guidance and MCP server section are shorter. Codemode errors now say how to recover: reading a tool or models member that does not exist names the close matches (tools.Bash suggests tools.bash), models.classify() and models.generateImages() reject malformed arguments with the expected shape, an unknown model points to models.getAvailableOfType(), an oversized store() value explains what the store is for, and a script that generates images without showing them gets a note. Scripts that probed for a tool with typeof tools.name must use "name" in tools. /login and /logout now label providers without credentials as "not configured" instead of "unconfigured". OAuth browser pages now show the color Pi logo.
Fixed
Fixed MCP OAuth sign-in accepting an authorization response whose iss parameter names another authorization server; the code is now rejected before it is exchanged (RFC 9207). Fixed MCP OAuth sign-in failing with Invalid scope when the token response contains "scope": "", and similar failures for other empty or null optional OAuth fields (#10266). Fixed the sign-in URL printed by /mcp login not being clickable when it wraps (#10186). Fixed --provider without --model being silently ignored and running the default model from another provider; it now fails with an error (#10236). Fixed MCP servers that ask for more scope (insufficient_scope) requesting sign-in over and over. The new sign-in requested only the missing scopes, so the new token lost access the previous one had; it now keeps the granted scopes. Fixed user messages in the transcript keeping two full-width copies of every rendered line; they keep one, with identical output. Fixed /login and /logout labeling every OAuth sign-in, including Radius, as a subscription; only subscription-backed providers say "subscription", other OAuth sign-ins say "account". Fixed the startup header logo rendering with gaps in Apple Terminal; it now shows a colored "Pi" with the version instead. Fixed deferred MCP tools that tool_search loaded being dropped on resume and /reload even when their server reconnected before the next prompt, because the session restored its tools before the MCP servers reconnected. Fixed the system theme making pastel palettes such as Catppuccin Frappe much more vivid; palette colors now keep their chroma (#10255, #10293 by @dgtlntv). Fixed slash command autocompletion not triggering when the input starts with whitespace (#10218 by @haoqixu). Fixed color bleeding past mouse selections and search highlights in fullscreen mode when a styled token ends at the highlight boundary (#10169). Fixed memory retained per rendered message in the transcript; a long assistant message keeps about a fifth of the heap it kept before.
原文入口
阅读原文(pi.dev)原文将在新窗口打开。收录时间不是内容更新时间;正文、译文与解读的版权归原作者/来源所有,本站仅作个人阅读辅助并保留原文入口;页面时间均为北京时间。
了解来源批准与收录规则