Claude Agent SDK TypeScript v0.3.302:fork子代理默认启用
v0.3.302
推荐理由
依赖 Claude Agent SDK 的开发者请注意:fork 子代理现已默认开启,可能改变并发执行行为;同时 API 拒绝响应的错误处理机制发生破坏性变更,建议检查相关调用逻辑并评估是否需要显式配置 permissionMode。
What's changed
变更内容
- Fixed structured output results delivering a response's output as structured_output when the API refused that response; the result is now an error with no payload
- Changed an omitted permissionMode to start in default mode on third-party providers, with telemetry off or on a fresh install; pass permissionMode: 'auto' to keep auto mode
- Changed fork subagents (subagent_type: "fork") to be on by default in SDK sessions, as in the terminal; run_in_background is still offered, and CLAUDE_CODE_FORK_SUBAGENT=0 turns them off
- Updated to parity with Claude Code v2.1.302
- 修复了结构化输出结果的问题:当 API 拒绝该响应时,不再将响应的输出作为 structured_output 交付;现在会返回一个无有效负载的错误
- 更改了第三方提供程序上省略的 permissionMode 的行为,使其在遥测关闭或全新安装时以默认模式启动;如需保持自动模式,请传递 permissionMode: 'auto'
- 在 SDK 会话中(与终端中一样)默认启用 fork 子代理(subagent_type: "fork");仍提供 run_in_background 选项,设置 CLAUDE_CODE_FORK_SUBAGENT=0 可将其关闭
- 已更新至与 Claude Code v2.1.302 保持一致
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]更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力