[Bug]: ACP grep/code search rows show a globe as web search #12928
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#
- Open T3 Code (desktop or web) against a Grok thread. Cursor and Antigravity should hit the same path; they also speak ACP.
- Ask the agent to search the repo (grep / “found N matches” / Searched files). Do not ask it to search the public web.
- 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.
juliusmarminge added labelsaccepted
juliusmarminge added labelsbug
juliusmarminge added labelsvia-triage
juliusmarminge closed this
Sign in to join this conversation.
Triage#
Confirmed. Local ACP codebase search is classified as
web_search, so the work log shows a globe and “Searched the web” for repo greps.canonicalItemTypeFromAcpToolKindinapps/server/src/provider/acp/AcpRuntimeModel.tsmaps both ACPsearchandfetchtoweb_search. That item type is then written onitem.updated/item.completedinAcpCoreRuntimeEvents.ts. ACP’s own split issearch(“Searching for information”) vsfetch(“Retrieving external data”). Grok emits repo grep askind: "search"withrawInput.variant: "Grep". Cursor and Antigravity share the same mapper.The work log already has a
code-searchaction (magnifying glass, “Searched code N times”), butworkLogEntryIsLocalCodeSearchinpackages/client-runtime/src/work-log/presentation.tsonly fires whenitemType === "web_search"and the title/label containsgrep. Grok titles thesefound N matches/Searched files, so they stay on the web-search path. Grouped copy then becomes “Searched the web N times”.Two more reasons a one-line icon swap is not enough:
code_searchinTOOL_LIFECYCLE_ITEM_TYPES(packages/contracts/src/providerRuntime.ts). Dropping ACPsearchout ofweb_searchfalls through todynamic_tool_call(hammer).code-searchfor row icons.workEntryIconinapps/mobile/src/lib/threadActivity.tsmaps everyweb_searchtoglobe. The collapsed group can show a magnifying glass viasummaryKind === "code-search", but Grok titles never get that far.projectActivityPayloadkeepsdata.kindfor clients and stripsrawInput, sovariant: "Grep"is not on the wire. Work-log entries also do not copydata.kindexcept for MCP tools, so the presentation helper cannot see it today.Claude only promotes names that include
websearch/web search. Codex / OpenCode only promote explicit web-search types. Leave those alone.deriveToolActivityPresentationcurrently rewrites allweb_searchsummaries to “Searched files”, so a title heuristic on that string would also mis-label real ACPfetch.Not a duplicate of #4208, #2093, or the other work-log label/icon issues. Those are real web-search details or unrelated row chrome.
Fix (server + shared presentation + web + mobile):
searchvsfetchin the mapper.fetchstaysweb_search.searchmust not.data.kindonto work-log entries and treatkind === "search"ascode-search.toolGroupAction/code-search→ magnifying glass), notitemType === "web_search"→ globe.WebSearch, Codexweb_search_call, and ACPfetchon the globe / “Searched the web”.Workaround: none. The rows are the correct grep calls; only classification, icon, and grouped copy are wrong.