feat(websearch): add parallel provider rollout (#26227)

This commit is contained in:
Shoubhit Dash
2026-05-08 14:19:36 +05:30
committed by GitHub
parent ae25278eda
commit a43d3e0e1e
13 changed files with 276 additions and 44 deletions
@@ -45,7 +45,7 @@ import type { GrepTool } from "@/tool/grep"
import type { EditTool } from "@/tool/edit"
import type { ApplyPatchTool } from "@/tool/apply_patch"
import type { WebFetchTool } from "@/tool/webfetch"
import type { WebSearchTool } from "@/tool/websearch"
import { webSearchProviderLabel, type WebSearchTool } from "@/tool/websearch"
import type { TaskTool } from "@/tool/task"
import type { QuestionTool } from "@/tool/question"
import type { SkillTool } from "@/tool/skill"
@@ -1933,10 +1933,11 @@ function WebFetch(props: ToolProps<typeof WebFetchTool>) {
}
function WebSearch(props: ToolProps<typeof WebSearchTool>) {
const metadata = props.metadata as { numResults?: number }
const metadata = props.metadata as { numResults?: number; provider?: unknown }
return (
<InlineTool icon="◈" pending="Searching web..." complete={props.input.query} part={props.part}>
Exa Web Search "{props.input.query}" <Show when={metadata.numResults}>({metadata.numResults} results)</Show>
{webSearchProviderLabel(metadata.provider)} "{props.input.query}"{" "}
<Show when={metadata.numResults}>({metadata.numResults} results)</Show>
</InlineTool>
)
}
@@ -13,6 +13,7 @@ import { LANGUAGE_EXTENSIONS } from "@/lsp/language"
import { Locale } from "@/util/locale"
import { Global } from "@opencode-ai/core/global"
import { ShellID } from "@/tool/shell/id"
import { webSearchProviderLabel } from "@/tool/websearch"
import { useDialog } from "../../ui/dialog"
import { getScrollAcceleration } from "../../util/scroll"
import { useTuiConfig } from "../../context/tui-config"
@@ -338,7 +339,7 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
const query = typeof data.query === "string" ? data.query : ""
return {
icon: "◈",
title: `Exa Web Search "${query}"`,
title: `${webSearchProviderLabel(data.provider)} "${query}"`,
body: (
<Show when={query}>
<box paddingLeft={1}>