跳到主内容
@wquguru
精选92pi coding agent(GitHub Releases)AI 编程与模型

pi coding agent v0.86.0:破坏性变更与 Prompt Cache Warming

v0.86.0

原文
发到 X
推荐理由

v0.86.0 引入了 user_bash fail closed 和 Context 类型变更等破坏性更新,直接改变现有 Agent 行为逻辑。使用 pi coding agent 的开发者必须检查自定义 Provider 适配器和 bash 处理逻辑,避免升级后功能异常。

New Features

新功能

  • Prompt cache warming — Keep valuable prompt caches alive during long tool runs and optionally while idle using cost-aware refreshes. See Cache Warming.
  • Bug reporting — Report problems with /bug using redacted diagnostics, optional transcripts, or exported ZIP archives. See Reporting Bugs.
  • Transcript-aware prompt and tool updates — Preserve instruction and tool changes across resume and branch navigation while retaining cached prefixes. See before_agent_start.
  • Offline Radius model catalog — Select Radius models immediately, with cached and live catalogs overlaid when available. See Radius.
  • Per-model compaction budgets — Configure reserved and recent-token budgets by model. See Per-model overrides.
  • 提示词缓存预热 — 在长时间的工具运行期间保持有价值的提示词缓存活跃,并可选择在空闲时使用成本感知的刷新机制。参见 Cache Warming。
  • 错误报告 — 使用 /bug 命令报告问题,支持脱敏诊断信息、可选的转录文本或导出的 ZIP 归档文件。参见 Reporting Bugs。
  • 感知转录文本的提示词和工具更新 — 在恢复会话和分支导航过程中保留指令和工具的更改,同时保留已缓存的前缀。参见 before_agent_start。
  • 离线 Radius 模型目录 — 立即选择 Radius 模型,当可用时叠加缓存的和实时的目录。参见 Radius。
  • 按模型的压缩预算 — 按模型配置预留和近期令牌(token)预算。参见 Per-model overrides。

Breaking Changes

