跳到主内容
@wquguru
精选85Claude Code(GitHub Releases)AI 编程与模型

Claude Code v2.1.307:API升级至2026-10-21,修复MCP与Runner故障

v2.1.307

原文
发到 X
推荐理由

API 版本强制升级且涉及自托管 Runner 关键行为变更(hook 超时与清理),重度使用者需立即关注以避免连接异常或资源泄漏。

What's changed

变更内容

  • Added /claude-api api-version to move Claude API code to API version 2026-10-21
  • Added the claude_code.safety_event OpenTelemetry event for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back
  • Fixed requests failing with a model-not-found error when CLAUDE_CODE_DISABLE_1M_CONTEXT is set and the model is an alias with the [1m] suffix, such as opus[1m]
  • Fixed the prompt-caching-scope beta header being sent behind custom ANTHROPIC_BASE_URL gateways and on Foundry, where it has no effect
  • Fixed MCP servers showing "needs authentication" in claude -p on macOS while the login keychain was locked; they now say why, and the next run after an unlock connects without a new sign-in
  • Fixed MCP servers being reported as timed out, and staying failed in headless runs, when a macOS or Linux computer went to sleep while they were connecting
  • Fixed HTTP MCP tool calls being sent twice when the connection closed mid-call; only read-only or idempotent tools are now retried
  • Fixed a turn sometimes starting without an SDK MCP server's latest tools when a background task was running
  • Fixed some "Autocompact is thrashing" errors in turns that read many PDF pages, images or other large tool results
  • Fixed /autocompact in cloud sessions going back to the default window after the session restarted
  • Fixed a conversation cleared with /clear sometimes coming back when a cloud or self-hosted runner session restarted
  • Fixed CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS being ignored in Claude apps gateway sessions
  • Fixed telemetry from Claude Desktop sessions behind a Claude apps gateway being rejected when OTEL_EXPORTER_OTLP_HEADERS is set
  • Fixed /permissions > Recently denied not showing the denied shell command, and auto mode's local classifier ignoring an approval from there when it checks a retried command; approving a row now names the command, not its description
  • Fixed /help and the / command menu showing long model-facing descriptions for bundled skills such as /claude-api instead of their short descriptions
  • Fixed subagent transcripts recording placeholder token usage and an empty stop reason for streamed responses
  • Fixed model switches through the Agent SDK's setModel(), and apps built on it, being refused when the API took more than 5 seconds to confirm the model; Claude Code now waits up to 15 seconds
  • Fixed a background command stopped through a connected app (such as the desktop app archiving an idle session) being reported to Claude as stopped by the user; the notice now names its output file
  • Fixed WebFetch in Cowork cloud sessions reporting a tool error when a site answered with a 4xx status or a robots.txt refusal; it is now a normal result, as in local sessions
  • Fixed write tools on a directly configured GitHub MCP server showing a form that closed without creating anything in the desktop app's Code tab
  • Fixed Artifact tool reads failing with a connection reset when the server had closed a reused connection
  • Self-hosted runner: Fixed sessions with --use-anthropic-git-proxy committing a .claude/settings.local.json left in the clone by an earlier session
  • Self-hosted runner: Fixed archiving or requeueing a session, or stopping the runner, during its checkout hook leaving the hook's processes running and the runner's slot held
  • Improved recovery from unparseable tool calls: Claude Code now retries the call up to twice before ending the turn with an error
  • Improved fork subagents launched together: each is now told which launch is its own, so forks are much less likely to try to start each other's work
  • Improved browser sign-in: the success page now appears as soon as sign-in completes, without waiting for your account profile to load
  • Improved web search errors in cloud and self-hosted runner sessions: a search refused with a 403 that gives a reason now shows that reason instead of a generic "Authentication error"
  • Improved the time to the first reply in cloud sessions when one of the desktop app's MCP servers can't connect
  • Improved Remote Control connect time for sessions whose transcript contains large pasted images or PDF reads
  • Changed the notice Claude gets when the WebSearch budget is used up to also tell it not to query search engines in a browser or through computer use
  • Changed the axScreenReader setting and CLAUDE_AX_SCREEN_READER in a settings env block to apply only from user, managed or --settings settings (since 2.1.305)
  • Self-hosted runner: Changed checkout hooks to be stopped after 30 minutes by default, failing the session's setup; if yours needs longer, raise --checkout-hook-timeout-min or set it to 0
  • Self-hosted runner: Changed the certificate file built for Anthropic-managed git to filter its trusted certificates as the CLI does; a [runner:warn] line gives the number left out
  • [VSCode] Added a notice on the microphone button when voice dictation stops by itself (15 seconds without recognized speech, or the 2-minute limit), saying why and that the text so far is kept
  • [VSCode] Fixed a long prompt expanded with Show more covering the whole chat panel: a pinned prompt is now capped at 40% of the panel and scrolls
  • [VSCode] Fixed part of a list item or table cell with LaTeX math pasting as a new list or table in rich text editors
  • [VSCode] Fixed dictation failing behind a TLS-inspecting proxy when NODE_EXTRA_CA_CERTS is set only in ~/.claude/settings.json; it now also follows CLAUDE_CODE_CERT_STORE
  • [VSCode] Changed the "still open somewhere else" notice to also cover a Claude process left over from an extension restart, which usually ends on its own within about 10 minutes
  • [VSCode] Changed voice dictation to filter its trusted certificates as the CLI does
  • [VSCode] Changed the extension's own requests to filter their trusted certificates as the CLI does, and to trust the NODE_EXTRA_CA_CERTS file named in the environment or in user settings
  • [Cloud sessions] Fixed the repository picker saying "No repositories match" while a search was still running; it now shows "Searching…" until the results arrive
  • [Cloud sessions] Fixed the "Waiting for a runner" status on self-hosted environments being cut off; with on-demand runners it now counts up from your last message and shows failed attempts
  • [Code Review] Added @claude review stop (also off and pause) to Code Review, ending an @claude review always subscription on a pull request without starting a new review
  • 添加了 /claude-api api-version,将 Claude API 代码迁移至 API 版本 2026-10-21
  • 为每次工具调用添加了 claude_code.safety_event OpenTelemetry 事件,涵盖权限规则、自动模式、安全检查、钩子或沙箱停止、提示或退回的情况
  • 修复了当设置 CLAUDE_CODE_DISABLE_1M_CONTEXT 且模型为带有 [1m] 后缀的别名(如 opus[1m])时,请求因找不到模型而失败的问题
  • 修复了 prompt-caching-scope beta 标头在自定义 ANTHROPIC_BASE_URL 网关和 Foundry 上被发送的问题,尽管在这些场景下该标头无效
  • 修复了在 macOS 上运行 claude -p 时,若登录密钥串处于锁定状态,MCP 服务器会显示“需要身份验证”的问题;现在会显示具体原因,且在解锁后的下次运行时无需重新登录即可连接
  • 修复了在 macOS 或 Linux 计算机进入睡眠状态期间 MCP 服务器正在连接时,服务器被报告为超时并在无头运行中保持失败状态的问题
  • 修复了 HTTP MCP 工具调用在调用中途关闭连接时被发送两次的问题;现在仅重试只读或幂等的工具
  • 修复了在后台任务运行时,有时会出现 SDK MCP 服务器的最新工具未加载即开始对话轮次的问题
  • 修复了在读取大量 PDF 页面、图像或其他大型工具结果的对话轮次中,偶尔出现“Autocompact is thrashing”错误的问题
  • 修复了云会话重启后,/autocompact 设置恢复为默认窗口大小的问题
  • 修复了使用 /clear 清除的对话在云或自托管运行器会话重启时有时会重新出现的问题
  • 修复了 Claude apps 网关会话中忽略 CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS 配置的问题
  • 修复了当设置 OTEL_EXPORTER_OTLP_HEADERS 时,来自 Claude apps 网关后方的 Claude Desktop 会话的遥测数据被拒绝的问题
  • 修复了 /permissions > Recently denied 未显示被拒绝的 shell 命令,以及自动模式的本地分类器在检查重试命令时忽略其中批准的问题;现在批准某行时会显示命令名称而非其描述
  • 修复了 /help 和 / 命令菜单对捆绑技能(如 /claude-api)显示面向模型的长描述而非简短描述的问题
  • 修复了子代理转录记录中流式响应占位符令牌用量和空停止原因的问题
  • 修复了当 API 确认模型耗时超过 5 秒时,通过 Agent SDK 的 setModel() 及其构建的应用程序进行的模型切换被拒绝的问题;Claude Code 现在最多等待 15 秒
  • 修复了通过连接的应用程序(例如桌面应用程序归档空闲会话)停止后台命令被报告为 Claude 认为由用户停止的问题;现在通知会指明其输出文件
  • 修复了在 Cowork 云会话中,当网站返回 4xx 状态码或拒绝 robots.txt 时 WebFetch 报告工具错误的问题;现在它像本地会话一样作为正常结果处理
  • 修复了在直接配置的 GitHub MCP 服务器上写入工具显示一个表单,该表单在未在桌面应用程序的 Code 标签页中创建任何内容的情况下关闭的问题
  • 修复了 Artifact 工具读取失败的问题,当服务器关闭了重用的连接时会出现连接重置错误
  • 自托管运行器:修复了使用 --use-anthropic-git-proxy 的会话提交由早期会话留在克隆目录中的 .claude/settings.local.json 文件的问题
  • 自托管运行器:修复了在签出钩子期间归档或重新排队会话、或停止运行器时,导致钩子进程仍在运行且运行器槽位被占用的问题
  • 改进了从无法解析的工具调用中恢复的能力:Claude Code 现在在结束轮次并报错之前最多重试两次调用
  • 改进了同时启动的分叉子代理:现在每个分叉都知道哪个启动是属于自己的,因此分叉尝试启动彼此工作的可能性大大降低
  • 改进了浏览器登录:登录完成后立即显示成功页面,无需等待账户配置文件加载
  • 改进了云和自托管运行器会话中的网络搜索错误:如果搜索因 403 被拒绝且提供了原因,现在会显示该原因而不是通用的“身份验证错误”
  • 改进了当桌面应用程序的一个 MCP 服务器无法连接时,云会话中首次回复的时间
  • 改进了包含大量粘贴图片或 PDF 读取记录的会话的 Remote Control 连接时间
  • 更改了当 WebSearch 预算用完时 Claude 收到的通知,还告知它不要在浏览器中或通过计算机使用查询搜索引擎
  • 更改了设置环境块中的 axScreenReader 设置和 CLAUDE_AX_SCREEN_READER,使其仅适用于用户、受管或 --settings 设置(自 2.1.305 版本起)
  • 自托管运行器:更改了默认情况下在 30 分钟后停止签出钩子的行为,这将导致会话设置失败;如果需要更长时间,请提高 --checkout-hook-timeout-min 的值或将其设置为 0
  • 自托管运行器:更改了为 Anthropic 管理的 git 构建的证书文件,使其像 CLI 一样过滤受信任的证书;[runner:warn] 行给出了被排除的数量
  • [VSCode] 当语音听写因自身原因停止时(15秒内未识别到语音,或达到2分钟上限),在麦克风按钮上添加了说明原因及保留已生成文本的通知
  • [VSCode] 修复了展开的长提示词使用“显示更多”功能时覆盖整个聊天面板的问题:固定提示词现在限制在面板高度的40%并支持滚动
  • [VSCode] 修复了在富文本编辑器中粘贴包含LaTeX数学公式的部分列表项或表格单元格时,被错误解析为新列表或表格的问题
  • [VSCode] 修复了仅在 ~/.claude/settings.json 中设置 NODE_EXTRA_CA_CERTS 时,通过TLS检查代理进行听写失败的问题;现在它也遵循 CLAUDE_CODE_CERT_STORE
  • [VSCode] 将“仍在别处打开”的通知范围扩展至涵盖由扩展重启遗留的Claude进程,该进程通常在约10分钟内自行结束
  • [VSCode] 更改语音听写以像CLI一样过滤其受信任证书
  • [VSCode] 更改扩展自身的请求以像CLI一样过滤其受信任证书,并信任环境变量或用户设置中指定的 NODE_EXTRA_CA_CERTS 文件
  • [Cloud sessions] 修复了搜索仍在进行时仓库选择器显示“无匹配的仓库”的问题;现在它在结果到达前显示“正在搜索…”
  • [Cloud sessions] 修复了自托管环境中“等待运行程序”状态被截断的问题;对于按需运行的运行程序,它现在从你的最后一条消息开始计数并显示失败的尝试
  • [Code Review] 向代码审查添加了 @claude review stop(以及 off 和 pause)命令,用于在不启动新审查的情况下终止拉取请求上的 @claude review 永久订阅

更进一步:量化金融体系

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

进入量化体系 →

关联讨论

同一事件的更多信源

相似阅读

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