跳到主内容
@wquguru
精选88OpenAI Codex CLI(GitHub Releases)AI 编程与模型

OpenAI Codex CLI Python SDK v0.154.0:破坏性变更

Python SDK 0.154.0

原文
发到 X
推荐理由

v0.154.0 包含多处破坏性变更(HookMetadata 重构、通知类型化、Turn Handle 行为改变),直接修改现有代码逻辑。请开发者在升级前务必检查迁移指南,调整 HookMetadata 访问方式并处理 Turn Handle 的事件边界问题。

Install with pip install --upgrade openai-codex==0.154.0 (Python 3.10 or later). This release includes the matching openai-codex-cli-bin==0.154.0 runtime.

使用 pip install --upgrade openai-codex==0.154.0 进行安装(需要 Python 3.10 或更高版本)。此版本包含配套的 openai-codex-cli-bin==0.154.0 运行时。

  • Add max and ultra reasoning-effort values. #39662
  • Add ExternalMessage to synchronous and asynchronous run() and turn() calls. External content can start a turn or join an active regular turn with tool-level authority; it does not grant user authorization. Consumers receive independent event streams. #44086
  • Add include_turns on resume/fork, turn_service_tier for one newly started turn, and source metadata. History selection changes the returned response, not model context. Existing defaults are preserved when these options are omitted. #44084
  • Refresh generated protocol models and notifications, and preserve completion events that arrive before a turn-start response. #44032, #44400
  • 添加 max 和 ultra 推理努力值。#39662
  • 在同步和异步的 run() 和 turn() 调用中添加 ExternalMessage。外部内容可以启动一个回合,或以工具级权限加入正在进行的常规回合;它不授予用户授权。消费者接收独立的事件流。#44086
  • 在恢复/分叉时添加 include_turns,为新启动的一个回合添加 turn_service_tier 和源元数据。历史记录选择更改返回的响应,而非模型上下文。当省略这些选项时,保留现有默认值。#44084
  • 刷新生成的协议模型和通知,并保留在回合开始响应到达之前完成的事件。#44032, #44400

Check these migrations when upgrading:

升级时请检查以下迁移:

  • HookMetadata wraps its handler in .root. Replace accesses such as hook.command with hook.root.command, checking hook.root.handler_type before reading handler-specific fields.
  • Some previously unknown notifications now have typed payloads. Read named fields instead of .params; unknown or invalid payloads still use UnknownNotification.
  • Manually constructed or late-joining turn handles receive events from their attachment point. Earlier output is not replayed, so collected results can be partial; attaching after completion can raise TransportClosedError. Use thread.read(include_turns=True) for saved history. Handles returned directly by thread.turn(...) retain events from when their request is sent.
  • HookMetadata 将其处理程序包装在 .root 中。将 hook.command 等访问方式替换为 hook.root.command,并在读取特定于处理程序的字段前检查 hook.root.handler_type。
  • 一些以前未知的通知现在具有类型化的有效载荷。请读取命名字段而不是 .params;未知或无效的有效载荷仍使用 UnknownNotification。
  • 手动构造或迟到的回合句柄从其附加点接收事件。不会重放之前的输出,因此收集的结果可能不完整;在完成之后附加可能会引发 TransportClosedError。请使用 thread.read(include_turns=True) 获取保存的历史记录。由 thread.turn(...) 直接返回的句柄保留其请求发送时的所有事件。

Custom codex_bin overrides require CLI 0.151.0 or newer for ExternalMessage and the new history/per-turn options.

自定义 codex_bin 覆盖需要 CLI 0.151.0 或更高版本以支持 ExternalMessage 以及新的历史/每回合选项。

更进一步:量化金融体系

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

进入量化体系 →

相似阅读

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