Skip to content

fix(openai): preserve session bindings during image account fallback - #769

Merged
zyycn merged 1 commit into
mainfrom
fix/images-session-fallback
Nov 23, 2026
Merged

zyycn merged 1 commit into
mainfrom
fix/images-session-fallback

Conversation

@zyycn

@zyycn zyycn commented Nov 23, 2026

Copy link
Copy Markdown
Owner

问题与改动

严格账号亲和下,聊天绑定 A,而只有 B 能处理请求的图片模型。原生 Images 已按模型权限筛出 B,但根会话生图会把聊天绑定也迁到 B,子会话改图则可能一直等 A。已有的模型资格筛选见 #374。

现在,主账号仍在 Key 的授权池内、但未通过本次 Images 的模型、套餐或协议筛选时,根会话和子会话都可以临时用 B。B 必须位于允许该模型的启用分组内,且自己的模型规则也允许。请求完成后,下一轮聊天继续使用 A。主账号能生图但暂时繁忙时,严格子会话仍按原规则等待。

自审与验证

选号复用 OpenAI Provider 现有的候选过滤和账号租约。取得 B 的租约后,按选号时读到的版本续期 A 的绑定;若绑定已被其他请求更新,则释放租约并重新选号。显式固定账号仍受原有约束。

  • 本地 HTTP 模拟上游核对了实际请求头。聊天走 A,生成与子会话编辑走 B,两个图片请求后的聊天都回到 A。另一个权重更高、账号黑名单禁了图片模型的候选没有收到图片请求。
  • OpenAI Provider 与凭据合同测试 423 项、Core 分组权限与策略快照测试 3 项全部通过。Rustfmt、Clippy(-D warnings)和 git diff --check 通过。
  • 验证使用模拟上游。分组和账号都配置为「允许全部」时,转发商实际开放哪些模型仍由上游决定。

AI 使用

使用 Codex(gpt-6.2-astra)核实调度行为、实现修复、编写测试和文档,并完成自审。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T03:49:55.755670Z a56b58a PR opened
🔒 Security Review ✅ Completed 2026-11-23T03:53:04.026938Z a56b58a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@zyycn
zyycn merged commit 5fced66 into main Nov 23, 2026
10 checks passed
@zyycn
zyycn deleted the fix/images-session-fallback branch November 23, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant