Skip to content

fix(v2): show read and search tool activity accurately - #13375

Merged
Yash-Singh1 merged 13 commits into
t3code/codex-turn-mappingfrom
yash/v2-port-fixes
Sep 27, 2026
Merged

Yash-Singh1 merged 13 commits into
t3code/codex-turn-mappingfrom
yash/v2-port-fixes

Conversation

@Yash-Singh1

@Yash-Singh1 Yash-Singh1 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

V2 loses or mislabels some provider tool calls. Read and search activity can appear as a generic --- file, a write, or a tool with no useful path. Expanded read entries can show file contents or projection metadata instead of the request and result.

Preserve structured tool inputs through the ACP, Claude, Cursor, and OpenCode adapters. Classify read and search calls from their tool identity and arguments, then show clear titles, paths, and expanded details in web and mobile. Keep grouped tool rows aligned with the corrected labels. OpenCode codesearch now emits a code search turn item, while websearch remains a web search.

Before and after

These screenshots use a seeded local Cursor activity thread. The web and mobile captures cover the visible group summary, tool classification, and expanded read and search details.

Web group summary

Before After
Web group summary before Web group summary after

Web expanded tool details

Before After
Web expanded read and search details before Web expanded read and search details after

Mobile tool rows

Before After
Mobile tool rows before Mobile tool rows after

Mobile expanded read

Before After
Mobile expanded read before Mobile expanded read after

Verification

  • 645 focused tests passed across the shared tool classifier, client presentation, web and mobile activity, and provider adapters. The follow-up OpenCode adapter test run passed all 45 tests, including an emitted codesearch and websearch pair.
  • Targeted server, web, and mobile typechecks and lint passed. Formatting and git diff --check passed.
  • Web and iOS UI flows were inspected against the seeded thread after the icon change. The replacement after screenshots show the eye icon on read rows and expanded details.

Model: GPT-6. Harness: Codex.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Sep 24, 2026
Comment thread apps/web/src/session-logic.ts
Comment thread packages/shared/src/toolActivity.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRuntimeModel.ts
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.1 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅
Codex Live turn messages — 1 — 8 ✅
Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: 6478aa4 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This is a broad cross-layer change to provider projections, shared activity classification, and web/mobile rendering, including a changed internal representation for read operations. Although well covered by tests and focused on correcting activity display, the breadth and existing-path behavior changes warrant human review.

You can add or adjust custom eligibility rules. Learn more.

Comment thread packages/shared/src/toolActivity.ts
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 2 times, most recently from 6448cfe to 1563a64 Compare September 24, 2026 23:21
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from fe4f6ad to 87c67bd Compare September 25, 2026 05:55

@juliusmarminge juliusmarminge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the read/search labels are a real improvement, and the change is still needed on the current V2 branch. None of the ~90 commits since your base touched read/search classification: Claude Grep still renders as "Grep" with a wrench, and Cursor/Grok reads still show as "Searched files".

I merged the current t3code/codex-turn-mapping head into a scratch copy of this branch. It merges cleanly, and I found no semantic conflicts with what landed since (#13725 folds, #13790 stopped rows, #13806 Cursor stopped status, the per-turn item-ordinal maps). On that merge, tsc is clean in all six packages, the PR's own tests pass (web 180, mobile 75, client-runtime 93, shared 8, adapters 339), the replay suite is 96/96, and knip is clean. The only textual conflict is with the open #13140, in workEntryDisplayLabel.

Two things need fixing before merge (inline):

  1. Mobile approval rows regress. A file-read approval shows "Read file" instead of its prompt and can't be expanded, and command/file-change approvals summarize as "Ran 1 command, changed 1 file" although nothing ran.
  2. OpenCode codesearch is not a file search. It was a web code-context tool (query + tokens, no path), OpenCode removed it upstream in May, and 1.18.32 doesn't ship it. The test invents a path for it.

Smaller, non-blocking notes are inline too: two pieces of dead code, a lone web search losing its "Web search" label, multi-line approval prompts, and MCP tool names.

On tests: nothing in the replay suite asserts the new "Read …" / "Searched …" titles. Adding title assertions to the tool_call_read_only Claude and Cursor replay outputs would prove the change better than the new adapter unit tests, and OpenCode read/grep have no replay coverage at all. The ACP mock-agent frames for late locations and empty rawInput resends don't appear in any of the 23 recorded Grok/registry transcripts, so I'd drop them unless a real transcript shows them.

Not verified: live providers and a real web/mobile UI pass.

Comment thread packages/client-runtime/src/work-log/presentation.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRuntimeModel.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/CursorAdapterV2.ts
Comment thread packages/shared/src/toolActivity.ts
OpenCode's codesearch was Exa's web code-context API and the adapter
already gates it as a network tool, so it should not project as a
workspace file search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts
Yash-Singh1 and others added 3 commits September 27, 2026 00:03
Approvals and questions describe requested work, so they no longer
classify as commands, edits, or reads. Mobile only applies the read
label and path-only expansion to dynamic tool reads, so a file-read
approval keeps its prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop ACP tool-call identity checks that V2 never reaches, and the
  mock-agent frames no recorded transcript shows.
- Remove unreachable Cursor read branches in the search helpers.
- Leave server-prefixed MCP tool names unclassified.
- Keep multi-line prompts as labels; only search output is skipped.
- Restore the heading for a lone web search row.
- Cover OpenCode read and grep titles in the adapter test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts
Yash-Singh1 and others added 2 commits September 27, 2026 00:22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
File search items only carry the pattern, so recomputing the label on
the client dropped the "in <dir>" part the adapter already put in the
item title. Web and mobile now use that title for file search rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Yash-Singh1
Yash-Singh1 merged commit a3fbbe4 into t3code/codex-turn-mapping Sep 27, 2026
25 checks passed
@Yash-Singh1
Yash-Singh1 deleted the yash/v2-port-fixes branch September 27, 2026 06:57
@Yash-Singh1
Yash-Singh1 restored the yash/v2-port-fixes branch September 27, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants