Skip to content

fix: keep OpenAI web searches in later turns - #31355

Merged
mafredri merged 34 commits into
mainfrom
mafredri/unstored-web-search-replay
Oct 29, 2026
Merged

mafredri merged 34 commits into
mainfrom
mafredri/unstored-web-search-replay

Conversation

@mafredri

@mafredri mafredri commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

With store: false, an OpenAI chat drops every earlier web search from the next request, so on later turns the model says it made no tool calls (dogfood chat 6a4a3462-3426-496c-8268-28faedceb818). Fantasy replays a search only as an item_reference, and OpenAI cannot resolve a reference to an unstored item.

This moves the fantasy pin to coder/fantasy#78, which resends a search inline as {"type":"web_search_call","status":...,"action":{...}}, built from the tool result's metadata with no id and no sources, whenever the search does not go back as an item_reference. A reference still needs a stored request, a stored source response and a reasoning item right before the search, and each search is replayed once, so a referenced search is not also sent inline. So with store: false every search is sent inline, and with store: true two cases that were dropped are now sent inline too: searches from an unstored response (a chat moved to a stored model config) and searches with no reasoning before them (gpt-4o). The model gets the action it took, not the page content, since an item without an id gives OpenAI nothing to look up. The go.mod fork notes gain item 17, and the pin is coder_2_33 at e1c559d, where #78 merged.

TestChatOpenAIResponsesWebSearch now sends a second turn and checks the request body: the input must be [user, web_search_call, assistant, user] with the exact inline item. With store: false it covers search, open_page, find_in_page and a failed search; with the default store: true on gpt-4o, which produces no reasoning, it covers search and a failed search. The test runs through the chat API, the database and chatd's prompt builder, so it also shows chatd keeps the result's provider metadata and the provider-executed result in the assistant message.

Three test fixtures matched the old behavior. The fake OpenAI server rejected any web_search_call without a reasoning item before it; live probes show OpenAI accepts one without an id, so the fake now requires reasoning only when the item has an id. It also sent action.sources on open_page and find_in_page, which live OpenAI sends only on search. TestOpenAIResponsesNoStaleWebSearchReplay failed every web_search_call in the follow-up; it now fails only one with an id or an item_reference, and both its stateless and switch-to-stored cases expect the exact inline item right after the reasoning item. TestOpenAIResponsesFullReplayPairsReasoningAndWebSearch now also fails if a referenced stored search is sent inline as well.

The fake server now returns OpenAI's 404 for an item_reference to an item it served with store: false, so a replay that references unstored items fails in chatd tests as it does live. The tests' reference checks looked for type: "item_reference", which openai-go leaves out, so they could never fail; they now also catch a reference sent as just {"id": ...}.

Relates to CODAGT-1482

Verification
  • On the base pin (2e8e2cb), all six TestChatOpenAIResponsesWebSearch cases and both TestOpenAIResponsesNoStaleWebSearchReplay cases fail. On the previous chore: Update pion/ice fork to resolve goroutine leak #78 head (a410684, inline only with store: false), the two stored cases and switch to stored fail and the rest pass. go.mod and go.sum were restored afterward.
  • make pre-commit passes.
  • go test passes on every package that imports fantasy (coderd/x/chatd/..., coderd/database/db2sdk, coderd/mcp), and go test ./coderd -run 'TestChat' passes.
  • Live requests through the AI Gateway: with store: false, gpt-5-mini returned HTTP 200 for a pre-ci: Pin the golangci-lint version to prevent breakage #62 {"type":"find_in_page"} or {"type":"open_page"} action with no url or pattern, and for an inline web_search_call with no web_search tool in the request (also on gpt-6.1-sol). With turn 1 unstored and turn 2 store: true, inline items without an id returned HTTP 200 on gpt-5-mini and gpt-6.1-sol in 12 of 12 runs, while an item_reference returned 404. fix(providers/openai): replay unreferenced web searches inline fantasy#78 reports the other live probes.

🤖 This PR was created with the help of Coder Agents, and will be reviewed by a human. 🏂🏻

@linear-code

linear-code Bot commented Oct 27, 2026

Copy link
Copy Markdown

CODAGT-1482

@mafredri

This comment has been minimized.

@coder-agents-review

coder-agents-review Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-10-27 21:34 UTC by @mafredri

Review history
  • R1 (2026-10-27): 9 reviewers, 4 Nit, 1 P2, 4 P3, 4 P4, COMMENT. Review
  • R2 (2026-10-27): 9 reviewers, 5 Nit, 1 P2, 4 P3, 6 P4, COMMENT. Review
  • R3 (2026-10-27): 9 reviewers, 6 Nit, 1 P2, 5 P3, 10 P4, COMMENT. Review
  • R4 (2026-10-27): 9 reviewers, 7 Nit, 1 P2, 5 P3, 10 P4, COMMENT. Review
  • R5 (2026-10-27): 4 reviewers, 8 Nit, 1 P2, 5 P3, 10 P4, COMMENT. Review
  • R6 (2026-10-27): 4 reviewers, 8 Nit, 1 P2, 5 P3, 10 P4, APPROVE. Review
  • R7 (2026-10-27): 10 reviewers, 10 Nit, 1 P2, 5 P3, 14 P4, COMMENT. Review

deep-review v0.13.0 | Round 7 | 71cd5e6..4ed8f17

Last posted: Round 7, 30 findings (1 P2, 5 P3, 14 P4, 10 Nit), COMMENT. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P3 Author fixed (60b70b9; pin 50bf6c5 sends unreferenced searches inline) coderd/x/chatd/integration_responses_test.go:41 Search made while unstored is dropped when the next turn is stored; "switch to stored" asserts the drop R1 Netero P2, Pariston Note Yes
CRF-2 P3 Author fixed (rebase onto #31349, which added fork note 16 for #67) go.mod:122 Pin bump also pulls coder/fantasy#67, not recorded in fork notes or PR description R1 Netero Yes
CRF-3 P3 Author fixed (a6c962d; pin at #78 head a4106840afd8, PR stays draft until #78 merges) go.mod:125 Pin is behind coder/fantasy#78 head (8c455dd) and on an unmerged branch; move to coder_2_33 has no ticket R1 Netero Yes
CRF-4 Note Note (body) CI test-go-pg-17 failed on TestServerTailnet_ReverseProxy_TCPDialFailure, unrelated to the diff R1 Netero No
CRF-5 P2 Author contested; panel closed R2 (2/2 accept) go.mod:126 Pre-#62 search metadata replays without status, and find_in_page without url/pattern; no probe covers the latter R1 Melody P2, Ryosuke P2 Yes
CRF-6 P3 Author contested; panel closed R2 (1/1 accept) go.mod:126 Inline web_search_call items sent when the request has no web_search tool; API acceptance unverified R1 Meruem Yes
CRF-7 P4 Author fixed (06a9e21) coderd/exp_chats_test.go:11019 Rejected follow-up waits WaitLong and reports a timeout instead of the rejection R1 Mafuuu, Meruem Yes
CRF-8 Nit Author contested; panel closed R2 (1/1 accept) coderd/exp_chats_test.go:11019 Hand-written select re-implements testutil.RequireReceive R1 Ging-Go Yes
CRF-9 P4 Author fixed (5331af6) coderd/x/chatd/integration_responses_test.go:130 Stateless case checks presence of web_search_call only, not content or position R1 Bisky Yes
CRF-10 Note Note (body) coderd/exp_chats_test.go:11056 Follow-up assertions fail on old pin and pass on new pin R1 Bisky No
CRF-11 Note Dropped by orchestrator (verification note, asks no change; covered by CRF-10) coderd/exp_chats_test.go:11054 Producer-to-request chain agrees for results with a status R1 Melody No
CRF-12 Nit Author fixed (06a9e21) coderd/exp_chats_test.go:10767 Stored-case explanation sits on QueriesAndSources only, not Failed R1 Gon P2, Leorio Nit Yes
CRF-13 Nit Author fixed (06a9e21) coderd/exp_chats_test.go:11035 Comment restates the role/type branch below it R1 Gon P2 Yes
CRF-14 Nit Dropped by orchestrator (second sentence states the no-id contrast the PR adds; Leorio judged the comment clear) coderd/x/chatd/chattest/openai_responses_validation.go:38 Validator comment second sentence restates condition R1 Gon P2 No
CRF-15 Nit Dropped by orchestrator (fork note must be rewritten for CRF-2 and CRF-3) go.mod:122 Fork note 16 says unmerged twice R1 Gon P2 No
CRF-16 Nit Author fixed (94ce1f0) coderd/x/chatd/chattest/openai.go:48 OpenAIWebSearchCall.Action holds only action.type; rename to ActionType R1 Gon Yes
CRF-17 P4 Author fixed (5331af6) coderd/x/chatd/integration_responses_test.go:991 Failure message does not name the id condition R1 Leorio Yes
CRF-18 P4 Author fixed (ea7a441) coderd/x/chatd/chattest/openai.go:715 Fake adds action.sources to open_page and find_in_page R1 Leorio Yes
CRF-19 Nit Dropped by orchestrator (coder/coder squash-merges; PR title becomes the commit subject) 6ece6ac Behavior-changing commit labeled chore with no body R1 Leorio No
CRF-20 OOS Author fixed (60b70b9; pin 50bf6c5 sends stored searches without reasoning inline) fantasy responses_language_model.go:645 store:true without a preceding reasoning item still drops searches; tracked in #30528 and coder/fantasy#77 R1 Netero No
CRF-21 OOS Author fixed (pin; R7 Ryosuke verified effectiveResponseStore clears SourceStoreEnabled on a store:false echo; ZDR echo unverified) fantasy responses_language_model.go:698 ZDR orgs send store:true with unstored responses, so store-gated replay drops their searches R1 Ryosuke No
CRF-22 P4 Author fixed (60b70b9; pin 50bf6c5 includes coder/fantasy@a52f08e) go.mod:130 New pin sends a copy of the persisted WebSearchAction as the request action; any field added later is sent to OpenAI R2 Ryosuke P4, Meruem OOS Yes
CRF-23 P4 Author fixed (8c1b9e7) coderd/exp_chats_test.go:10855 Fake picks the follow-up by arrival count, so a retried first-turn request gets the follow-up answer R2 Komugi Yes
CRF-24 Nit Author fixed (60b70b9) coderd/exp_chats_test.go:10764 wantReplay doc says "this model" without naming gpt-4o R2 Leorio Yes
CRF-25 Nit Dropped by orchestrator (note 17 is rewritten when the pin moves to coder_2_33 in this PR before merge; same reason as CRF-15) go.mod:126 Fork note 17 says unmerged twice R2 Gon P2 No
CRF-26 P3 Author fixed (2f9ec99, 611c9a5; pin at #78 head b4d4cde) go.mod:131 Pin 50bf6c5 is two commits behind #78 head cb92642, which fixes store:true reference-after-inline ordering the pin introduced R3 Netero Yes
CRF-27 P4 Author fixed (f5c6148) coderd/x/chatd/integration_responses_test.go:763 No coder test fails if a referenced stored search is also sent inline R3 Netero Yes
CRF-28 P4 Author fixed (f5c6148) coderd/x/chatd/integration_responses_test.go:990 web_search_call id check duplicates the ws_ prefix check at line 1003 R3 Meruem Yes
CRF-29 Nit Author fixed (f542b26) coderd/exp_chats_test.go:10791 UnstoredSearch should be UnstoredQueriesAndSources to pair with its stored twin R3 Gon Yes
CRF-30 P4 Author fixed (PR description edited R4) coderd/exp_chats_test.go:10768 (PR description) Description says stored cases cover open_page and find_in_page; they cover only search and failed R3 Leorio Yes
CRF-31 P4 Author fixed (f5c6148, aedd6cc) coderd/x/chatd/integration_responses_test.go:29 Test name says no web search is replayed; test now requires an inline replay R3 Leorio Yes
CRF-32 Note Note (body) go.mod:131 Searches dropped by inlineWebSearchCallItem surface only as CallWarnings read by chatdebug R3 Ryosuke No
CRF-33 OOS Author fixed (pin b4d4cde; fantasy 9bd1001 replaces the flag with part adjacency and a prompt-wide replayedSearches map) fantasy responses_language_model.go:645-716 Reference vs inline decided in two content-part cases sharing state R3 Meruem No
CRF-34 OOS Author fixed (3828ac7) coderd/x/chatd/integration_responses_test.go:993 item_reference type check never fires; openai-go omits the optional type R3 Meruem No
CRF-35 OOS Author fixed (9f6c234, b34fab9) coderd/x/chatd/chattest/openai_responses_validation.go:34 Fake accepts item_reference to unstored items that live OpenAI rejects R3 Meruem No
CRF-36 OOS Author fixed (41c6d95; lines this PR added) coderd/x/chatd/chattest/openai.go File uses interface{} throughout instead of any R3 Ging-Go No
CRF-37 Nit Author fixed (9e4efa6) coderd/x/chatd/integration_responses_test.go:35 wantSearchReplay comment repeats the reason in the new test doc R4 Gon P2 Yes
CRF-38 P2 Dropped by orchestrator (author adopted verbatim the replacement comment our CRF-37 comment proposed; re-raising our own wording is churn with no behavior consequence) coderd/x/chatd/integration_responses_test.go:35 CRF-37 rewrite still partly restates the assertion R5 Gon No
CRF-39 Nit Author fixed (fd7fb0d) coderd/exp_chats_test.go:11045 inputItems holds role/type strings; rename to inputKinds R5 Gon Yes
CRF-40 P4 Open coderd/x/chatd/chattest/openai_responses_validation.go:181 ResponsesItemReferenceID and classifyResponsesInputItem use two different rules for an untyped reference R7 Ryosuke, Bisky, Razor Yes
CRF-41 P4 Open coderd/x/chatd/chattest/openai_responses_validation.go:184 Typed item_reference branch of ResponsesItemReferenceID runs in no test R7 Meruem, Bisky Yes
CRF-42 P4 Open go.mod:132 Pin f60a36a is one commit behind #78 head 0167276 (warnings only) R7 Melody Yes
CRF-43 P4 Open coderd/x/chatd/chattest/openai.go:349 Fake 404 message drops OpenAI's cause sentence about store: false R7 Leorio Yes
CRF-44 Nit Open coderd/x/chatd/chattest/openai.go:356 recordServedItem records only unstored items; rename recordUnstoredItem R7 Gon Yes
CRF-45 Nit Open coderd/x/chatd/chattest/openai.go:336 unstoredItemReference returns a rejection; rename rejectUnstoredItemReference R7 Gon Yes
CRF-46 Note Note (body) coderd/x/chatd/chattest/openai.go:356 Fake decides unstored from request store and never echoes store, so it cannot model the ZDR case; covered only in fantasy tests R7 Melody No

Contested and acknowledged

CRF-1 (P3, integration_responses_test.go:41) - unstored search dropped on a stored follow-up

CRF-5 (P2, go.mod:126) - pre-#62 metadata replays without required fields

CRF-6 (P3, go.mod:126) - inline items sent without the web_search tool

  • Finding: With store: false, inline web_search_call items are sent even when the request has no web_search tool (web search turned off, or same-provider model switch). If OpenAI rejects it, every later turn fails. Proposed: probe live; if rejected, leave the items out without the tool.
  • Author defense: A live store: false request with an inline web_search_call and no tools returned 200 on gpt-5-mini and gpt-6.1-sol (search, and a bare find_in_page on gpt-5-mini). Leaving the items out would lose the history this PR keeps.
  • Panel closure (R2, 1/1): Meruem, the agent that raised it (reused from R1), accepted. The no-tool probe covers the case the finding hinged on (WebSearchEnabled off). A same-provider switch to a model that cannot run web search is unprobed, but the probe shows the API does not check these items against the request's tools.

CRF-8 (Nit, exp_chats_test.go:11019) - select re-implements testutil.RequireReceive

  • Finding: The select on ctx.Done() and followUpBody duplicates testutil.RequireReceive.
  • Author defense: After the CRF-7 fix, the select also reads the chat stream (fails on a stream error event), so RequireReceive no longer fits.
  • Panel closure (R2, 1/1): Ging-Go, the agent that raised it (reused from R1), accepted. testutil.RequireReceive takes one channel; the loop at exp_chats_test.go:11023-11033 reads two.

Round log

Round 1

Round type: round 1, full panel. Netero first pass: 1 P2, 1 P3, 2 Notes, no P0, panel proceeded. Panel (focused, Go only): ging-go, melody, ryosuke (triggered specialists), pariston, mafuuu (core), bisky (tests changed), gon, leorio (once-per-PR floor), meruem (wildcard, random). 8 plus wildcard.
Cross-check: CRF-1 split. The store:true default case is tracked in #30528 and coder/fantasy#77, so it moved to out of scope (CRF-20); the mixed-store case (unstored source, stored follow-up) is covered by neither and stays at P3. Keep-argument for P2: the dogfood symptom returns silently for those chats. Downgrade reason: it needs a mid-chat switch of store mode and is not a regression.
CRF-5: Melody and Ryosuke rated P2 on a missing status. coder/fantasy#78's live probes report a missing status is accepted on gpt-5-mini, which disproves that part. The legacy find_in_page shape (no url, no pattern, both api:"required" in openai-go) is not covered by any probe; consequence is a 400 on every later turn of affected chats. Kept P2 on that residue.
CRF-3 raised from Note to P3: orchestrator found #78 head 8c455dd (committed 15:45Z, after coder head 15:25Z) is ahead of the pinned 006b727.
Gon comment findings downgraded P2 to Nit. Keep-argument: AGENTS.md requires substantive comments. Downgrade reason: no behavior or maintainer consequence beyond style.
Reviewed against f348cd6..086bf50.

Round 2

Fix round (no files added or moved, no change of goal, effective additions 179 to 205; the ActionType rename is the CRF-16 fix). Churn guard PROCEED: 9 addressed, 3 contested, 1 deferred. Netero: no findings. Panel: melody, ryosuke, meruem, ging-go (contested raisers, R1 agents reused), gon, leorio (comments and error messages changed), bisky, komugi (follow-up wait loop rewritten), mafuuu (wildcard, random). No new agents were needed for contested personas.
Contested CRF-5, CRF-6, CRF-8 closed by the personas that raised them. Fixes for CRF-2, 3, 7, 9, 12, 13, 16, 17, 18 verified (Netero, Bisky, Mafuuu, Meruem, Melody, Gon, Leorio).
CRF-1 deferred to CODAGT-1425. coder/fantasy#77's description sends a reference only when the source response was stored, so the review body asks a human to confirm CODAGT-1425 covers unstored-source searches.
New: CRF-22 P4 (Ryosuke P4, Meruem OOS; in scope because the PR's pin sets the behavior), CRF-23 P4, CRF-24 Nit. CRF-25 dropped. Keep-argument: redundant wording in a durable comment. Drop reason: the note is rewritten when the pin moves to coder_2_33 in this PR before merge.
Reviewed against 21471da..ddeb891.

Round 3

Restructure round: the PR goal widened from store:false to every search not sent as an item_reference (title changed, pin 50bf6c5 changes store:true behavior). Churn guard PROCEED: CRF-1, 22, 23, 24 addressed; CRF-20 (OOS) fixed by the pin. Netero (post-panel, advisory): CRF-26 P3, CRF-27 P4. Full panel (focused, Go only): ging-go, melody, ryosuke (triggered specialists), pariston, mafuuu (core), bisky (tests changed), gon, leorio (restructure floor), meruem (wildcard, random). Fixes for CRF-1, 20, 22, 23, 24 verified (Netero, Bisky, Meruem, Ryosuke).
CRF-26 kept at P3. Keep-argument: the pin again differs from the #78 head under review (same class as CRF-3), and the fixed bug is a 400 on stored chats. Downgrade argument: fantasy clears canReferenceWebSearch after every provider-executed call, and chatd stores call before result, so no chatd path is known to reach it. Kept P3; comment states that no chatd trigger is known.
CRF-30 is about the PR description; posted inline on the test table it misdescribes (exp_chats_test.go:10768, from Leorio's cited range) because post requires a comment per finding.
Reviewed against bc65edc..8c1b9e7.

Round 4

Fix round (only fixes prior findings; the fantasy rewrite in 9bd1001 is the CRF-26 fix). Churn guard PROCEED: CRF-26 to 31 addressed. Netero: no findings; CRF-26 and CRF-27 fixes verified (pin equals #78 head b4d4cde; CRF-27 by mutation). Panel: meruem, gon, leorio (raisers of findings whose code changed), ging-go, ryosuke, melody (Go and wire-format specialists), bisky (tests changed), hisoka (part-order edge cases in the new adjacency rule), chopper (wildcard, random). Fixes for CRF-26 to 31 verified (Netero, Bisky, Meruem, Leorio, Gon). Melody verified that fantasy streams call, sources, result and chatd stores them in that order, so the call is always at referenceAt; the reference path holds with sources present. CRF-33 (OOS R3) addressed by the pin.
CRF-37: Gon P2 downgraded to Nit. Keep-argument: duplicated reasons drift as fantasy's rule changes, and it has changed twice in this PR. Downgrade reason: no behavior consequence, and the comment also says the stored-destination case goes inline, which the doc states only implicitly.
Reviewed against 7283fff..611c9a5.

Round 5

Fix round. Churn guard PROCEED: CRF-37 addressed (9e4efa6). Netero: no findings; pin e782df27fe0e equals #78 head, fantasy diff from b4d4cde is one comment. Panel: gon (CRF-37 raiser), leorio (comment touched), ging-go (Go files), kite (wildcard, random). Leorio, Ging-Go, Kite: no findings.
CRF-38 dropped. Keep-argument: "both cases" and "right after the reasoning item" restate the code. Drop reason: the author used the exact replacement text our CRF-37 comment proposed.
CRF-39 Nit posted.
Reviewed against 4b6f2c1..8dd4ec0.

Round 6

Fix round. Churn guard PROCEED: CRF-39 addressed (fd7fb0d). Netero: no findings; PR diff equals R5 apart from the rename; pin e782df27fe0e still equals the coder/fantasy#78 head. Panel: gon (CRF-39 raiser), ging-go (Go file), bisky (test file), knov (wildcard, random). No findings. No open findings remain; review posted with APPROVE (downgraded to COMMENT by the tool).
Reviewed against decd769..fd7fb0d.

Round 7

Fix round (changes fix prior out-of-scope items CRF-21, 34, 35, 36; no files added; effective additions 193 to 313). Churn guard PROCEED with no open findings. Netero: no findings; CRF-34, 35, 36 verified (CRF-35 by mutation). Panel: meruem (CRF-34/35), ging-go (CRF-36), ryosuke (CRF-21), melody, takumi (new mutex in the fake), bisky (new test), gon, leorio (new doc comments and error message), hisoka (reference heuristic edge cases), razor (wildcard, random). Takumi verified the fake records ids under the lock before writing the event; race tests pass. Razor verified CRF-35 through chatd by mutating fantasy to reference an unstored search (404).
Orchestrator ran go test ./coderd/x/chatd/... while ten reviewers ran tests: TestChatTurnStopsAtStepLimit/Default hit a context deadline once, then passed on a full package rerun and 5/5 targeted runs; the test uses no store or references. Treated as load, not posted.
CRF-40 convergent (3 reviewers, all P4); linked to CRF-41 (calling ResponsesItemReferenceID from the classifier would also exercise the typed branch through validator tests, but the 404 path still needs its own row).
Reviewed against 71cd5e6..4ed8f17.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Komugi flake/determinism
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T21:35:38.461092Z 4ed8f17 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

This comment has been minimized.

coder-agents-review[bot]

This comment was marked as outdated.

@mafredri
mafredri force-pushed the mafredri/unstored-web-search-replay branch from 086bf50 to 8484794 Compare October 27, 2026 16:40
@mafredri

This comment has been minimized.

@mafredri
mafredri force-pushed the mafredri/unstored-web-search-replay branch from 1012e55 to ddeb891 Compare October 27, 2026 16:48
@mafredri

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

@mafredri

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

coder-agents-review[bot]

This comment was marked as outdated.

@mafredri
mafredri force-pushed the mafredri/unstored-web-search-replay branch from ddeb891 to 8c1b9e7 Compare October 27, 2026 17:46
@mafredri mafredri changed the title fix: keep OpenAI web searches in later turns when store is off fix: keep OpenAI web searches in later turns Oct 27, 2026
@mafredri

This comment has been minimized.

@mafredri

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

coder-agents-review[bot]

This comment was marked as outdated.

@mafredri
mafredri force-pushed the mafredri/unstored-web-search-replay branch from 8c1b9e7 to 611c9a5 Compare October 27, 2026 18:52
@mafredri

This comment has been minimized.

@mafredri

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

coder-agents-review[bot]

This comment was marked as outdated.

@mafredri
mafredri force-pushed the mafredri/unstored-web-search-replay branch from 611c9a5 to 8dd4ec0 Compare October 27, 2026 19:39
@mafredri

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

The stateless case only checked that some web_search_call was sent,
so it passed with the item moved or missing its action or status.
coder/fantasy#78 now sends a search inline whenever it does not go back
as an item reference, not only when store is false. A stored turn after
an unstored one, and stored searches with no reasoning before them, now
keep their searches; the tests expect the inline item in those cases.
Counting streamed requests would hand the follow-up answer to a retried
first turn.
The head references a search only from the part right after its
reasoning and replays each search once, so a search is never sent both
inline and as a reference.
The stored full-replay case now fails if the referenced search is also
sent inline. The web_search_call id check duplicated the ws_ id check
below it, so it is gone, and the no-stale test says what stale means.
The head changes only comments and a test field name since 9bd1001.
The new head warns when a tool message drops a provider-executed result.
openai-go leaves out the optional type on item references, so the
checks for type item_reference could never fail.
OpenAI returns 404 for an item_reference to an item from a store:
false response, but the fake server accepted it, so chatd tests could
not catch a replay that references unstored items.
The server returns on the first unstored reference, so the reasoning
reference alone decided the old test and the web search id was never
checked.
The validator and the unstored-reference check disagreed on which
untyped items are references; both now use ResponsesItemReferenceID.
OpenAI adds a store hint to the message when the referencing request
is also store: false. Also checks a typed reference and renames the
helpers for what they do.
main now decodes the request into a pointer.
@mafredri
mafredri force-pushed the mafredri/unstored-web-search-replay branch from 5bf23e0 to eb3d4d0 Compare October 29, 2026 19:14
@mafredri
mafredri merged commit 48a3d3f into main Oct 29, 2026
31 checks passed
@mafredri
mafredri deleted the mafredri/unstored-web-search-replay branch October 29, 2026 19:50
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants