Repository navigation
fix: 修复 OAuth 历史重建时工具转换导致的 409 - #961
Merged
Merged
Conversation
The residual ws-ticket RED compiles unrelated service tests against baseline 94bb4a5. The raw job 136166449283 log reports seven compile diagnostics for Candy APIs absent from that production overlay. Use the existing candidate-content-checked shared manifest to restore the baseline 429 and validation fixtures and omit the baseline-absent Candy fixture. These tests cover degradation policy, not the selected WS residual/ticket oracles. The shared helper remains their sole owner and handles repeat invocations idempotently. Production bytes, selected assertions, candidate GREEN and contamination validation are unchanged. Validation: static source/log inspection and git diff --check only. No local tests, installs, lint, typecheck or build; dynamic gates remain remote CI. Agent: Codex; scope: diagnosis and fixture manifest repair. Model: GPT-6; exact model ID and reasoning effort unknown because metadata is not exposed. No subagents used for this repair.
8 tasks done
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.
解决的问题与行为变化
HTTP OAuth 请求重建可读历史后,Codex 转换还可能补历史搜索声明,或迁移旧式函数及其选择。发送前的完整性检查会将这些合法转换判为 409。现在从已校验的输入生成对应的 OAuth 快照,历史搜索补声明仅接受不会开放新工具调用的情况,最终发送仍核对工具、指令、输入和会话指针。旧式强制函数失配、同义字段冲突仍拒绝。
关联记录与来源
Refs #854, #951。基于本仓库
production提交0591a2064。源码与测试均在本仓库修改。v2.23.1 的线上诊断显示 OAuth 快照中 tools 和 tool_choice 同时发生变化,原请求未采集,无法从这两个标记判断是哪种转换。管理员新功能提示
复现与验收
在已启用可读历史重建的 OAuth Responses 路径,构造历史 web_search_call、当前 tools 为空的请求,或以 functions/function_call 指定一个已有函数。#951 的合成用例记录了前一种请求在最终校验返回 controls_integrity 的现象。验收时,历史补声明应保留 none,旧式名称选择应保留目标函数。快照产生后的控制字段变化仍应拒绝。
协议、调度或传输改动补充
服务测试覆盖标准 HTTP、Lite、compact、原始声明变化、最终工具变化和选择限制。handler 测试使用 /v1/responses、虚构 OAuth 账号和回环 HTTP 上游,统计重建后的发送次数。上游拒绝样例要求单次到达且不重试,成功样例检查后续工具调用与完成。用例覆盖 HTTP 重建,本 PR 未处理 WS owner_conflict。继续沿用原有状态码、用量、重试、调度、取消与流处理。
实际验证
git diff --checkgo test -race -tags=unit,httpprojection ./internal/service ./internal/handler -run '^TestOpenAI409(NativeControlsIntegrity|NativeControlsOAuthToolHistory|OAuthReplayDiagnosesWebSearchHistoryProjection|OAuthReplayToolPolicies)$' -count=1 -v -timeout=5m兼容性与运行影响
配置、数据库、权限和凭据无变更。普通 Codex 请求沿用既有旧式函数转换。存在旧式工具别名时将其纳入请求内完整性比较。无持久化迁移,新鲜请求随二进制回滚;旧版本可能再次出现相同 409。未增加日志内容、网络调用或计费动作。对照生产的具体原始输入仍不可用。
文档与用户可见变化
已开启历史重建的调用方继续使用原端点和参数,无需配置。此 PR 涉及后端行为,无 UI 或截图。
Agent 使用声明
Codex 参与源码分析、实现、回归与 PR 正文。完整模型 ID、推理强度未知(会话未提供可核实的运行参数)。原实现未使用子 Agent。
2026-11-20 独立复核补充
turn_context均核实为gpt-6.1-sol/ultra;fast 仅 requested,交付 tier 未确认。原实现 Agent 的未知参数保持未知,不以本次审查参数代替。gpt-6.1-sol,推理强度未知(当前运行环境未暴露)。2b71d868e989ecbc9b8063a020f5c8ddd3c799d3:源摘要验证 → 旧式函数投影 → search 声明 → 最终发送完整性检查,结论 SOURCE_CLEAR。git diff --check通过;未运行本地项目动态检查。78e2d6e4f0750c69c889abe2e39af663626cb7be仅增加 PR fix: 账号列表按美元汇率展示和排序 New API 声明倍率 #960,与本 PR 修改路径无交集;只读git merge-tree --write-tree无冲突。CI 修复与当前验收状态
802fca4cc06274a5bcb8336994555512f9dcdafc。由原独审 Codex 会话作为唯一 writer 追加,Hermes 对 7 行夹具 manifest 差异独立复核后普通 push 到本 PR;模型/强度实际核实仍为gpt-6.1-sol/ultra,本次修复无子 Agent。WS readable continuation TDD / transport (RED)失败:历史94bb4a53e源码不含新 Candy 降级 API,3 个较新降级测试导致 7 条编译诊断,污染校验正确拒绝。这不是有效行为 RED,也不是已经证实的当前产品失败。提交前自查