You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Codex Responses ordering inserts a user separator before a hosted web search call #7296
Codex Responses ordering inserts a user separator between reasoning and its hosted web search call
Environment
Host: Codex Desktop through the Bili Responses proxy.
Observed on Bili 0.1.214. The local synthetic reproduction runs against Bili 0.1.216 source at commit 6453feeeb842bd1e471d875bf00287e5036a96c7.
Suggested triage: Codex host, Responses wire ordering. This can stop a normal follow-up turn after a hosted search.
What happens
On a conversation that used hosted web search, a follow-up request was rejected with this error shape. Item IDs below are synthetic.
Item 'ws_fixture' of type 'web_search_call' was provided without its required 'reasoning' item: 'rs_fixture'.
In a local reproduction, both original items survive. The wire order changes from user → reasoning → web_search_call to user → reasoning → synthetic user separator → web_search_call.
Minimal reproduction
From the repository root after installing dependencies and building the kernel, run the following with node --import tsx --input-type=module. It makes no network request.
The fixture reproduces the emitted item order. The server rejection above was observed separately in normal use.
Expected behavior
Preserve the reasoning and hosted tool call in the same assistant run when both items survive the transformation. The existing separator behavior for distinct runs should continue to work.
responsesToCore represents hosted web_search_call as contentType: "reasoning". The ordering code therefore sees two consecutive reasoning entries and inserts a boundary. A regression case that tests the rendered Responses items could cover this. Issue #5670 tracks a separate tool_search_call / tool_search_output pairing failure.
Activity
ranxianglei commentedon Nov 19, 2026
老哥提了几个issue,参考:我在 billion-context 提了 Issue #7296,附上 Codex 联网搜索调用与关联推理被分隔符拆开的最小复现,并在 #5670、#4594、#6215、#5589 分别补充了工具调用配对、预热、归档回读和存储漂移的验证记录。
ranxianglei commentedon Nov 19, 2026
(ai: vllm-qwen/qwen3.8-27b)
查重:不重复。 检索了 open+closed 的 issue/PR("Responses ordering separator web_search_call reasoning"、"turn separator assistant run ordering"、"web search call rejected reasoning required"),无同机制条目。正文提到的 #5670 是
tool_search_call/tool_search_output配对失败——那是另一套机制(这两类 item 在 kernel 里根本不进 hosted-call 扁平化路径,不受本修复影响),单独跟踪,本 PR 不碰。标签:bug / p2 / codex / scope-wiring(功能性缺陷但有绕行——仅 hosted web search 之后的会话卡住,压缩/重启可恢复;非崩溃/数据丢失/永久不可用,故 p2 非 p1;Codex Responses 线序,属协议接线)。
@ranxianglei 收到,谢谢补充。#5670(工具调用配对)、#4594(预热)、#6215(归档回读)、#5589(存储漂移)都是同一位作者补充的独立验证记录,各自独立跟踪;本线程只处理 #7296(联网搜索调用与关联推理被分隔符拆开)。
修复
根因:kernel 的
responsesToCore把所有 hosted-call item(web_search_call、file_search_call、mcp_call、computer_call/_output、image_generation_call、code_interpreter_call)扁平化成contentType: "reasoning"的 core(原始 item 挂在rawResponsesItemsidecar 上)。host 侧的repairResponsesAssistantOrdering把这个 core 当成第二个 reasoning,于是按「reasoning 出现在 phase>0 / 已见 reasoning 之后 ⇒ 插 user 分隔符」的规则,在真正的reasoning和 hosted call 之间插了一个 user 分隔符,把 assistant run 拆成两段 → Responses 服务端拒绝该web_search_call("without its required 'reasoning' item")。修法(host 侧,不动 kernel):
contentType: "reasoning"的 core 若其rawResponsesItemsidecar 带 hosted-call 的 wire type,则归类为 tool-call(phase 2)而非 reasoning。这样reasoning → hosted call保持在同一个 run 内;分隔符仍只落在不同 run 之间(真正的第二个 reasoning / tool-call 之后的 message)。判定只看 sidecar 的 wiretype,不看 core 的 text/id(两者都是 codec 重新派生、可被客户端塑形)。测试:
tests/issue564-responses-ordering.test.ts新增两条回归——(1)user → reasoning → web_search_call渲染为完整一个 run、零分隔符;(2) 两个不同 run(run1=reasoning+hosted call,run2=reasoning+message)仍恰好插一个分隔符,位置在 hosted call 之后、run2 的 reasoning 之前。定向测试全绿(issue564 24 条 + issue2627 / issue5139 / invariant-judge / fold-round2 / codex-responses-ws),typecheck 通过;全量以 CI 为准。八问
web_search_call与它的reasoning被一个合成 user 分隔符拆开)。判定:可合并。定向测试 + typecheck 绿,全量待 CI。
PR: #7302
ranxianglei commentedon Nov 19, 2026
(ai: vllm-qwen/qwen3.8-27b)
状态更新(刚实时核实):
2a2a9e923ae)check runs —— 61 success / 31 skipped / 0 failed / 0 运行中(40 个 cancelled 是 12:37Z 被重跑取代的首批 job,最终批次全绿)。上一条评论里「全量待 CI」现在可以确认通过。(按规则 agent 不 merge PR,由 owner 合并。)
ranxianglei commentedon Nov 19, 2026
(已收)本单已归入根因聚合 issue(token 见聚合单 body),机器人已停止在本单上的工作,修复走聚合 issue 统一出 PR;本单保留不关,修复验证后统一关闭。(聚合单:[Root Cause] codex-lane (2 items),GitHub #7314)
ranxianglei commentedon Nov 20, 2026
(ai: vllm-qwen/qwen3.8-27b)
收到。本单(#7296)已归入根因聚合单 #7314(codex-lane,成员 #4594 + #7296),我停止在本单上的工作,修复改由聚合单统一出 PR;本单按指示保留不关,等聚合 PR 修复验证后统一关闭。
当前状态(已 live 核对):
2a2a9e923ae,正文Closes #7296。-x"),[PR] fix: keep hosted web_search_call in the same run as its reasoning (#7296) #7302 的 commit 可直接被聚合根因 PR cherry-pick,无需重做。Fixes #4594+Fixes #7296、打root-cause+ 独立判定的类别/优先级标签、末尾带<!-- rcagg:codex-lane -->标记。本单不再新增工作,后续以 #7314 为准。
fix: keep hosted web_search_call in the same run as its reasoning (#7296