mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-18 16:06:47 +00:00
refactor(openai): forward turn state from the current request
Keep the client responsible for echoing turn state across requests. Scope WebSocket opening state to the first request and retain account isolation when moving a request to another account. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
+3
-3
@@ -542,9 +542,9 @@ Images 的 `x-codex-image-turn-id` 和 Desktop 自动 Git 上下文的 `clientUs
|
||||
续接 response ID、历史 item/call ID、业务正文和未知扩展不参与映射,
|
||||
该处理减少显式追踪标识的跨账号复用,不保证会话内容或业务 metadata 无法关联
|
||||
|
||||
`x-codex-turn-state` 是上游返回的轮次路由 token,同一轮内应原样回传,开始新轮次时清除。
|
||||
全量请求没有 `previous_response_id` 或缺少本地归属记录时,代理原样保留客户端回传值;
|
||||
明确换账号或可信续接状态表明不属于同一轮时清除。该 token 不使其他账号状态字段或未知 `previous_response_id` 成为可信续接上下文
|
||||
`x-codex-turn-state` 是上游签发的轮次路由 token。客户端在同一轮原样回传,新轮次省略。
|
||||
网关转发当前请求提供的值,明确换账号时清除。WS 握手携带的值只用于首次请求,当前帧提供的值优先。
|
||||
续接 response ID 及其他账号状态的归属独立校验
|
||||
|
||||
#### 正文兼容
|
||||
|
||||
|
||||
@@ -546,9 +546,8 @@ OpenAI Provider 按 Client Key、所选 OAuth 账号和父响应 ID 关联 WS
|
||||
连接池按快照身份隔离审查连接;复用父连接不会重新计算 Cookie 有效期,Cookie 到期不强制关闭已建立的审查连接
|
||||
|
||||
OpenAI OAuth 的连接、续接状态、Guardian 路由 Cookie 和头像缓存按本地账号、上游用户与工作区隔离,同号令牌续期不改变归属。
|
||||
OpenAI Provider 统一处理 Responses 的账号归属与 turn state 隔离,HTTP 与 WS 消费同一出站请求。
|
||||
全量请求缺少本地归属记录时保留客户端回传的路由 token,明确换号或可信续接状态不属于同一轮时清除;
|
||||
turn state 不参与选号,也不授权其他账号状态或 response ID 的复用
|
||||
Responses 的轮次路由 token 由客户端回传,OpenAI Provider 只在明确换号时清除。
|
||||
选号和 response ID 的归属校验独立于该 token
|
||||
|
||||
### 账号协议与字段适配
|
||||
|
||||
|
||||
Reference in New Issue
Block a user