Skip to content

feat: show web searches and the pages they found in chats - #29861

Merged
mafredri merged 17 commits into
mainfrom
mafredri/responses-web-search-sources
Oct 27, 2026
Merged

mafredri merged 17 commits into
mainfrom
mafredri/responses-web-search-sources

Conversation

@mafredri

@mafredri mafredri commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Closes CODAGT-795

Problem

Provider-executed web_search calls were invisible in Agents chats. The frontend skipped every provider_executed part, and chatd stored each search result as {}. The only trace was one "Searched N results" row of source parts per message. That row held citations for OpenAI and search results for Anthropic, with nothing to tell the two apart.

Fix

  • Fantasy (feat: tag web search sources with the search that found them fantasy#62): a source part carries the ID of the search that found it (tool_call_id); citations carry none. OpenAI now:

    • requests its found pages;
    • sends each search's found pages and its result when the search item closes;
    • puts the action in the call input: queries, or url and pattern for open_page and find_in_page.
  • chatd: stores tool_call_id on source parts. It marks a search failed when Anthropic returns an error_code or OpenAI a failed status. Otherwise the search's result stays {}.

  • UI: each search is one row:

    • labels: "Searched for ", "Opened ", or "Searched for ";
    • a spinner until its result arrives, and "Did not finish …" if the message ended without one;
    • when expanded, the queries and the pages that search found.

    Untagged sources stay in the answer's source row, now labeled "N sources". Both rows link only http: and https: URLs. Other provider-executed tools stay hidden, and a user-defined tool named web_search keeps the generic renderer.

With the tag, each URL appears in exactly one row, so the search row no longer duplicates the citation pills, which was the concern CODAGT-795 raised. In one live gpt-4.1-mini answer, the search found 12 pages and the answer cited 1 of them.

Anthropic answers show no citations yet, because Fantasy drops Anthropic's text citations (CODAGT-1186).

AI Gateway needed no change: aibridge/intercept/responses forwards the request body, including include, and relays upstream response bytes. TestChatOpenAIResponsesWebSearch runs through the AI Gateway daemon.

The Fantasy pin is coder/fantasy#62's commit on coder_2_33 (90a0be3). Upstream: charmbracelet/fantasy#435.

#30529 landed while this PR was open. It folds web searches into working blocks, written for searches that rendered no row. This PR keeps that handling for provider calls that render no row, and counts a shown web search once, as a tool, with its citations not counted again.

gpt-4.1-mini: one search, 24 pages, two citations gpt-5-mini: three searches, three open_page, one find_in_page, two citations Claude Sonnet 4.5: two searches, 10 pages each
gpt-4.1-mini gpt-5-mini Claude Sonnet 4.5
Decision log and verification

Why found pages come from the search item, not the end of the response. In 16 live OpenAI streams, gpt-4.1-mini and gpt-5-mini search items carried their found pages when they closed. The final response.completed summary added pages the answer cited to each search's list: all 7 URLs that appeared only there were cited. gpt-4.1 search items carried no pages, so gpt-4.1 searches show none. Taking the summary would have shown citations as found pages.

Why a row finishes on its result. Both providers now send a search's result when the search ends. The UI no longer infers "finished" from the shape of the call input.

Bedrock Mantle. vercel/ai#18507 reported in August that Mantle rejected the sources include. Through Coder's AI Gateway today, Mantle (openai.gpt-5.6-terra, us-east-1 and us-west-2) accepts it with HTTP 200, and a request with an invalid include lists web_search_call.action.sources among the supported values. So chatd does not special-case Bedrock. Whether Mantle returns found pages is unverified, because web search failed on the test account.

Replay. Source parts are never sent to the model. The search result is {} as before, or {"error": …} for a failed search.

Existing chats. Anthropic found pages stored before this change have no tag, so they stay in the source row. Older OpenAI search rows show "Searched the web".

Not done.

  • Anthropic citations (CODAGT-1186).
  • Live stream parts carry provider_metadata that the history API strips. This predates this PR (CODAGT-1187).
  • OpenAI prompt caching without a prompt_cache_key (CODAGT-1188).
  • The model can lose an OpenAI search on later turns, although the UI shows it. Fantasy replays a web_search_call only as an item reference, only with store:true, and only right after reasoning from a stored response. Searches with no reasoning before them are tracked in chatd: OpenAI web searches without a preceding reasoning item are never replayed #30528.

Verified on a local dev instance whose providers point at the dogfood deployment's AI Gateway:

  • gpt-4.1-mini, gpt-5-mini (three searches, two open_page, one find_in_page) and Claude Sonnet 4.5 (two searches).
  • On reload, each OpenAI answer's "2 sources" row sits after the answer text, though chatd stores the citations before the text (screenshots above, at 5c3ea995ae).
  • After reload, the API returned each search's pages as tagged sources, citations untagged, and no provider metadata.
  • While answers streamed, each row read "Searched for …" with its page count and no row spinner, for both providers.

Tests: TestChatOpenAIResponsesWebSearch (a search with found pages and a cited page that appears only in the final summary, and a failed search) runs through the chat API and AI Gateway. TestProcessStepStreamProviderWebSearch covers Anthropic results and errors. Frontend tests cover message parsing, streaming, which web search rows render as the web search tool, and which found pages become links. Stories capture each web search label and state. Query and action parsing is tested in coder/fantasy#62.

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

@linear-code

linear-code Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

CODAGT-795

DES-22217

@mafredri
mafredri force-pushed the mafredri/responses-web-search-sources branch from 99e4658 to 0922e9a Compare September 24, 2026 16:10
@mafredri

This comment was marked as outdated.

@coder-agents-review

coder-agents-review Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-09-24 16:11 UTC by @mafredri

Review history
  • R1 (2026-09-24): 14 reviewers, 7 Nit, 1 P1, 14 P3, 5 P4, REQUEST_CHANGES. Review

deep-review v0.13.0 | Round 1 | c95a87c..0922e9a

Last posted: Round 1, 27 findings (1 P1, 14 P3, 5 P4, 7 Nit), REQUEST_CHANGES. Review

Finding inventory

Finding inventory: PR #29861

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P3 Open Tool.stories.tsx:2082 GenericToolStringError still named web_search, now renders WebSearchRenderer R1 Netero Yes
CRF-2 P3 Open WebSearchTool.tsx:17 parseQueryList duplicates parseStringList in Tool.tsx R1 Netero Yes
CRF-3 P3 Open Tool.tsx:1188 No test asserts the running-to-completed status override R1 Netero Yes
CRF-4 Nit Open chattest/openai.go:367 requestIncludes loop reimplements slices.Contains R1 Netero Yes
CRF-5 Note Note (body) chatprompt.go:810 result = display branch has no chatprompt unit coverage R1 Netero No
CRF-6 P1 Open go.mod:115 Fantasy pin forces sources include; Bedrock Mantle OpenAI-format models with web search fail every turn R1 Luffy P1, Pariston P1, Ryosuke P2 Yes
CRF-7 P3 Open chatprompt.go:809 Failed Anthropic search renders as success though chatd has ErrorCode R1 Melody Yes
CRF-8 P3 Open WebSearchTool.tsx:77 Failed to search label unreachable; failed OpenAI search shows as success R1 Pariston P3, Mafuuu P3 Yes
CRF-9 P3 Open chatprompt.go:810 Sources JSON sent to Anthropic as assistant text after provider switch R1 Melody Yes
CRF-10 P3 Open Tool.tsx:1222 Renderer picked by name only; dynamic tool named web_search loses display R1 Nami P3, Melody Note Yes
CRF-11 P3 Open WebSearchTool.tsx:116 Consulted-source pills show hostname only, identical for same-site pages R1 Nami, Leorio Yes
CRF-12 P3 Open WebSearchTool.tsx:72 open_page and find_in_page render as Searched the web R1 Nami P3, Mafuuu P4, Leorio P4 Yes
CRF-13 P4 Open WebSearchTool.tsx:82 Single long query truncated and unreadable R1 Nami Yes
CRF-14 Note Note (body) messageParsing.ts:222 Existing OpenAI chats show empty Searched the web rows R1 Nami No
CRF-15 P3 Open WebSearchTool.tsx:83 Two adjacent Searched rows with conflicting counts R1 Leorio, Luffy, Zoro Yes
CRF-16 P3 Open WebSearchTool.tsx:79 Interrupted Anthropic search shown as Searched for R1 Mafuuu Yes
CRF-17 P4 Open go.mod:110 Fork patch 12 names the wrong Fantasy branch R1 Leorio Yes
CRF-18 Nit Note (body) PR description UI change without screenshot R1 Leorio No
CRF-19 P4 Open chatopenai/tools.go:38 Exported types used only in package; unreachable marshal error branch R1 Zoro P4, Ging-go P4, Ryosuke Nit Yes
CRF-20 P4 Open chatprompt.go:809 chatprompt imports chatopenai and special-cases a provider tool R1 Ryosuke Yes
CRF-21 P3 Open Tool.stories.tsx:2391 WebSearchQueriesAndSources play asserts nothing R1 Bisky Yes
CRF-22 P3 Open ConversationTimeline.stories.tsx:1929 ProviderWebSearchWithCitations play asserts nothing R1 Bisky Yes
CRF-23 P4 Open WebSearchTool.test.ts:53 Test pins fixture-only JSON-string branch R1 Bisky Yes
CRF-24 P3 Open WebSearchTool.tsx:49 Scheme check in caller instead of SourcePill R1 Zoro Yes
CRF-25 Nit Open WebSearchSources.tsx:53 SourcePill doc says truncated title; new caller passes empty title R1 Gon (P2) Yes
CRF-26 Nit Open chatopenai/tools.go:34 Persistence rationale duplicated in tools.go and chatprompt.go R1 Gon (P2), Zoro Nit Yes
CRF-27 Nit Open Tool.tsx:1187 Inline comment repeats getWebSearchToolData timing claim R1 Gon (P2) Yes
CRF-28 Nit Open chatprompt.go:810 Variable display holds JSON, not display text R1 Gon Yes
CRF-29 Nit Open chattest/openai.go:47 Queries and Query fields undocumented R1 Gon Yes
CRF-30 Nit Open chatprompt.go:809 Bare web_search literal must match chatopenai tool name R1 Gon Yes
CRF-31 Note Note (body) WebSearchTool.tsx:116 Expanding a row sends consulted hostnames to Google S2 R1 Gon No
CRF-32 Note Dropped by orchestrator (field doc and type doc each describe their own declaration, Go convention) chatopenai/tools.go:39 Sources field comment repeats WebSearchSource doc R1 Gon (P2) No
CRF-33 Note Dropped by orchestrator (standard Go doc comment; states the input is a raw request body, which the name does not) chattest/openai.go:365 requestIncludes doc repeats body R1 Gon (P2) No
CRF-34 Note Dropped by orchestrator (comment says what the call and result pair carries, which the require lines do not name) exp_chats_test.go:10188 requireWebSearchParts comment lists assertions R1 Gon (P2) No
CRF-35 Note Dropped by orchestrator (doc gives the reason for the exception; summary clause is the conventional JSDoc opener for callers in streamState.ts) messageParsing.ts:79 Doc restates the one-line body R1 Gon (P2) No
CRF-36 Note Dropped by orchestrator (summary sentence adds provider-executed, which the name lacks) WebSearchTool.tsx:32 First doc sentence repeats function name R1 Gon (P2) No
CRF-37 Note Dropped by orchestrator (affirmation, asks no change) chatprompt.go:809 Feature justification holds R1 Luffy No
CRF-38 Note Dropped by orchestrator (affirmation, asks no change) exp_chats_test.go:10073 Integration and unit tests are genuine R1 Bisky No
CRF-39 Note Dropped by orchestrator (affirmation, asks no change) WebSearchTool.tsx:31 getWebSearchToolData doc is good text R1 Leorio No
CRF-40 OOS Out of scope (body) WebSearchSources.tsx:66 SourcePill hostname not encoded in Google S2 query R1 Kurapika No
CRF-41 OOS Out of scope (body) chatopenai/options.go:86 IncludeFromChat silently drops unknown include values R1 Ryosuke No
CRF-42 OOS Dropped by orchestrator (covered by CRF-6; other Fantasy consumers are not this repo) fantasy responses_language_model.go:367 Any Responses backend rejecting the include fails R1 Luffy No
CRF-43 OOS Dropped by orchestrator (covered by CRF-8 and CRF-12; coder/fantasy#62 is part of this change) fantasy responses_options.go:412 WebSearchCallMetadata drops status and open_page URL R1 Nami, Melody, Mafuuu No
CRF-44 OOS Out of scope (body) chatloop/chatloop.go:983 Provider-executed results never carry an error R1 Pariston No
CRF-45 OOS Out of scope (body) typesGenerated.ts:3531 ChatToolCallPart.args generated as Record<string, string> R1 Bisky No
CRF-46 OOS Out of scope (body) chatd.go:3835 Bare web_search literals elsewhere (also generation_preparer.go:624, chatsanitize/anthropic.go:24) R1 Gon No
CRF-47 OOS Out of scope (body) exp_chats_test.go:143 newChatClientWithoutAIBridge name misstates AI Gateway use R1 Gon No
CRF-48 OOS Dropped by orchestrator (covered by CRF-15) WebSearchSources.tsx:28 Citation row labels citations as search results R1 Leorio No
CRF-49 OOS Out of scope (body) fantasy responses_language_model.go:1382 Stale comment about action sources in the pinned Fantasy R1 Leorio No
CRF-50 OOS Dropped by orchestrator (tracked in SEC-376) MessageBlocks.tsx:407 Citation source parts accept any URL scheme R1 Zoro No

Contested and acknowledged

Law analysis

Not run. Effective additions 844, below the 1000 threshold.

Round log

Round 1

Netero first pass: 3 P3, 1 Nit, 1 Note, no P0, so the panel ran. Full panel (round 1): ging-go, ging-ts, ging-react, nami, melody, kurapika, ryosuke, luffy (triggered specialists), pariston, mafuuu (core), bisky (tests changed), gon, leorio (once-per-PR floor), zoro (random wildcard from the distilled set). 14 reviewers, over the 12 target because 8 specialists triggered: ging-go, ging-ts, ging-react (Go, TS, TSX files), nami (frontend), melody (Go result JSON and Fantasy call input consumed by TS), kurapika (provider URLs rendered as links), ryosuke (chatprompt imports chatopenai), luffy (new UI feature).

Cross-check: CRF-6 raised to P1 (Ryosuke P2, Luffy and Pariston P1; higher wins). Orchestrator verified model_routing_aibridge.go:237-246 routes non-Anthropic Bedrock models to the Fantasy OpenAI Responses client, buildProviderTools adds the OpenAI web search tool for any provider type, and the pinned Fantasy appends the include unconditionally (responses_language_model.go:367). The admin form maps bedrock to Anthropic fields, so the configuration is reachable through the API; coerceBedrockReasoningSummary shows OpenAI options on Bedrock are an expected path. CRF-9 verified: AnthropicProviderToolResultTextPart emits removed provider-executed result text verbatim. CRF-7 verified: fantasyanthropic.WebSearchResultMetadata.ErrorCode is in the metadata map chatd reads. CRF-10 verified: exp_chats.go:1392-1410 accepts a dynamic tool named web_search. CRF-17 verified with git ls-remote.

Downgrades. Gon rated eight comment findings P2. Keep argument: AGENTS.md requires substantive comments, and duplicated rationale drifts. Downgrade reason: the code works and the consequence is maintenance cost under a project convention, which the severity scale defines as Nit. CRF-25, CRF-26, CRF-27 posted as Nit; CRF-32 to CRF-36 dropped with reasons in the Status column. CRF-26: Gon and Zoro disagreed on which copy to keep; the comment keeps the rationale at toolResultContentToPart, where the persistence decision is made.

Reviewed against c95a87c..0922e9a.

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.

@mafredri
mafredri requested a balanced review from Copilot September 24, 2026 16:12
@mafredri

This comment was marked as outdated.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 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-13T13:29:08.695085Z c221f14 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.

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

coder-agents-review[bot]

This comment was marked as outdated.

@mafredri
mafredri force-pushed the mafredri/responses-web-search-sources branch from 667c824 to ffea652 Compare September 25, 2026 15:51
@mafredri mafredri changed the title feat: show OpenAI web searches and consulted sources in chats feat: show web searches and the pages they found in chats Sep 25, 2026
@mafredri

This comment was marked as outdated.

@mafredri

This comment was marked as outdated.

@mafredri
mafredri force-pushed the mafredri/responses-web-search-sources branch from a41a15e to 5c3ea99 Compare October 3, 2026 16:16
@mafredri
mafredri force-pushed the mafredri/responses-web-search-sources branch 3 times, most recently from db6c652 to c221f14 Compare October 13, 2026 13:02
@mafredri

This comment was marked as outdated.

@mafredri
mafredri marked this pull request as ready for review October 13, 2026 13:23
@mafredri
mafredri requested a review from a team as a code owner October 13, 2026 13:23
@pr-queue-manager
pr-queue-manager Bot requested a review from jakehwll October 13, 2026 13:24
chatgpt-codex-connector[bot]

This comment was marked as outdated.

@mafredri
mafredri force-pushed the mafredri/responses-web-search-sources branch 2 times, most recently from c542b97 to 5136929 Compare October 26, 2026 15:59
@mafredri
mafredri force-pushed the mafredri/responses-web-search-sources branch from 5136929 to 6493edf Compare October 26, 2026 16:45
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

ethanndickson pushed a commit that referenced this pull request Oct 27, 2026
Moves the fantasy pin to the tip of `coder_2_33` (`85ffbbe`). That
commit is coder/fantasy#72, which merges 87 upstream
charmbracelet/fantasy commits, v0.40.0 to v0.45.5. Between the two pins
117 files change. Upstream's own v0.40.0 to v0.45.5 change, without
tests, testdata, examples, `go.sum` and the kronk provider, is 43 files,
+2271/−928.

## What reaches chatd

chatd builds only the `anthropic`, `openai` and `openaicompat` fantasy
clients (`chatprovider.ModelFromConfig`); other vendors reach it through
the AI Gateway on one of those. So the upstream changes to the Google,
Vercel, OpenRouter, Bedrock, Azure and kronk providers, and to the
`fantasy.Agent` loop and its retries, do not run in chatd. These do:

- **Chat Completions and openaicompat streams** keep reasoning on
batched and DeepSeek-shaped chunks, keep `finish_reason: length` when
tool calls are truncated, and stop sending empty reasoning fields.
openaicompat drops assistant turns that hold only reasoning.
- **Token usage.** When an OpenAI-shaped backend reports reasoning
tokens apart from completion tokens (reasoning larger than output),
output tokens now include them, so that backend's reported output tokens
and cost rise. OpenAI's own shape, where reasoning is a subset, is
unchanged.
- **Responses.** A content-filtered turn no longer reads as a tool-call
turn.
- **Context overflow.** Baseten, Fireworks and Parasail prompt-length
errors set `ContextTooLargeErr`, which compaction acts on.
- **Anthropic.** Tool calls whose content block never closes are
reported. For Claude 5 models, thinking defaults to `display:
"summarized"` when the chat config sets none; a configured display still
wins. `TestThinkingDropBlockModel_RetriesWithEffort` now expects the
field in the retry body.
- **Anthropic keepalives.** Fantasy forwards `message_start`,
`message_delta` and unknown events as content-free `keepalive` parts.
The first one arrives before any model output, so this PR makes
`ttft_seconds` and the `time_to_first_token` stage skip them, as they
skip warnings. They still reset the stream silence guard.
`processStepStream` ignores them, and the debug recorder counts them in
its part count but records no content.
- **Tool-result media** now goes through upstream's shared
`ToolRunBuffer`, which replaces coder/fantasy#64 and does the same
thing.

#72 keeps coder's anthropic-sdk-go and openai-go forks, Go 1.26 and
kronk v1.31.5, so upstream's SDK and Go moves do not come along.

`go mod tidy` raises the modules fantasy v0.45.5 requires, among them
otel exporters v1.47, the AWS SDK, `google.golang.org/api` v0.307 and
go-openapi v1. All are upgrades.

The `go.mod` comment now names #72 as the upstream sync.

#29861 stacks on this PR to pin coder/fantasy#62.

<details>
<summary>Verification</summary>

- `go build ./...`.
- `go test` passes on every package that imports fantasy
(`coderd/x/chatd/...`), and `go test ./coderd -run
'TestChat|TestExpChat|TestMCP|TestAIBridge'` passes.
-
`TestGuardedStreamTTFTStage/WarningsAndKeepalivesThenContentObservesOnce`
fails without the TTFT change (TTFT observed 0s instead of 1s) and
passes with it.
- `make pre-commit` passes. The generated Prometheus docs pick up the
metric help change.

Not verified against live backends in this PR: the stream fixes, the
token usage change and the context-overflow patterns have no coder test
against a real provider. coder/fantasy#72 reports a local chatd run
against the AI Gateway on Anthropic, Responses, OpenAI Chat and
openaicompat.

</details>

> 🤖 This PR was created with the help of Coder Agents, and _will be_
reviewed by a human. 🏂🏻
@mafredri
mafredri force-pushed the mafredri/responses-web-search-sources branch from 6493edf to e27b7b6 Compare October 27, 2026 09:28
Provider-executed web_search calls were hidden in the Agents UI, and
chatd persisted their result as {} because the queries and sources only
lived in provider metadata that API responses strip.

The Fantasy pin now requests web_search_call.action.sources, reads
action.queries with the deprecated action.query as fallback, and puts
the queries in the call input. chatd persists the consulted source URLs
as the result, so both survive a reload. The UI renders web_search as
its own row with the queries and http(s) source links, separate from
url_citation pills. Other provider-executed tools stay hidden.

An OpenAI call arrives once its search finished, but the sources only
come with the completed response, so that row does not show a spinner
while the answer streams.
Fix the stale test comment that said the result carries the queries,
drop comments that repeat field names, and say that Fantasy, not the
provider API, keeps consulted URLs only in metadata.

The pin moves to the fantasy pin branch with the matching comment
cleanup from coder/fantasy#62. It has no behavior change.
Each provider-executed web search row now lists the pages that search
found, taken from source parts tagged with the search's tool call ID.
Untagged source parts are the answer's citations and stay in the source
row. A row finishes when its result arrives, for both providers, so the
check on the queries key in the call input is gone.

chatd stores the tag on source parts and marks a search failed from the
Anthropic error code or the OpenAI item status. The search result goes
back to {} and the OpenAI-specific result JSON is removed.

The UI labels open_page and find_in_page actions, shows searches that
never finished, and only links http and https URLs in both rows.
parseStringList in the tools utils owns the string form, which only
typed fixtures use; the API sends queries as an array.
chatd stores a citation when it arrives, before the text that was
streaming, so reloaded answers showed the source row above the text.
Live, the row split the text in two. Both parsers now move a citation
row after the text that follows it.

Also URL-encode the hostname in the favicon request.
Moving the citation row after the answer text made cited answers end in
a sources block, so they lost the copy button and got the bottom spacer
instead.
The helper unit tests and label stories repeated what rendering a Tool
row checks, and the Anthropic timeline story repeated a parsing test.
The deprecated-query and no-query chat cases, and the loop's OpenAI
failure case, repeated Fantasy's tests and the chat's failed case.
Working blocks counted each provider-executed result as a hidden step,
which was right while web searches rendered no row. Web searches now
render as tool rows, so they were counted twice, and their citation rows
were counted on top. Only provider calls without a row count as hidden
steps now, and citations count only when a block has no provider search.
Citations were moved after their text once it arrived. A whitespace-only
delta after a citation had no text block to extend, so the paragraph
break was dropped. Answer text now goes before a trailing citation row
as it arrives, which keeps both the break and the citation placement.
FE1 keeps rendered appearance in Pixel-captured stories and out of
Vitest presence assertions. The label table and text checks go back to
stories; Vitest keeps the renderer choice and which pages become links.
Replace the push loop and nested try with a shared parseJSON helper, map
and every. parseArgs uses the same helper.
The static-components lint rule on main rejects calling a helper to
choose the renderer during render. WebSearchRenderer now falls back to
the generic renderer itself when a web_search call is not
provider-executed.
The pin moves from the PR branch to its squash commit on coder_2_33,
which adds only comment changes.
@mafredri
mafredri force-pushed the mafredri/responses-web-search-sources branch from e27b7b6 to 6714bd4 Compare October 27, 2026 10:20
@mafredri
mafredri merged commit 2cb10b5 into main Oct 27, 2026
31 checks passed
@mafredri
mafredri deleted the mafredri/responses-web-search-sources branch October 27, 2026 10:46
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 27, 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.

3 participants