Title: chatd: OpenAI web searches without a preceding reasoning item are never replayed · Issue #30528 · coder/coder · GitHub
Open Graph Title: chatd: OpenAI web searches without a preceding reasoning item are never replayed · Issue #30528 · coder/coder
X Title: chatd: OpenAI web searches without a preceding reasoning item are never replayed · Issue #30528 · coder/coder
Description: Hosted OpenAI web searches that have no reasoning item right before them are never sent back to the model in later requests, so the model loses what the search found. Details coder/fantasy only sends a web_search_call item reference righ...
Open Graph Description: Hosted OpenAI web searches that have no reasoning item right before them are never sent back to the model in later requests, so the model loses what the search found. Details coder/fantasy only sen...
X Description: Hosted OpenAI web searches that have no reasoning item right before them are never sent back to the model in later requests, so the model loses what the search found. Details coder/fantasy only sen...
Opengraph URL: https://github.com/coder/coder/issues/30528
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"chatd: OpenAI web searches without a preceding reasoning item are never replayed","articleBody":"Hosted OpenAI web searches that have no reasoning item right before them are never sent back to the model in later requests, so the model loses what the search found.\n\n## Details\n\ncoder/fantasy only sends a `web_search_call` item reference right after a reasoning item from a stored response. OpenAI also returns web searches with no reasoning before them. In review probes on coder/fantasy#63, gpt-4.1-mini did this for `search`, and gpt-5.4-mini and gpt-5.5 at effort `none` did it for `open_page`. Those searches are dropped from every later request. For `open_page` this loses the page contents (gpt-5.5: 11,485 input tokens with the reference, 4,574 without). For `search` it loses only the query.\n\nThis affects configs that send `store: true`. Hosted web search can only be turned on through an OpenAI options block, and a config with that block defaults `Store` to true (`coderd/x/chatd/chatopenai/options.go`). So web search configs that leave `store` unset are affected. Configs that set `store: false` are not.\n\nFrom the same probes (OpenAI does not document this): with `store: true`, a reference to the `ws_` item on its own is accepted. When a reasoning item came before the search, sending the reference without that reasoning item returns a 400 that names the `rs_` item.\n\n## Possible fix\n\n- For each search, record whether its source response was stored and which reasoning item, if any, came right before it, in both Generate and Stream.\n- Send a reference on its own only when no reasoning came before the search, or when that reasoning item is also in the input.\n- Apply the same rule in `validateResponsesItemReferences`.\n- Keep today's rule for searches saved without that record.\n\nThe previous prompt part cannot decide this on its own: chatd drops legacy reasoning with an empty summary, and Generate drops reasoning with neither a summary nor `encrypted_content`. Either leaves a reference on its own that returns a 400.\n\nFound by @mafredri in https://github.com/coder/fantasy/pull/63#discussion_r4172593187, during review of #30298.\n\n> Xum opened this issue on behalf of @ibetitsmike.\n","author":{"url":"https://github.com/ibetitsmike","@type":"Person","name":"ibetitsmike"},"datePublished":"2026-10-08T22:37:07Z","url":"https://github.com/coder/coder/issues/30528"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:52401e8c-5696-9bf0-c8eb-1a5c5494cc9d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E4E2:14ECB:2786367:3238D86:6B019912 |
| html-safe-nonce | d00a0d8f181f78edfd1b4773c42a3e9a5f2005f15fb031f4365f33b4c2ff63a9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEUyOjE0RUNCOjI3ODYzNjc6MzIzOEQ4Njo2QjAxOTkxMiIsInZpc2l0b3JfaWQiOiI0NTE0OTUxOTQwNjkzNjYxOTcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d1b8ade93aeaa29d2dbdb57f98889c95894cf065602e6644808a485ab05ed3c3 |
| hovercard-subject-tag | issue:5769894229 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/30528/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ace34035890cf84ebc7f1ab27c80fc4fd5705eecd7070109fc8ea7c93177a916/coder/coder/issues/30528 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ace34035890cf84ebc7f1ab27c80fc4fd5705eecd7070109fc8ea7c93177a916/coder/coder/issues/30528 |
| og:image:alt | Hosted OpenAI web searches that have no reasoning item right before them are never sent back to the model in later requests, so the model loses what the search found. Details coder/fantasy only sen... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ibetitsmike |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width