feat(codex): complete phase-one runtime compatibility - #757
Merged
Conversation
yaozheng-fang
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
主要修改
把 Codex 的 Reasoning、Command、File Patch、MCP、Plan、Approval、Error、Turn Complete、Token Usage 等事件转换为 ADK Event,供 Session、Trace、UI 和 Evaluation 使用。
Function Tool、MCP Tool、BaseTool、Python callable 统一通过 ADK 工具执行流程运行,保留工具调用/结果事件、回调、状态更新、EventActions 和 telemetry。
补齐工具确认、凭证请求、跨 Turn 恢复和 long-running pending。确认前不执行副作用,恢复时避免重复执行。
Responses Shim 改为 invocation token 路由,不同请求不再共享当前工具表;Session workspace、CODEX_HOME 和工具上下文相互隔离。
默认使用 workspace_write、禁止网络、拒绝提权;敏感环境变量不会传给 Codex 子进程;TOML 配置做了转义,危险权限必须显式开启。
动态 Instruction 通过原生 developer instruction 传入;会话历史改为结构化格式并保留工具轨迹;支持图片、文件和 mention,同时过滤鉴权凭证及内部事件。
补齐工具超时、取消、非法 JSON、工具循环上限、SDK 错误、Turn 中断,以及 MCP session、临时目录、Shim token 的异常清理。
新增 Codex 核心测试与 SDK 合约测试;日志统一使用 codex_* 事件名,包含 invocation、call、status、耗时和 Token Usage,并验证不会泄露参数、结果、密钥和凭证。
验证
说明
未运行真实付费模型的联网 E2E;该部分保留为发布前 Smoke Test。