OpenAI Agents SDK v0.20.0:默认模型改 GPT-5.6 Luna
v0.20.0
推荐理由
OpenAI Agents SDK 是 AI 编程与模型开发的核心工具,本次默认模型变更和 MCP 依赖迁移可能影响现有应用,建议开发者检查自定义 MCP HTTP 传输并迁移到 httpx2 或固定 mcp<2。
Key Changes
主要变更
Version 0.20.0 is a minor release because it changes the implicit default model and includes a potentially breaking MCP dependency migration for applications with customized local HTTP transports. MCP v1 remains supported, and affected applications can migrate to httpx2 or pin mcp<2.
版本 0.20.0 是一个次要版本,因为它更改了隐式默认模型,并包含一个可能破坏性的 MCP 依赖迁移,影响具有自定义本地 HTTP 传输的应用程序。仍支持 MCP v1,受影响的应用程序可以迁移到 httpx2 或将 mcp 固定为 <2。
Highlights:
亮点:
- The default model is now gpt-5.6-luna; explicit models, run-level overrides, and OPENAI_DEFAULT_MODEL continue to take precedence.
- Local MCP connections support MCP Python SDK v1 and v2 across stdio, SSE, and Streamable HTTP transports.
- Applications using custom MCP HTTP authentication or client factories must use the HTTP types owned by the installed MCP major version, or pin mcp<2.
- RunState.add_input() can stage durable user input before a resumed model call, with guardrail, persistence, and serialization support.
- Sandbox mount validation adds explicit credential-exposure acknowledgements and preserves redacted error contracts without serializing credential authority.
- Realtime input transcription supports the GA transcription settings for gpt-live-transcribe, gpt-transcribe, and gpt-realtime-whisper.
- 默认模型现在是 gpt-5.6-luna;显式模型、运行级覆盖和 OPENAI_DEFAULT_MODEL 继续优先。
- 本地 MCP 连接支持 MCP Python SDK v1 和 v2,涵盖 stdio、SSE 和 Streamable HTTP 传输。
- 使用自定义 MCP HTTP 认证或客户端工厂的应用程序必须使用已安装的 MCP 主版本所拥有的 HTTP 类型,或将 mcp 固定为 <2。
- RunState.add_input() 可以在恢复模型调用之前暂存持久用户输入,并支持护栏、持久化和序列化。
- 沙箱挂载验证增加了显式的凭据暴露确认,并保留编辑后的错误契约,而不序列化凭据授权。
- 实时输入转录支持 gpt-live-transcribe、gpt-transcribe 和 gpt-realtime-whisper 的 GA 转录设置。
What's Changed
变更内容
- feat: use GPT-5.6 Luna as the default model by @seratch in #4282
- feat: add durable pending input to RunState by @seratch in #4325
- feat(mcp): support MCP Python SDK v1 and v2 by @seratch in #4106
- feat(sessions): pass run context to custom sessions by @seratch in #4209
- feat(realtime): support GA transcription options by @seratch in #4351
- feat: preserve raw usage payloads by @seratch in #4279
- feat: allow applications to approve unsafe replays by @seratch in #4319
- fix: falsy optional reference handling by @seratch in #4305
- fix: prevent queue consumer deadlocks by @seratch in #4201
- fix: publish completed streamed guardrail results on failure paths by @adityasingh2400 in #4223
- fix: annotate the bare tool guardrail decorator overloads by @adityasingh2400 in #4238
- fix: tool approval is not honored on resume when Runner.run is given a context by @ojassharma7 in #4245
- fix: redact JSON validation errors by @seratch in #4211
- fix: copy raw_responses when building a RunState by @adityasingh2400 in #4237
- fix: keep empty turns in the nested conversation history by @abhay-codes07 in #4230
- fix: keep tool guardrail results when a resumed run interrupts again by @adityasingh2400 in #4239
- fix: work on copies of the lists a resumed run adopts from RunState by @hsusul in #4251
- fix: strip placeholder item IDs without provider_data on the Responses path by @LeSingh1 in #4266
- fix: bind tool approvals to concrete invocations by @seratch in #4257
- fix: normalize optional fields in tool invocation identity by @seratch in #4289
- fix: count requests when providers omit usage by @seratch in #4290
- fix: suppress pydantic serializer warnings by @seratch in #4291
- fix: keep FunctionTool subclasses copyable by @seratch in #4311
- fix: preserve streamed guardrail session state by @seratch in #4312
- fix: keep acknowledged safety checks serializable after restore by @ribhavjain in #4316
- fix: preserve default-valued fields in serialized tool output by @hsusul in #4307
- fix: strip output-only created_by when replaying model output as input by @hsusul in #4308
- fix: preserve local shell outputs across RunState resume by @seratch in #4320
- fix: serialize containers of models and dataclasses as structured data by @ribhavjain in #4339
- fix: reject schemas that exceed safe recursion depth by @seratch in #4358
- fix: reject unsafe strict-schema ref siblings by @seratch in #4356
- fix(sandbox): reject unsafe mount credential configurations by @seratch in #4255
- fix(extensions): settle snapshot directory mount transitions for Modal by @seratch in #4315
- fix(sandbox): preserve sandbox error contracts during mount redaction by @seratch in #4344
- feat(sandbox): add explicit mount credential exposure acknowledgements by @seratch in #4321
- fix(sandbox): cancel sibling env resolvers when one fails by @PranavMishra28 in #4195
- fix(sandbox): encode Blaxel terminal WebSocket URL query values by @abhay-codes07 in #4217
- fix(sandbox): stop splitting Cloudflare SSE events at chunk boundaries by @abhay-codes07 in #4215
- fix(sandbox): keep move_to when coercing apply_patch operation mappings by @hsusul in #4242
- fix(sandbox): retain program items in memory rollouts by @seratch in #4276
- fix(sandbox): restore archived file modes when extracting a workspace tar by @hsusul in #4287
- fix(sandbox): keep source entry metadata when lazily loading a skill by @hsusul in #4294
- fix(mcp): hosted MCP approval identity by @seratch in #4256
- fix(mcp): keep MCP error content when structured output is enabled by @adityasingh2400 in #4224
- fix(mcp): build the active server list without re-consuming the iterable by @adityasingh2400 in #4235
- fix(mcp): preserve free-form MCP object schemas by @seratch in #4310
- fix(mcp): serialize non-text content blocks as JSON instead of Python repr by @ribhavjain in #4338
- fix(mcp): serialize manager lifecycle operations by @seratch in #4340
- fix(mcp): bound lifecycle and CI waits by @seratch in #4342
- fix(chat-completions): keep url citations when converting chat completions output by @adityasingh2400 in #4222
- fix(chat-completions): assemble chat completions content parts in content index order by @adityasingh2400 in #4236
- fix(chat-completions): propagate the OpenAI request ID on the Chat Completions path by @hsusul in #4243
- fix(chat-completions): keep url citations on the streamed chat completions path by @Luccacvb in #4252
- fix(chat-completions): announce the chat completions assistant message once by @hsusul in #4275
- fix(chat-completions): convert input_file items that reference a file_id on the Chat Completions path by @hsusul in #4295
- fix(chat-completions): raise on audio output in the streamed chat completions path by @Luccacvb in #4309
- fix(chat-completions): omit parallel_tool_calls without tools on the Chat Completions path by @Luccacvb in #4359
- fix(sessions): release SQLite engine config entries when engines are collected by @adityasingh2400 in #4210
- fix(sessions): enforce closed state on SQLite session empty add_items by @adityasingh2400 in #4231
- fix(sessions): make session mutations atomic by @seratch in #4212
- fix(sessions): preserve required program item ids for OpenAI conversations by @hsusul in #4253
- fix(sessions): apply the reasoning item id policy to stored session history by @LeSingh1 in #4278
- fix(sessions): preserve DaprSession created_at across writes by @adityasingh2400 in #4213
- fix(sessions): strip placeholder item IDs before Conversations persistence by @hsusul in #4288
- fix(sessions): preserve falsey compaction decision hooks by @hsusul in #4299
- fix(sessions): restore session history when compaction replacement is cancelled by @nothariharan in #4298
- fix(sessions): prune orphaned tool outputs from limited sessions by @seratch in #4324
- fix(realtime): apply tool call item updates to session history by @hsusul in #4284
- fix(realtime): preserve falsey custom models by @hsusul in #4286
- fix(realtime): compute G.711 audio length for typed and mapping format spellings by @abhay-codes07 in #4292
- fix(voice): forward TTSModelSettings.speed to the OpenAI speech API by @adityasingh2400 in #4220
- fix(voice): keep the word separator when flushing streamed sentences by @abhay-codes07 in #4227
- fix(voice): start the dispatcher when a session ends with no turns by @adityasingh2400 in #4259
- fix(voice): report transcription session close failures to the consumer by @Luccacvb in #4343
- fix(tracing): release the trace scope when a generator is closed by @adityasingh2400 in #4221
- fix(tracing): release the span scope when a generator is closed by @adityasingh2400 in #4233
- 功能:使用 GPT-5.6 Luna 作为默认模型,由 @seratch 在 #4282 中实现
- 功能:向 RunState 添加持久待处理输入,由 @seratch 在 #4325 中实现
- 功能(mcp):支持 MCP Python SDK v1 和 v2,由 @seratch 在 #4106 中实现
- 功能(sessions):将运行上下文传递给自定义会话,由 @seratch 在 #4209 中实现
- 功能(realtime):支持 GA 转录选项,由 @seratch 在 #4351 中实现
- 功能:保留原始使用情况负载,由 @seratch 在 #4279 中实现
- 功能:允许应用程序批准不安全的重放,由 @seratch 在 #4319 中实现
- 修复:处理假值可选引用,由 @seratch 在 #4305 中实现
- 修复:防止队列消费者死锁,由 @seratch 在 #4201 中实现
- 修复:在失败路径上发布已完成的流式护栏结果,由 @adityasingh2400 在 #4223 中实现
- 修复:注释裸工具护栏装饰器重载,由 @adityasingh2400 在 #4238 中实现
- 修复:当 Runner.run 给定上下文时,恢复时工具批准不被遵守,由 @ojassharma7 在 #4245 中实现
- 修复:编辑 JSON 验证错误,由 @seratch 在 #4211 中实现
- 修复:构建 RunState 时复制 raw_responses,由 @adityasingh2400 在 #4237 中实现
- 修复:由 @abhay-codes07 在 #4230 中保留嵌套对话历史中的空轮次
- 修复:由 @adityasingh2400 在 #4239 中在恢复运行再次中断时保留工具护栏结果
- 修复:由 @hsusul 在 #4251 中对恢复运行从 RunState 采用的列表副本进行操作
- 修复:由 @LeSingh1 在 #4266 中在 Responses 路径上剥离没有 provider_data 的占位符项目 ID
- 修复:由 @seratch 在 #4257 中将工具审批绑定到具体调用
- 修复:由 @seratch 在 #4289 中规范化工具调用身份中的可选字段
- 修复:由 @seratch 在 #4290 中在提供商省略使用情况时计数请求
- 修复:由 @seratch 在 #4291 中抑制 pydantic 序列化器警告
- 修复:由 @seratch 在 #4311 中保持 FunctionTool 子类可复制
- 修复:由 @seratch 在 #4312 中保留流式护栏会话状态
- 修复:由 @ribhavjain 在 #4316 中在恢复后保持已确认的安全检查可序列化
- 修复:由 @hsusul 在 #4307 中在序列化工具输出中保留默认值字段
- 修复:由 @hsusul 在 #4308 中在将模型输出重放为输入时剥离仅输出的 created_by
- 修复:由 @seratch 在 #4320 中在 RunState 恢复时保留本地 shell 输出
- 修复:由 @ribhavjain 在 #4339 中将模型和数据类的容器序列化为结构化数据
- 修复:由 @seratch 在 #4358 中拒绝超过安全递归深度的模式
- 修复:由 @seratch 在 #4356 中拒绝不安全的严格模式引用兄弟节点
- 修复(沙箱):由 @seratch 在 #4255 中拒绝不安全的挂载凭证配置
- 修复(扩展):由 @seratch 在 #4315 中为 Modal 确定快照目录挂载转换
- 修复(沙箱):由 @seratch 在 #4344 中在挂载编辑期间保留沙箱错误契约
- 功能(沙箱):由 @seratch 在 #4321 中添加显式挂载凭证暴露确认
- 修复(沙箱):由 @PranavMishra28 在 #4195 中当一个环境解析器失败时取消兄弟环境解析器
- 修复(沙箱):由 @abhay-codes07 在 #4217 中对 Blaxel 终端 WebSocket URL 查询值进行编码
- 修复(沙箱):由 @abhay-codes07 在 #4215 中停止在块边界拆分 Cloudflare SSE 事件
- 修复(sandbox):在强制转换 apply_patch 操作映射时保留 move_to,由 @hsusul 在 #4242 中提出
- 修复(sandbox):在内存回放中保留程序项,由 @seratch 在 #4276 中提出
- 修复(sandbox):解压工作区 tar 时恢复归档文件模式,由 @hsusul 在 #4287 中提出
- 修复(sandbox):懒加载技能时保留源条目元数据,由 @hsusul 在 #4294 中提出
- 修复(mcp):托管 MCP 审批身份,由 @seratch 在 #4256 中提出
- 修复(mcp):启用结构化输出时保留 MCP 错误内容,由 @adityasingh2400 在 #4224 中提出
- 修复(mcp):构建活动服务器列表而不重新消费可迭代对象,由 @adityasingh2400 在 #4235 中提出
- 修复(mcp):保留自由格式的 MCP 对象模式,由 @seratch 在 #4310 中提出
- 修复(mcp):将非文本内容块序列化为 JSON 而不是 Python repr,由 @ribhavjain 在 #4338 中提出
- 修复(mcp):序列化管理器生命周期操作,由 @seratch 在 #4340 中提出
- 修复(mcp):限制生命周期和 CI 等待时间,由 @seratch 在 #4342 中提出
- 修复(chat-completions):转换聊天补全输出时保留 URL 引用,由 @adityasingh2400 在 #4222 中提出
- 修复(chat-completions):按内容索引顺序组装聊天补全内容部分,由 @adityasingh2400 在 #4236 中提出
- 修复(chat-completions):在聊天补全路径上传播 OpenAI 请求 ID,由 @hsusul 在 #4243 中提出
- 修复(chat-completions):在流式聊天补全路径上保留 URL 引用,由 @Luccacvb 在 #4252 中提出
- 修复(chat-completions):仅宣布一次聊天补全助手消息,由 @hsusul 在 #4275 中提出
- 修复(chat-completions):在聊天补全路径上转换引用 file_id 的 input_file 项,由 @hsusul 在 #4295 中提出
- 修复(chat-completions):在流式聊天补全路径上对音频输出引发异常,由 @Luccacvb 在 #4309 中提出
- 修复(chat-completions):在聊天补全路径上在没有工具时省略 parallel_tool_calls,由 @Luccacvb 在 #4359 中提出
- 修复(sessions):当引擎被回收时释放 SQLite 引擎配置条目,由 @adityasingh2400 在 #4210 中提出
- 修复(sessions):在 SQLite 会话空 add_items 上强制关闭状态,由 @adityasingh2400 在 #4231 中提出
- 修复(sessions):使会话变更原子化,由 @seratch 在 #4212 中提出
- 修复(sessions):为 OpenAI 对话保留必需的程序项 ID,由 @hsusul 在 #4253 中提出
- 修复(sessions):将推理项 ID 策略应用于存储的会话历史,由 @LeSingh1 在 #4278 中提出
- 修复(会话):在写入时保留 DaprSession 的创建时间,由 @adityasingh2400 在 #4213 中提出
- 修复(会话):在持久化 Conversations 前剥离占位符项目 ID,由 @hsusul 在 #4288 中提出
- 修复(会话):保留虚假的压缩决策钩子,由 @hsusul 在 #4299 中提出
- 修复(会话):当压缩替换被取消时恢复会话历史,由 @nothariharan 在 #4298 中提出
- 修复(会话):从有限会话中清除孤立的工具输出,由 @seratch 在 #4324 中提出
- 修复(实时):将会话历史中的工具调用项目更新应用,由 @hsusul 在 #4284 中提出
- 修复(实时):保留虚假的自定义模型,由 @hsusul 在 #4286 中提出
- 修复(实时):计算 G.711 音频长度,支持类型化和映射格式拼写,由 @abhay-codes07 在 #4292 中提出
- 修复(语音):将 TTSModelSettings.speed 转发到 OpenAI 语音 API,由 @adityasingh2400 在 #4220 中提出
- 修复(语音):刷新流式句子时保留单词分隔符,由 @abhay-codes07 在 #4227 中提出
- 修复(语音):当会话无轮次结束时启动调度器,由 @adityasingh2400 在 #4259 中提出
- 修复(语音):向消费者报告转录会话关闭失败,由 @Luccacvb 在 #4343 中提出
- 修复(追踪):当生成器关闭时释放追踪范围,由 @adityasingh2400 在 #4221 中提出
- 修复(追踪):当生成器关闭时释放跨度范围,由 @adityasingh2400 在 #4233 中提出
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力