Repository navigation
fix: 修复 HTTP 历史恢复后搜索与生图工具转换引发的 409 - #867
Merged
Merged
Conversation
ranxi2001
marked this pull request as ready for review
November 15, 2026 14:47
Reuse the scoped fixture preparation from 194e8ac. Preserve the selected protocol assertions and all candidate tests.
12 tasks done
2 tasks done
8 of 12 tasks
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.
解决的问题与行为变化
启用 409 历史恢复后,HTTP 请求先冻结可读历史及工具控制字段,普通转发随后又清理搜索字段、规范化生图参数或追加生图工具与 instructions,导致发送前以 wire_changed 拒绝。本 PR 用实际鉴权 handler、Redis 和本机假上游复现这些路径,再将明确允许的转换提前到受保护的投影阶段。
已追加生产修复
28230e714:目标账号的搜索字段清理与生图控制字段转换在冻结投影前完成,后续兼容处理保持幂等;拒绝日志仅增加 input_changed / controls_changed 布尔值。固定旧实现 RED 与候选 HTTP 闭环 GREEN 已通过,7 个源快照/后续篡改防护用例也已通过,最终 head 的完整 CI 已通过。历史 WS 反例组装已追加修复a0474fbab:固定旧生产源码缺少后来的费用实现时,仅隔离对应独立费用测试,保留目标协议断言和全部候选测试。不会通过重算最终摘要或取消完整性校验掩盖未知变更。WS owner_conflict 由原 PR #866 跟进,本 PR 不声称解决全部线上 409。关联记录与来源
Refs #854、#865;相关 PR #855、#860、#866。基线 production
c115bef917eae22fc2f5a4d0ba6ac6cbe600e8e4;线上 2.21.40e8e97aa23afd8e88a61ea64a84a8fb84f1bfdc6。未引入外部仓库补丁。管理员新功能提示
提示 ID、登记项、NewFeatureBadge 展示位置、关闭行为及重新公告均不适用:修复既有请求路径,无新入口或设置。
复现与验收
虚构 A 完成一次 apply_patch 并交付历史后停止调度;同一客户端携带原工具和完成结果续接 B。覆盖 OAuth/API Key、JSON/SSE,以及 web_search.external_web_access、生图旧字段、自动生图桥接、显式剥离策略和组合场景。真实鉴权、调度、原生构造、Redis 交付屏障和 loopback provider 均参与;没有真实模型请求。
验收要求:同一测试在固定旧生产实现出现指定业务拒绝,在修复实现完成 B 验证和最终回答;patch 与验证各执行一次、工具定义保持、原 owner 不改写、旧 provider pointer 解除。测试位置 backend/internal/handler/openai_409_native_controls_test.go。专项 run 43724498116 已确认旧实现 18 条指定业务拒绝、2 条 API Key 搜索对照通过;候选的 20 条工具闭环均通过。7 个完整性防护用例也已通过;最终 head 的全部已触发检查已完成:71 项 success,46 项按条件 skipped。
授权定向采集补充:108 条完整的新 HTTP409 均确认客户端带 web_search.external_web_access、全部工具调用/结果配对、没有上游请求片段;其中精确关联的样本 journal 先省略历史,随后在 oauth_projection_source 拒绝。仅在服务器内分析结构,未复制客户正文;这支持复现输入的选择,不代替 CI 反例。
协议、调度或传输改动补充
HTTP /v1/responses,OAuth 与 API Key,stream true/false。保持鉴权、计费、账号准入、并发及交付确认;已发出的生成不自动重试。原有上游拒绝、取消和不确定交付边界继续适用。仅固定允许的投影变换,不记录业务正文或密文。
实际验证
a0474fbab:71 success、46 条件 skipped,无 pending/失败;已分页核对完整 checks。历史 WS 反例组装修复后重新通过兼容性与运行影响
文档与用户可见变化
已更新 docs/encrypted-history-409-beta.md 的转换与诊断说明;无 UI 改动,截图不适用。源码合并与生产安装分别报告。
Agent 使用声明
提交前自查