Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat: web search tool details #4208

ClosedYash-Singh1(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromyash/web-search-tool-detailsopened View on GitHub

What Changed

Added web search tool details

Why

Gives user info on what the model is actually searching while it's searching

UI Changes

Screenshot 2026-07-20 at 4 05 32 PM Screenshot 2026-07-20 at 4 06 29 PM Screenshot 2026-07-20 at 4 06 35 PM

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk Focused chat UI and work-log derivation changes with tests; no auth, persistence, or API surface changes.

Overview Web search work log rows now surface what the model is searching instead of only a generic tool label.

deriveWorkLogEntries attaches toolData from activity payloads for web_search (same pattern as MCP), and lifecycle collapse keeps that payload when updates merge into the completed row.

Preview and expand behavior moves into workEntryDetails.ts: compact lines use the first query (or +N more), with fallbacks for find-in-page style actions; expanding shows pretty-printed JSON of the search item. MessagesTimeline imports these helpers instead of inline copies.

Tests cover timeline rendering (globe icon, compact query text) and expanded JSON content.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 97d068d759a4d450478690f32f8cd63f82861255. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add web search tool details to chat timeline work entries

  • Extends toDerivedWorkLogEntry in session-logic.ts to copy data.item into toolData for web_search items, matching existing mcp_tool_call behavior.
  • Adds webSearchPreview and formatWebSearchExpandedBody helpers in workEntryDetails.ts so compact previews show the query text (e.g. "first query +N more") and expanded bodies show pretty-printed toolData JSON.
  • Moves workEntryPreview, workEntryRawCommand, and buildToolCallExpandedBody out of MessagesTimeline.tsx into workEntryDetails.ts as named exports.
Macroscope summarized 97d068d.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 551c9aaf-c5b3-4f12-941e-c5fa128e017b

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `yash/web-search-tool-details`

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      Unresolved review comments identify potential logic bugs in the web search preview display - specifically that find-in-page previews may never show and completion details could be hidden. These should be addressed before merging.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 97d068d759a4d450478690f32f8cd63f82861255. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -0,0 +65,21 @@
      65+ }
      66+ return pattern ?? url;
      67+}
      68+
      69+function formatWebSearchExpandedBody(toolData: unknown): string | null {
      70+ try {
      71+ return JSON.stringify(toolData, null, 2);
      72+ } catch {
      73+ return null;
      74+ }
      75+}
      76+
      77+export function workEntryPreview(
      78+ workEntry: Pick<WorkLogEntry, "detail" | "command" | "changedFiles" | "itemType" | "toolData">,
      79+ workspaceRoot: string | undefined,
      80+) {
      81+ if (workEntry.command) return workEntry.command;
      82+ if (workEntry.itemType === "web_search") {
      83+ const preview = webSearchPreview(workEntry.toolData);
      84+ if (preview) return preview;
      85+ }

      Web search preview hides completion detail

      Medium Severity

      For web_search work entries, workEntryPreview returns a query string from toolData before it considers detail. After collapse, entries can keep both merged toolData and a completion summary in detail (for example a file count). The compact timeline subtitle then shows the old query instead of that summary.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 97d068d759a4d450478690f32f8cd63f82861255. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -0,0 +45,21 @@
      45+ return [itemQuery];
      46+ }
      47+ return [];
      48+}
      49+
      50+function webSearchPreview(toolData: unknown): string | null {
      51+ const action = webSearchActionRecord(toolData);
      52+ const actionType = asTrimmedPlainString(action?.type);
      53+ const queries = webSearchQueries(toolData);
      54+ if (queries.length > 0) {
      55+ const [firstQuery] = queries;
      56+ if (!firstQuery) {
      57+ return null;
      58+ }
      59+ return queries.length === 1 ? firstQuery : `${firstQuery} +${queries.length - 1} more`;
      60+ }
      61+ const url = asTrimmedPlainString(action?.url);
      62+ const pattern = asTrimmedPlainString(action?.pattern);
      63+ if ((actionType === "findInPage" || actionType === "find_in_page") && pattern && url) {
      64+ return `${pattern} in ${url}`;
      65+ }

      Find-in-page preview never shown

      Medium Severity

      webSearchPreview always prefers strings from webSearchQueries, which falls back to the required top-level query on every webSearch item. For openPage and findInPage actions, that runs before the URL/pattern branches, so the row shows the session query instead of the opened URL or pattern in url text.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 97d068d759a4d450478690f32f8cd63f82861255. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. Closing in favor of #2829 (orchestration V2).

      #2829 deletes the V1 orchestration layer this PR builds on — apps/server/src/orchestration/**, provider/Layers/*Adapter.ts and provider/Services/** are removed and replaced by apps/server/src/orchestration-v2/**, with the IPC surface renamed to ORCHESTRATION_V2_WS_METHODS. The files this PR touches either no longer exist or are rewritten, so it can't be rebased — it would need reimplementing against the V2 adapters.

      This is not a judgement on the change itself. Several of these are real gaps we still want fixed; the base just moved out from under them.

      Once #2829 merges, please rebase onto main, port the change to the V2 equivalent, and reopen (or open a fresh PR). Ping me and I'll prioritise the review.

    6. juliusmarminge closed this

Sign in to join this conversation.