feat(prism): bridge 6.1 Sol client tools and Responses events - #278
Merged
Merged
Conversation
ranxi2001
marked this pull request as ready for review
October 2, 2026 15:17
This was referenced Oct 2, 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.
问题与行为变化
在已开启 Prism 的 OAuth 账号上,
gpt-6.1-sol文本已经可用,但客户端携带tools、additional_tools或工具结果时适配器仍返回 422;Go 网关也只接受文本终态。这个 PR 同时补充客户端工具桥和 Responses 工具事件校验,使工具仍由客户端在其权限系统下执行。默认关闭,服务端
PRISM_ADAPTER_CLIENT_TOOLS_ENABLED=true后试用;本轮工具模型固定gpt-6.1-sol。其他三个模型保留原文本路径。必须同时升级 Go 网关与适配器,不要求用户修改 Codex 请求或增加私有头。关联与来源
Refs #256,承接已合并 #269。从 owner production 开发,已整合最新 production 的 Key 撤销与删除后结算修复;保留原提交。
参考 issue #256 的工具权限、start/status、turn_state 和未知结局不可重放结论。对照官方 Responses function/custom/namespace 协议独立实现;未复制没有明确许可证的 oai-prism 源码,未复用其裸 shell 自动包装路径。
验收与边界
工具回合保留同一客户端会话的锁和 pending 作用域,但每次使用新的 Prism 空白项目,避免原生复用页面第三轮无法就绪。本轮采用完整历史续接;不支持 previous_response_id、工具图片结果、主动终止上游生成、未知回合自动恢复、持久化完整会话或 WebSocket。响应仍缓冲到上游终态,不宣称逐 token 流或实时心跳。Hosted 工具不能由本桥执行:有客户端工具时,在提示和响应 metadata 明确列出不可用类型;只有 hosted 工具或强制选择它们时拒绝。
实际验证
smoke_client_tools.pyTestPrismBrowser / TestPrismClientTool / TestPrismCaller / TestAccountUsesPrism通过,覆盖凭据边界、调用方头不可伪造、命名空间、工具终态、SSE 参数与 item 冲突。4376ef590的 push/PR 两组完整 CI 均通过:16 项 SUCCESS、2 项 CLA SKIPPED,无失败或待运行检查;此前66991304c修复两处 errcheck。真实 Codex CLI 0.156.1 也已通过本地模拟上游的 function/custom 工具事件与客户端执行闭环,CLI 无需改代码;这不等于完整生产 Go 通道已经上线。
配置、资源与回滚
tools/v1.sqlite3,0600、父目录0700;不修改 PostgreSQL schema。记录上限50000,未知占用不会自动删除。X-Prism-Caller-ID,外部同名头不参与计算。原 OAuth 出口隔离、禁止重定向保持。文档
prism-adapter/README.md记录试用开关、协议语义、资源上限、数据保存及未支持范围。本 PR 不新增 UI 组件。Agent 使用声明