fix(coding-agent): require web_search_call in codex search

GPT-5.6 Responses-Lite models receive tool_choice "auto" (the forced
hosted choice is invalid under the lite shape, #5771/#5772), so the model
may answer without invoking the hosted web_search tool. The codex search
parser accepted any non-empty answer, returning a stale completion with
zero sources as a successful search.

callCodexSearch now tracks response.web_search_call.* events (and
web_search_call output items) and throws CodexNoWebSearchError when none
occurred. The candidate chain treats that error as retryable, advancing
default lite models to a non-lite model that forces web_search, and
surfaces a clear failure when the model was explicitly configured.

Fixes #6988

(cherry picked from commit a276cd0b3df1d0d041faf0a63fabcbb884e36a91)
This commit is contained in:
roboomp
2026-07-29 09:45:21 +00:00
committed by can1357
parent 44907cef75
commit e5ea31b22c
4 changed files with 130 additions and 0 deletions
@@ -7,6 +7,8 @@ import { searchCodex } from "@oh-my-pi/pi-coding-agent/web/search/providers/code
function makeSseResponse(): string {
return [
`data: ${JSON.stringify({ type: "response.web_search_call.completed", item_id: "ws_test" })}`,
"",
`data: ${JSON.stringify({
type: "response.output_item.done",
item: {