Skip to content

[Bug]: ACP grep/code search rows show a globe as web search #12928

Description

@letrandat

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open T3 Code (desktop or web) against a Grok thread. Cursor and Antigravity should hit the same path; they also speak ACP.
  2. Ask the agent to search the repo (grep / “found N matches” / Searched files). Do not ask it to search the public web.
  3. Watch the in-progress work log while those tool rows appear.

Expected behavior

Local codebase search uses the code-search presentation: magnifying-glass icon, and grouped copy like “Searched code N times”.

Real web search (fetch, Claude WebSearch, Codex web_search_call) still uses the globe and “Searched the web”.

Actual behavior

Grep rows render with a globe. The title is found N matches (or “Searched files”), sitting next to real terminal/file rows, so the log reads as if the agent was on the internet.

This is not Grok-only. ACP tool kind search is mapped to web_search for every ACP provider:

// apps/server/src/provider/acp/AcpRuntimeModel.ts
case "search":
case "fetch":
  return "web_search";

ACP’s own split is search vs fetch. fetch is the network. search is not.

The work log already has a code-search action, but the heuristic only fires when the item is already web_search and the title contains grep:

// packages/client-runtime/src/work-log/presentation.ts
function workLogEntryIsLocalCodeSearch(entry) {
  return (
    entry.itemType === "web_search" &&
    /\bgrep\b/i.test(normalizeCompactToolLabel(entry.toolTitle ?? entry.label))
  );
}

Grok titles these found 17 matches / Searched files, so they stay search → globe. Anything that then groups as web_search also becomes “Searched the web N times”.

Mobile is worse: it maps every web_search to globe and never consults code-search.

// apps/mobile/src/lib/threadActivity.ts
if (entry.itemType === "web_search") return "globe";

Claude’s adapter already only promotes names that include websearch / web search. ACP does not.

Canonical event from a Grok grep on desktop 0.0.42:

item.completed provider=grok itemType=web_search title=Tool detail="found 17 matches" data.kind=search data.rawInput.variant=Grep

A one-line icon swap is not enough. Changing only the ACP map turns grep into dynamic_tool_call (hammer). Changing only the title heuristic still leaves itemType: web_search on the wire and still leaves mobile on a globe. That is why this is an issue, not a PR: the honest fix crosses the ACP mapper, shared presentation, web grouping, and mobile icons, and it has to leave real web search alone.

Impact

Cosmetic issue

Version or commit

T3 Code desktop 0.0.42. Mapping still present on current main (canonicalItemTypeFromAcpToolKind in AcpRuntimeModel.ts).

Environment

macOS, T3 Code desktop 0.0.42, Grok 4.6 (ACP). Same mapping applies to other ACP providers (Cursor, Antigravity).

Logs or stack traces

item.completed
  provider: grok
  itemType: web_search
  title: Tool
  detail: found 17 matches
  data.kind: search
  data.rawInput.variant: Grep

Screenshots, recordings, or supporting files

Work log during a repo grep: globe icons on found 17 matches, found 25 matches, etc., mixed with terminal file rows. Same session as the log above.

Workaround

None. The rows are still the correct grep calls; only the classification and icon are wrong.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions