Repository navigation
fix: 修复 409 省略后回放元数据规范化导致的误拒绝 - #824
Merged
Merged
Conversation
2 of 8 tasks
This was referenced Nov 13, 2026
Merged
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 Beta 省略旧密文后会固定整个 input 的摘要,但 native HTTP 转发随后还会清理 reasoning.status、store:false reasoning ID/summary、无效条目 ID 等回放元数据。旧代码将这些确定性变换再次视为 wire_changed,导致已经省略的请求仍返回本地 409。
现在在省略成功后、固定完整性摘要之前,先进行与原规则一致的受限元数据规范化。之后仍按完整 input 校验;不在发送前覆盖摘要,不放宽工具参数/结果、消息顺序、可读内容和大整数保护。真正的 input 不一致记录固定阶段
input_integrity,不输出正文或摘要。本修复覆盖静态确认的规范化冲突。线上 6 条请求没有采集业务正文,尚不能认定它们全部命中同一变换;会删除整个 reasoning 或可读 reasoning.content 的处理仍拒绝,不能为了续接静默丢内容。
关联记录与来源
11f250894eab310cbd4508946c44c9e2a3a2eb48,已普通合入最新 production41669d30ae41c0b3f50b40e29b06945e701a13e1;head:fix/409-omission-wire-check-20261113。管理员新功能提示
提示 ID 与登记项:不适用;修复已有 Beta 行为,无新设置。
NewFeatureBadge 展示位置:不适用;原两个入口不变。
关闭行为:不适用;不改变已有隐藏状态。
ID 沿用 / 重新公告:沿用
openai-409-omit-encrypted-history-beta,普通修复不重新公告。必要回归:保留现有 SettingsView/设置 API 回归及 CI。
A→B 新提示可见:不适用,无新 ID。
多入口同步隐藏:不适用,无提示行为改动。
刷新/登录隐藏:不适用,无隐藏状态改动。
C 显示且旧提示不复活:不适用,无 ID 更换。
复现与验收
使用真实 handler、隔离 Redis 和 localhost HTTP fake upstream:A 完整交付虚构 agent,随后 A 不可调度;同 Key/组/会话的完整历史经 Beta 省略后交 B。新增独立变量为 store:false reasoning.id、reasoning.status、缺省 summary、无效 message.id、非配对 message.call_id;分别覆盖 JSON/SSE。假上游显式拒绝仍带非法回放元数据的请求,避免以任意响应成功掩盖协议错误。
验收:一次原始生产请求、恰好一次省略后续接,旧 owner 不变;reasoning 密文、可读任务、工具结果与精确整数保留。另验证改写用户文字/工具参数/输出/call_id/数组顺序/大整数、删除 reasoning/可读 reasoning.content 或重新注入 ID 仍被拒绝,send gate 不重设摘要。上游明确 400 原样失败,不重放。
协议、调度或传输改动补充
/v1/responses,新增端到端场景使用 OpenAI API Key + JSON/SSE;既有 OAuth/[Bug] 代理会话反复报 unsupported_encrypted_agent_message,已有任务无法继续 #715/[Feature] 增加可选开关,允许管理员关闭加密协作消息的强制账号归属绑定 #805/WS 路径回归继续执行。实际验证
当前候选
6d1b7048b10b4e2633cf415697cc0d59f17a8bc8,定向 CI 43299388500 已通过,原始日志已回读;完整 CI 当前 attempt 均已结束通过(条件任务 skipped)。历史 push attempt 1 的计时失败保留如下。/home/ranxi/projects/sub2api-409-wire-check-20261113:git diff --checkgo test -race -tags=unit ./internal/handler -run '^TestOpenAI409ReplayMetadataHTTP$' -count=1 -v -timeout=5m完整 CI 首次失败记录:push CI attempt 1。
TestWSKeyQueueWaitsThenTimesOutWithoutTicketLeak断言至少 200ms,实际 197.772164ms;原始 job 日志已读。该 WS 排队路径不经过本次省略逻辑,源码使用 Redis 时间与剩余预算的保守截止计算。另一套当前 head 单测已过,失败 workflow 的 attempt 2 已通过,原失败 check 作为历史保留;未降低断言、跳过用例或改动队列实现,保留这次计时失败边界。兼容性与运行影响
文档与用户可见变化
更新 docs/encrypted-history-409-beta.md 的元数据范围、完整性保证和拒绝诊断。没有 UI 改动;现有组件截图工作流保留。合并、发布、上线分开验收。
Agent 使用声明
gpt-6.1-sol,推理强度未知(运行环境未公开)。子 Agent审查固定源码及12例远程RED/GREEN原始日志,父级核对生产diff、完整checks/statuses/current-attempt jobs、模板及最新base。限定源码CLEAR,不代表线上业务恢复。提交前自查
维护合并前核验(2026-11-13 UTC+8)
固定候选
6d1b7048b10b4e2633cf415697cc0d59f17a8bc8。最新 productionc424f8217da12cd4fb8d10aeaf1c4f2592c3f286与候选通过只读 merge-tree,无冲突;base 新增VIP收款文件不与本次6文件重叠。全量filter=allcheck-runs 92 项,含1项已被同run attempt 2成功替代的历史失败;0项传统statuses。当前全部workflow/job结束成功或条件跳过,未绕过当前失败。独立源码审查CLEAR。#823保留开放,实际部署及线上省略→发送→终态未验收;本次仅源码合并,不发版或部署。