Skip to content

fix(web): label ACP page fetches and workspace searches accurately - #582

Merged
incognitojam merged 2 commits into
mainfrom
styal/acp-search-fetch-labels
Oct 1, 2026
Merged

incognitojam merged 2 commits into
mainfrom
styal/acp-search-fetch-labels

Conversation

@incognitojam

Copy link
Copy Markdown
Owner

ACP adapters type every search and page fetch as web_search, so in Antigravity threads workspace greps and page fetches all read "Searched web" and counted as web lookups. A turn that grepped the repo five times and fetched three pages showed "9 web lookups". Fetch rows also lost their URL ("Searched web - Fetch URL content"), because the compact activity projection drops ACP's rawInput.

What changed

  • Server projection: ACP rawInput now goes through the same allowlisted, length-capped tool-input projection as other providers' input, plus directory_path. The projection runs when activities are read, so existing threads pick this up too.
  • Labels (shared, web and mobile): a tool-less web_search row with a URL reads Fetched page - <url>; one with a directory_path reads Searched code - <query>. Real web searches stay Searched web - <query>.
  • Claude WebFetch: now reads Fetched page - <url> instead of the tool identifier WebFetch - <url>, so both providers use one name.
  • Grouping and counts: ACP workspace searches count as code searches in group summaries ("Searched code 5 times") and as tool calls in the folded-turn header, the same as Claude's Grep, instead of web lookups. On mobile, their rows use the same icon as Grep.
  • Thread caches: the web and mobile thread snapshot caches move to a new schema version, as the fork did for command exit codes in fix(web): show command exit codes #11. Otherwise threads already cached on a client would keep the old projection until new activity arrives. I hit exactly this while verifying.

Before and after

The expanded tool group from a real Antigravity turn. The folded header for the same turn went from "6 terminal commands, 9 web lookups" to "6 terminal commands, 4 web lookups, 5 tool calls".

Before After
Before: every search and fetch labelled Searched web After: code searches, fetched pages with URLs, one web search

Scope and upstream

Upstream fixed read and search classification for its V2 rewrite (pingdotgg#13375), but that isn't on upstream main yet. Its V1 counterpart doesn't apply to the fork cleanly. This change keeps edits to upstream-shared files small: one input source and one allowlisted key in the projection, two classifier conditions, one mobile icon line, and the cache versions. The label logic lives in the fork-only toolRowPresentation.ts. The inspectable-tool-activity ledger entry gains the invariant and tracks that upstream PR for retirement.

This is a follow-up to #580. They touch separate parts of the same files, and the branches merge cleanly together.

Validation

  • Compared grouped labels and group categories for 1,352 real work-log entries (Codex, Claude, OpenCode, Antigravity) before and after, running each through the server projection first. 11 changed, all intended: 3 Claude fetches (WebFetch → Fetched page), 3 Antigravity fetches (now with URLs), and 5 Antigravity workspace greps (now Searched code, grouped as code searches). The one real Antigravity web search and all Codex/Claude web searches are unchanged.
  • Ran a dev server against a copy of that data and checked the Antigravity thread: the folded header, the group summary, and every row in the expanded group (screenshots above). I fetched the thread snapshot from the server to confirm the projected input carries url and directory_path. I also confirmed the stale header came from the cached client snapshot and cleared after the cache version change.
  • Not exercised: Cursor and Grok search payloads. The data had none, so they're only reclassified when they send a directory_path or url. Without either, they keep today's labels. Mobile wasn't opened in a simulator; it shares the presentation code and its tests pass.
  • vp test run for the projection, shared presentation, client-runtime presentation, web timeline logic, session logic, mobile thread activity, and web/mobile cache storage; typecheck for server, web, mobile, shared, and client-runtime (mobile's only error is in a pre-existing installed copy of the local markdown module); ledger validation.

Written by an agent (Claude Code, claude-opus-5-5).

ACP adapters type every search and page fetch as `web_search`, so
Antigravity's workspace greps and page fetches all read "Searched web" and
counted as web lookups. Fetch rows also lost their URL, because the compact
activity projection dropped ACP's `rawInput`.

Project identifying `rawInput` fields like other providers' tool input, and
use them to present fetches as "Fetched page" with their URL and searches
with a `directory_path` as code searches in row labels, group summaries,
and turn summaries. Claude's WebFetch reads "Fetched page" too instead of
its tool identifier.

Thread caches on web and mobile are bumped so already-viewed threads pick
up the projection change.
@github-actions github-actions Bot added the size:M label Oct 1, 2026
@incognitojam
incognitojam merged commit 9819300 into main Oct 1, 2026
24 checks passed
@incognitojam
incognitojam deleted the styal/acp-search-fetch-labels branch October 1, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant