Skip to content

Commit b9f4464

Browse files
t3dotggclaude
andcommitted
fix(clients): group legacy image reads with reads
Rows recorded before image classification keep `dynamic_tool_call` as their item type. They now render the image but still grouped as "Used 1 tool" with the generic icon. Treat any entry with a `viewedImagePath` as a read. Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent 2387b4e commit b9f4464

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎packages/client-runtime/src/work-log/presentation.test.ts‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { describe, expect, it } from "vite-plus/test";
22

33
import { ThreadId } from "@t3tools/contracts";
44

5-
import { resolveViewedImageAsset, workEntryViewedImagePath } from "./presentation.js";
5+
import {
6+
resolveViewedImageAsset,
7+
toolGroupAction,
8+
workEntryViewedImagePath,
9+
} from "./presentation.js";
610

711
describe("workEntryViewedImagePath", () => {
812
const entry = { label: "Read", tone: "tool" } as const;
@@ -40,6 +44,19 @@ describe("workEntryViewedImagePath", () => {
4044
});
4145
});
4246

47+
describe("toolGroupAction", () => {
48+
it("groups legacy Claude image reads with other reads", () => {
49+
expect(
50+
toolGroupAction({
51+
label: "Tool call",
52+
tone: "tool",
53+
itemType: "dynamic_tool_call",
54+
viewedImagePath: "/workspace/reference.png",
55+
}),
56+
).toBe("read");
57+
});
58+
});
59+
4360
describe("resolveViewedImageAsset", () => {
4461
const threadId = ThreadId.make("thread-1");
4562

‎packages/client-runtime/src/work-log/presentation.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export function toolGroupAction(entry: WorkLogPresentationEntry): ToolGroupActio
6969
if (
7070
entry.requestKind === "file-read" ||
7171
entry.itemType === "image_view" ||
72+
entry.viewedImagePath !== undefined ||
7273
(entry.itemType === "dynamic_tool_call" &&
7374
entry.toolTitle?.trim().toLowerCase() === "read file")
7475
) {

0 commit comments

Comments
 (0)