Repository navigation
fix(providers/openai): replay web searches and computer calls without item IDs - #77
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@ethanndickson, about the
Would you add an inline item for searches that can't be referenced with
|
|
Update: #78 now sends a search inline (no So the two compose: this PR decides which searches get a reference, and #78 sends whatever is left inline. The rebase is in the same assistant-message loop: #78 records which ids got a reference and skips those in the tool-result branch.
|
688d5fb to
9b90448
Compare
Relates to CODAGT-1425
Stacked on #78.
#78 sends a hosted web search inline, without its
id, whenever it doesn't get anitem_reference. This PR takes that one step further: we'll never reference a web search, so every search goes inline. After this, reasoning items are the only replayed output items that carry an ID.The API pairs any item that has a stored ID with the reasoning item right before it, and rejects the whole request if that reasoning is missing. That's coder/coder#30528. An item without an ID is never paired. I probed this through the AI Gateway:
ws_id, but without its reasoning item, gets a 400, even withstore: false. The same item without anidis accepted with or without reasoning, and withstoretrue or false.item_referenceand an inline item cost the same input tokens (~35 in my probes), and neither brings back the page contents. Mathias saw the same on fix(providers/openai): replay web searches and computer calls without item IDs #77 (the one exception being gpt-4.1-mini getting the source list). So a reference buys us nothing, whilst it can still resolve another org's stored item after a credential switch.computer_callhas the same problem. A replayedcu_id without its reasoning item getsItem 'cu_...' of type 'computer_call' was provided without its required 'reasoning' item, withstoretrue or false. We replay computer calls from their raw JSON, so we'll just drop theidfrom it. Acomputer_callwithout anidis accepted.As a result we can delete the reference path:
referenceAt,isResponsesWebSearchToolCall,validateResponsesItemReferences,effectiveResponseStore, andResponsesReasoningMetadata.SourceStoreEnabled, which only existed to gate references. Rows saved withsource_store_enabledstill decode; the field is just ignored. The computer use cassettes now expect the calls without anid.I also ran live two-turn
agent.Generateruns through the gateway, with the turn 1 messages round-tripped through JSON: gpt-5-mini withstoretrue then true, false then true, and false then false, and gpt-4.1-mini withstoretrue then true, i.e. a search with no reasoning before it. Every turn 2 sent the searches inline without anid, got a 200, and the model listed the searches it made.Since searches are never looked up server side any more, coder/coder doesn't need to strip web searches on a credential switch before it bumps fantasy.