### 新功能
- Claude Opus 4.6、Sonnet 4.6 及相关 Bedrock 模型现支持 100 万 token 上下文窗口(此前为 20 万)([#2135](https://github.com/badlogic/pi-mono/pull/2135) by [@mitsuhiko](https://github.com/mitsuhiko))。
- 扩展工具调用现默认并行执行,同时保留顺序执行的 `tool_call` 预检以支持扩展拦截。
- 为 `google-vertex` 提供商新增 `GOOGLE_CLOUD_API_KEY` 环境变量支持,作为应用默认凭证(Application Default Credentials)的替代方案 ([#1976](https://github.com/badlogic/pi-mono/pull/1976) by [@gordonhwc](https://github.com/gordonhwc))。
- 扩展可通过 `newSession()` 提供确定性会话 ID ([#2130](https://github.com/badlogic/pi-mono/pull/2130) by [@zhahaoyu](https://github.com/zhahaoyu))。
### 新增
- 为 `google-vertex` 提供商新增 `GOOGLE_CLOUD_API_KEY` 环境变量支持,作为应用默认凭证的替代方案 ([#1976](https://github.com/badlogic/pi-mono/pull/1976) by [@gordonhwc](https://github.com/gordonhwc))
- 在 `newSession()` 中新增自定义会话 ID 支持,满足需要确定性会话路径的扩展需求 ([#2130](https://github.com/badlogic/pi-mono/pull/2130) by [@zhahaoyu](https://github.com/zhahaoyu))
### 变更
- 扩展工具拦截机制已更改为使用 agent-core 的 `beforeToolCall` 和 `afterToolCall` 钩子,替代原有的基于包装器的拦截方式。工具调用现默认并行执行,扩展 `tool_call` 预检仍按顺序运行,最终工具结果按助手源顺序输出。
- 将 Claude Opus 4.6、Sonnet 4.6 及相关 Bedrock 模型的上下文窗口从 20 万 token 提升至 100 万 token ([#2135](https://github.com/badlogic/pi-mono/pull/2135) by [@mitsuhiko](https://github.com/mitsuhiko))
### 修复
- 修复了多工具轮次中 `tool_call` 扩展处理器因未刷新队列事件而观察到陈旧 `sessionManager` 状态的问题。通过在每次 `tool_call` 预检前清空队列中的代理事件来解决。在并行工具模式下,这能确保当前助手工具调用消息期间的状态一致性,但不保证同一助手消息中的并列工具结果。
- 修复了基于 TUI `Input` 组件的交互式输入框在显示宽 Unicode 文本(如中日韩字符、全角字符)时按视觉列宽滚动的问题,防止了搜索和过滤输入等场景下的渲染换行溢出及 TUI 崩溃 ([#1982](https://github.com/badlogic/pi-mono/issues/1982))
- 修复了当 `extended-keys-format` 保持默认 `xterm` 时,tmux 中 `shift+tab` 及其他修改后的 Tab 键绑定失效的问题
- 修复了图像转换和缩放时未应用 EXIF 方向信息的问题,导致手机拍摄的 JPEG 和 WebP 图片显示旋转或镜像 ([#2105](https://github.com/badlogic/pi-mono/pull/2105) by [@melihmucuk](https://github.com/melihmucuk))
- 修复了默认编码代理系统提示词包含当前时间的问题,现仅包含 ISO 格式的当前日期,使提示词前缀在重载和恢复会话时保持可缓存 ([#2131](https://github.com/badlogic/pi-mono/issues/2131))
- 修复了重试正则表达式,使其能匹配提供商返回的 `server_error` 和 `internal_error` 错误类型,提升了自动重试的覆盖范围 ([#2117](https://github.com/badlogic/pi-mono/pull/2117) by [@MadKangYu](https://github.com/MadKangYu))
- 修复了示例扩展,使其支持通过 `PI_CODING_AGENT_DIR` 环境变量自定义代理目录路径 ([#2009](https://github.com/badlogic/pi-mono/pull/2009) by [@smithbm2316](https://github.com/smithbm2316))
- 修复了 OpenAI Responses API 提供商在 `function_call_output` 项中未发送工具结果图片的问题,该问题会导致工具结果中的图片数据被静默丢弃 ([#2104](https://github.com/badlogic/pi-mono/issues/2104))
- 修复了 `openai-completions` 提供商将助手内容作为结构化内容块而非纯字符串发送的问题,该问题会导致与部分 OpenAI 兼容后端交互时出错 ([#2008](https://github.com/badlogic/pi-mono/pull/2008) by [@geraldoaax](https://github.com/geraldoaax))
- 修复了 OpenAI Responses `response.failed` 处理器中的错误详情,现包含状态码、错误代码和具体消息,而非仅显示通用失败提示 ([#1956](https://github.com/badlogic/pi-mono/pull/1956) by [@drewburr](https://github.com/drewburr))
- 修复了 GitHub Copilot 设备码登录轮询逻辑,使其尊重 OAuth 降速间隔、在首次令牌轮询前等待,并在 WSL/虚拟机环境中当重复降速导致超时时提供更清晰的时钟漂移提示
- 修复了未捕获 OpenAI 兼容提供商用量统计的问题,这些提供商将用量数据返回在 `choice.usage` 而非标准的 `chunk.usage` 中(例如 Moonshot/Kimi)([#2017](https://github.com/badlogic/pi-mono/issues/2017))
- 修复了终端宽度较窄时编辑器滚动指示器渲染崩溃的问题 ([#2103](https://github.com/badlogic/pi-mono/pull/2103) by [@haoqixu](https://github.com/haoqixu))
- 修复了编辑器和输入框粘贴时制表符未转换为空格的问题 ([#2027](https://github.com/badlogic/pi-mono/pull/2027), [#1975](https://github.com/badlogic/pi-mono/pull/1975) by [@haoqixu](https://github.com/haoqixu))
- 修复了宽字符(中日韩、全角字符)恰好位于换行边界时 `wordWrapLine` 溢出的问题 ([#2082](https://github.com/badlogic/pi-mono/pull/2082) by [@haoqixu](https://github.com/haoqixu))
- 修复了粘贴标记在编辑器自动换行和光标导航中未被当作原子片段处理的问题 ([#2111](https://github.com/badlogic/pi-mono/pull/2111) by [@haoqixu](https://github.com/haoqixu))
### New Features
- Claude Opus 4.6, Sonnet 4.6, and related Bedrock models now use a 1M token context window (up from 200K) ([#2135](https://github.com/badlogic/pi-mono/pull/2135) by [@mitsuhiko](https://github.com/mitsuhiko)).
- Extension tool calls now execute in parallel by default, with sequential `tool_call` preflight preserved for extension interception.
- `GOOGLE_CLOUD_API_KEY` environment variable support for the `google-vertex` provider as an alternative to Application Default Credentials ([#1976](https://github.com/badlogic/pi-mono/pull/1976) by [@gordonhwc](https://github.com/gordonhwc)).
- Extensions can supply deterministic session IDs via `newSession()` ([#2130](https://github.com/badlogic/pi-mono/pull/2130) by [@zhahaoyu](https://github.com/zhahaoyu)).
### Added
- Added `GOOGLE_CLOUD_API_KEY` environment variable support for the `google-vertex` provider as an alternative to Application Default Credentials ([#1976](https://github.com/badlogic/pi-mono/pull/1976) by [@gordonhwc](https://github.com/gordonhwc))
- Added custom session ID support in `newSession()` for extensions that need deterministic session paths ([#2130](https://github.com/badlogic/pi-mono/pull/2130) by [@zhahaoyu](https://github.com/zhahaoyu))
### Changed
- Changed extension tool interception to use agent-core `beforeToolCall` and `afterToolCall` hooks instead of wrapper-based interception. Tool calls now execute in parallel by default, extension `tool_call` preflight still runs sequentially, and final tool results are emitted in assistant source order.
- Raised Claude Opus 4.6, Sonnet 4.6, and related Bedrock model context windows from 200K to 1M tokens ([#2135](https://github.com/badlogic/pi-mono/pull/2135) by [@mitsuhiko](https://github.com/mitsuhiko))
### Fixed
- Fixed `tool_call` extension handlers observing stale `sessionManager` state during multi-tool turns by draining queued agent events before each `tool_call` preflight. In parallel tool mode this guarantees state through the current assistant tool-calling message, but not sibling tool results from the same assistant message.
- Fixed interactive input fields backed by the TUI `Input` component to scroll by visual column width for wide Unicode text (CJK, fullwidth characters), preventing rendered line overflow and TUI crashes in places like search and filter inputs ([#1982](https://github.com/badlogic/pi-mono/issues/1982))
- Fixed `shift+tab` and other modified Tab bindings in tmux when `extended-keys-format` is left at the default `xterm`
- Fixed EXIF orientation not being applied during image convert and resize, causing JPEG and WebP images from phone cameras to display rotated or mirrored ([#2105](https://github.com/badlogic/pi-mono/pull/2105) by [@melihmucuk](https://github.com/melihmucuk))
- Fixed the default coding-agent system prompt to include only the current date in ISO format, not the current time, so prompt prefixes stay cacheable across reloads and resumed sessions ([#2131](https://github.com/badlogic/pi-mono/issues/2131))
- Fixed retry regex to match `server_error` and `internal_error` error types from providers, improving automatic retry coverage ([#2117](https://github.com/badlogic/pi-mono/pull/2117) by [@MadKangYu](https://github.com/MadKangYu))
- Fixed example extensions to support `PI_CODING_AGENT_DIR` environment variable for custom agent directory paths ([#2009](https://github.com/badlogic/pi-mono/pull/2009) by [@smithbm2316](https://github.com/smithbm2316))
- Fixed tool result images not being sent in `function_call_output` items for OpenAI Responses API providers, causing image data to be silently dropped in tool results ([#2104](https://github.com/badlogic/pi-mono/issues/2104))
- Fixed assistant content being sent as structured content blocks instead of plain strings in the `openai-completions` provider, causing errors with some OpenAI-compatible backends ([#2008](https://github.com/badlogic/pi-mono/pull/2008) by [@geraldoaax](https://github.com/geraldoaax))
- Fixed error details in OpenAI Responses `response.failed` handler to include status code, error code, and message instead of a generic failure ([#1956](https://github.com/badlogic/pi-mono/pull/1956) by [@drewburr](https://github.com/drewburr))
- Fixed GitHub Copilot device-code login polling to respect OAuth slow-down intervals, wait before the first token poll, and include a clearer clock-drift hint in WSL/VM environments when repeated slow-downs lead to timeout
- Fixed usage statistics not being captured for OpenAI-compatible providers that return usage in `choice.usage` instead of the standard `chunk.usage` (e.g., Moonshot/Kimi) ([#2017](https://github.com/badlogic/pi-mono/issues/2017))
- Fixed editor scroll indicator rendering crash in narrow terminal widths ([#2103](https://github.com/badlogic/pi-mono/pull/2103) by [@haoqixu](https://github.com/haoqixu))
- Fixed tab characters in editor and input paste not being normalized to spaces ([#2027](https://github.com/badlogic/pi-mono/pull/2027), [#1975](https://github.com/badlogic/pi-mono/pull/1975) by [@haoqixu](https://github.com/haoqixu))
- Fixed `wordWrapLine` overflow when wide characters (CJK, fullwidth) fall exactly at the wrap boundary ([#2082](https://github.com/badlogic/pi-mono/pull/2082) by [@haoqixu](https://github.com/haoqixu))
- Fixed paste markers not being treated as atomic segments in editor word wrapping and cursor navigation ([#2111](https://github.com/badlogic/pi-mono/pull/2111) by [@haoqixu](https://github.com/haoqixu))