跳到主内容
@wquguru
精选88Claude Agent SDK TypeScript(GitHub Releases)AI 编程与模型

Claude Agent SDK TypeScript v0.3.287:MCP工具截断与WebFet

v0.3.287

原文
发到 X
推荐理由

MCP 大响应截断与 WebFetch 分离机制属破坏性变更,直接改变现有解析逻辑。请检查对 tool_use_result 的处理代码,确保兼容新字段与超时行为。

What's changed

变更内容

  • Added optional remote-session latency fields (first_text_post_queue_wait_ms, first_text_post_queued_behind) to the success result message
  • Fixed includePartialMessages streams sending a cut-short reply's message_stop late or never, so apps could show the reply as still in progress
  • Fixed the error for a revoked claude.ai login, which now reads "Failed to authenticate: OAuth token revoked" instead of a generic or "does not have access" message
  • Fixed a tool call to an in-process MCP server being left waiting after toggleMcpServer() disabled the server or setMcpServers() removed it
  • Fixed commands_changed arriving before init, or twice, at session start: the initialize response now includes commands registered at startup
  • Changed tool_use_result for a WebFetch or WebSearch call that steps aside for a priority "now" message to { detachedToolCall: true }; the result follows in a later turn
  • Changed tool_use_result for MCP tools: structuredContent over 1,048,576 JSON characters is left off and structuredContentOmitted: true set, except for SDK-server and MCP Apps tools
  • Updated to parity with Claude Code v2.1.287
  • 在成功结果消息中添加了可选的远程会话延迟字段(first_text_post_queue_wait_ms、first_text_post_queued_behind)
  • 修复了 includePartialMessages 流发送截断回复时 message_stop 延迟或从未发送的问题,这可能导致应用显示回复仍处于进行中状态
  • 修复了 claude.ai 登录被撤销时的错误提示,现在显示为“Failed to authenticate: OAuth token revoked”,而非通用的错误或“does not have access”消息
  • 修复了在 toggleMcpServer() 禁用服务器或 setMcpServers() 移除服务器后,针对进程内 MCP 服务器的工具调用仍保持等待状态的问题
  • 修复了 commands_changed 在会话开始时出现在 init 之前或重复出现两次的问题:initialize 响应现在包含启动时注册的命令
  • 当 WebFetch 或 WebSearch 调用因优先级为“now”的消息而让路时,tool_use_result 更改为 { detachedToolCall: true };结果将在后续轮次中返回
  • 更改了 MCP 工具的 tool_use_result:对于超过 1,048,576 个 JSON 字符的 structuredContent 将被省略,并设置 structuredContentOmitted: true,SDK-server 和 MCP Apps 工具除外
  • 更新以与 Claude Code v2.1.287 保持一致

Update

更新

代码 · 7 行
npm install @anthropic-ai/[email protected]
# or
yarn add @anthropic-ai/[email protected]
# or
pnpm add @anthropic-ai/[email protected]
# or
bun add @anthropic-ai/[email protected]

更进一步:量化金融体系

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

进入量化体系 →

相似阅读

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