破坏性变更

  • Changed inherited pi-ai provider stream inputs from Context to normalized TranscriptContext values. Custom providers must read system prompts and tool declarations from context.messages with getCurrentSystemPrompt() and getCurrentTools(). See Custom Streaming API.
  • Restricted inherited ToolCall.arguments and ToolResultMessage.details to JSON-compatible values, changed ToolResultMessage into a conditional type, and made JsonValue arrays readonly.
  • user_bash now fails closed: errors or invalid defined results abort the command without invoking later handlers or executing locally. Return undefined to continue propagation; otherwise return { operations } or { result } (#9068).
  • 将继承的 pi-ai 提供程序流输入从 Context 更改为归一化的 TranscriptContext 值。自定义提供程序必须通过 getCurrentSystemPrompt() 和 getCurrentTools() 从 context.messages 中读取系统提示词和工具声明。参见 Custom Streaming API。
  • 将继承的 ToolCall.arguments 和 ToolResultMessage.details 限制为与 JSON 兼容的值,将 ToolResultMessage 更改为条件类型,并使 JsonValue 数组变为只读。
  • user_bash 现在采用失败关闭策略:错误或无效的定义结果将中止命令,而不会调用后续处理程序或在本地执行。返回 undefined 以继续传播;否则返回 { operations } 或 { result } (#9068)。

Added

新增

  • Added transcript-backed mid-conversation system prompt and tool changes so instruction and tool updates survive resume and branch navigation while preserving cached prefixes on supported models. See before_agent_start and Entry Types (#9548).
  • Added inherited native deferred tool loading for Fireworks Messages models. Use ToolSearch or tool_search as the loader name for prompt-prefix deferral (#9323).
  • Added click toggling for branch summaries, compaction summaries, and skill invocation entries.
  • Added the public Radius model catalog for immediate and offline model selection, with cached and live gateway catalogs overlaid when available.
  • Added ctx.modelRegistry.stream() and streamSimple() for extension model calls through configured providers with resolved authentication (#8964).
  • Added per-model reserveTokens and keepRecentTokens settings through compaction.modelOverrides, with ordinary compaction settings as fallback (#8133).
  • Added compat.allowedFallbackModels configuration for overriding or disabling Anthropic server-side fallback models (#9294).
  • Added an unsubscribe function from pi.on() so extensions can drop event handlers. Handlers added or removed during a dispatch apply to later dispatches, not the current one (#8967).
  • Exported extension hook event and result types that were previously omitted from the package entry points (#9642).
  • Added /bug [description] to report a bug to the Pi developers. The report bundles environment, model, provider, extension, and settings metadata (secrets redacted), assistant message diagnostics from the session, optionally the session transcript, or a model-written summary of what went wrong instead. It is uploaded to Radius (no login required; attributed when logged in) or exported as a zip archive, and the report id is recorded in the session as a pi.bug-report entry. Crashes are recorded in ~/.pi/agent/crashes.json, announced once on the next start, and attached to the next report; unexplained errors and exhausted retries point at /bug once per session.
  • Added cost-aware prompt-cache warming during long tool runs and optionally while idle, with configurable modes, model cache-lifetime metadata, /session diagnostics, transcript notices, and the cache_warming_decision extension event. See Cache Warming (#9668).
  • 添加了基于转录文本的对话中途系统提示词和工具更改,以便在支持的模型上,指令和工具更新能在恢复会话和分支导航过程中得以保留,同时保留缓存的前缀。参见 before_agent_start 和 Entry Types (#9548)。
  • 为 Fireworks Messages 模型添加了继承的原生延迟工具加载功能。使用 ToolSearch 或 tool_search 作为加载器名称以实现提示词前缀的延迟加载 (#9323)。
  • 添加了针对分支摘要、压缩摘要和技能调用条目的点击切换功能。
  • 添加了公开的 Radius 模型目录,用于即时和离线模型选择,当可用时叠加缓存的和实时的网关目录。
  • 添加了 ctx.modelRegistry.stream() 和 streamSimple(),用于通过配置的提供程序进行扩展模型调用,并解决身份验证问题 (#8964)。
  • 通过 compaction.modelOverrides 添加了按模型的 reserveTokens 和 keepRecentTokens 设置,并以普通压缩设置作为回退方案 (#8133)。
  • 添加了 compat.allowedFallbackModels 配置,用于覆盖或禁用 Anthropic 服务器端的回退模型 (#9294)。
  • 从 pi.on() 添加了取消订阅功能,以便扩展程序可以移除事件处理器。在分发期间添加或移除的处理器仅适用于后续的分发,而非当前分发(#8967)。
  • 导出了此前未包含在包入口点中的扩展钩子事件和结果类型(#9642)。
  • 添加了 /bug [description] 命令以向 Pi 开发者报告错误。该报告打包了环境、模型、提供商、扩展程序和设置元数据(已脱敏敏感信息)、来自会话的助手消息诊断信息,并可选择性地包含会话记录或模型生成的错误摘要。报告将上传至 Radius(无需登录;登录后会关联身份)或导出为 zip 归档文件,报告 ID 会以 pi.bug-report 条目的形式记录在会话中。崩溃信息会记录在 ~/.pi/agent/crashes.json 中,在下次启动时提示一次,并附加到下一次报告中;无法解释的错误和重试耗尽的情况会在每个会话中引导用户执行一次 /bug。
  • 在长时间的工具运行过程中以及可选的空闲状态下,添加了成本感知的提示词缓存预热功能,支持可配置模式、模型缓存生命周期元数据、/session 诊断信息、转录本通知以及 cache_warming_decision 扩展事件。详见 Cache Warming (#9668)。

Changed

更改

  • Made --resume session results appear progressively, using file modification times to prioritize all-folder loading and cancelling outstanding transcript reads after selection.
  • Reduced --continue startup time by checking candidate session headers in modification-time order and stopping after the newest matching session.
  • Replaced the external native clipboard dependency with bundled asynchronous macOS, Windows, and X11 helpers while preserving platform command and OSC 52 fallbacks (#9163).
  • Reduced inherited fuzzy search latency for long texts by using native substring search instead of scanning each character in JavaScript (#9267).
  • Moved compaction, branch summarization, and retry spinners into the editor border alongside the working indicator. Custom editors use the same embedding opt-in for all status spinners.
  • Enabled strict-prefer JSON-schema sampling by default for built-in read, bash, powershell, edit, and write tools, without requiring PI_EXPERIMENTAL. Extensions can re-register tool definitions with constrainedSampling: false.
  • Formatted Bash and PowerShell tool durations of at least one minute as minutes and seconds, with hours when needed (#9628).
  • Deferred the extension compiler and bundled virtual modules until a filesystem extension is loaded, reducing the baseline SDK import cost (#9540).
  • 使 --resume 会话结果逐步显示,利用文件修改时间优先加载所有文件夹,并在选择后取消待处理的转录本读取操作。
  • 通过按修改时间顺序检查候选会话头并在找到最新匹配会话后停止,减少了 --continue 的启动时间。
  • 用内置的异步 macOS、Windows 和 X11 辅助工具替换了外部原生剪贴板依赖,同时保留了平台命令和 OSC 52 回退机制(#9163)。
  • 通过使用原生子字符串搜索替代在 JavaScript 中逐个字符扫描,降低了长文本继承模糊搜索的延迟(#9267)。
  • 将压缩、分支摘要和重试旋转指示器移至编辑器边框,与工作指示器并列。自定义编辑器对所有状态旋转指示器使用相同的嵌入选项。
  • 默认启用严格偏好 JSON 模式采样,适用于内置的 read、bash、powershell、edit 和 write 工具,无需设置 PI_EXPERIMENTAL。扩展程序可以使用 constrainedSampling: false 重新注册工具定义。
  • 将 Bash 和 PowerShell 工具持续时间至少为一分钟的情况格式化为分钟和秒,必要时包含小时(#9628)。
  • 将扩展编译器和捆绑虚拟模块的延迟加载推迟到文件系统扩展加载之后,从而降低基础 SDK 导入成本 (#9540)。

Fixed

已修复

  • Fixed GitHub Copilot GPT models, including GPT-6 Astra, using the Chat Completions adapter instead of the required Responses adapter (#9253 by @petrroll).
  • Fixed inherited DeepSeek V4.1 thinking levels on OpenRouter and OpenCode Go preserving provider effort metadata (#9485).
  • Fixed inherited bodyless HTTP 400/413 errors from non-Cerebras providers being misclassified as context overflow (#9482).
  • Fixed inherited Vercel AI Gateway replaying unsigned thinking as assistant text (#9676).
  • Fixed inherited Google Generative AI and Vertex AI using unsupported thinking levels when reasoning is omitted or when model capabilities differ within a Gemini family (#9455).
  • Fixed inherited Anthropic-compatible relays breaking signed thinking replay when they report a different response model, while preserving fallback pricing (#9188).
  • Fixed inherited Amazon Bedrock one-hour cache writes being priced at the five-minute rate (#9457).
  • Fixed inherited quadratic CPU usage when draining buffered EventStream events (#9055).
  • Fixed inherited Mistral Medium reasoning requests to use reasoning_effort for all reasoning-capable mistral-medium-* model IDs instead of the unsupported prompt_mode (#8700).
  • Fixed inherited OpenCode and OpenCode Go requests to send x-opencode-session from sessionId across all supported API adapters (#9326).
  • Fixed inherited OpenAI Codex requests to send the model's Off reasoning effort instead of omitting it, while respecting unsupported Off mappings (#9191).
  • Fixed inherited Fireworks unsigned thinking replay and reasoning effort selection using catalog metadata, with verified DeepSeek V4 and Qwen3.8 fallbacks and removal of redundant GLM 5.2 and Kimi K3 effort aliases (#9323).
  • Fixed inherited OpenRouter requests to send x-session-id from sessionId for Chat Completions and Anthropic Messages models when prompt caching is enabled (#9102).
  • Fixed the inherited DeepSeek catalog to advertise deepseek-flash for DeepSeek V4.1 Flash instead of retired Flash aliases, and refreshed DeepSeek pricing metadata (#9423).
  • Fixed inherited Mistral-hosted GLM-5.2 reasoning requests to use reasoning_effort instead of the ignored prompt_mode (#9375).
  • Fixed inherited OpenAI-compatible Responses errors to identify the actual provider instead of always labeling them as OpenAI errors (#9298).
  • Fixed inherited Baseten requests to send session-affinity headers from sessionId for automatic prompt-cache routing (#9629).
  • Fixed inherited retry classification for Cloudflare 520 responses (#9627).
  • Fixed inherited retry classification for transient Azure peak-load capacity errors (#9669).
  • Fixed session tree navigation racing with active compaction and replacing its progress UI (#9179 by @acmerfight).
  • 修复了 GitHub Copilot GPT 模型(包括 GPT-6 Astra)使用 Chat Completions 适配器而非所需的 Responses 适配器的问题 (#9253 by @petrroll)。
  • 修复了 OpenRouter 和 OpenCode Go 上继承的 DeepSeek V4.1 思考级别,同时保留提供商努力元数据 (#9485)。
  • 修复了非 Cerebras 提供商继承的无正文 HTTP 400/413 错误被错误分类为上下文溢出 (#9482)。
  • 修复了 Vercel AI Gateway 继承的将未签名思考内容重放为助手文本的问题 (#9676)。
  • 修复了 Google Generative AI 和 Vertex AI 在省略推理或 Gemini 系列内模型能力不同时使用不受支持的思考级别的问题 (#9455)。
  • 修复了 Anthropic 兼容中继在报告不同响应模型时破坏签名思考重放的问题,同时保留回退定价 (#9188)。
  • 修复了 Amazon Bedrock 一小时缓存写入按五分钟费率计费的问题 (#9457)。
  • 修复了排空缓冲 EventStream 事件时的二次 CPU 使用率问题 (#9055)。
  • 修复了 Mistral Medium 推理请求,使其对所有支持推理的 mistral-medium-* 模型 ID 使用 reasoning_effort,而不是使用不支持的 prompt_mode (#8700)。
  • 修复了 OpenCode 和 OpenCode Go 请求,使其在所有支持的 API 适配器中从 sessionId 发送 x-opencode-session (#9326)。
  • 修复了 OpenAI Codex 请求,使其发送模型的 Off 推理努力值而不是省略它,同时尊重不支持的 Off 映射 (#9191)。
  • 修复了 Fireworks 的未签名思考重放和推理努力选择,使用目录元数据,并验证了 DeepSeek V4 和 Qwen3.8 的回退机制,同时移除了冗余的 GLM 5.2 和 Kimi K3 努力别名 (#9323)。
  • 修复了 OpenRouter 请求,使其在启用提示缓存时为 Chat Completions 和 Anthropic Messages 模型从 sessionId 发送 x-session-id (#9102)。
  • 修复了继承的 DeepSeek 目录,使其为 DeepSeek V4.1 Flash 宣传 deepseek-flash 而不是已弃用的 Flash 别名,并刷新了 DeepSeek 定价元数据 (#9423)。
  • 修复了 Mistral 托管的 GLM-5.2 推理请求,使其使用 reasoning_effort 而不是被忽略的 prompt_mode (#9375)。
  • 修复了 OpenAI 兼容的 Responses 错误,使其识别实际提供商而不是始终将其标记为 OpenAI 错误 (#9298)。
  • 修复了继承的 Baseten 请求,使其从 sessionId 发送会话亲和性标头以实现自动提示缓存路由(#9629)。
  • 修复了 Cloudflare 520 响应的继承重试分类(#9627)。
  • 修复了瞬态 Azure 峰值负载容量错误的继承重试分类(#9669)。
  • 修复了会话树导航与活动压缩竞争以及替换其进度 UI 的问题(由 @acmerfight 提交 #9179)。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件