TypeScript
fix(shared): unwatch, review guide, and task cancel labels read as plain sentences (#19767)
SG181fbb2b464e
diff --git a/packages/client-runtime/src/t3ToolSummary.ts b/packages/client-runtime/src/t3ToolSummary.tsindex 25878d4ff5b..668078191c4 100644--- a/packages/client-runtime/src/t3ToolSummary.ts+++ b/packages/client-runtime/src/t3ToolSummary.ts@@ -405,15 +405,19 @@ export function summarizeT3ToolCalls(const started = outcomes.filter((outcome) => outcome !== "failed").length;const failed = outcomes.length - started;failedCount += failed;- if (outcomes.length > 0 && started === 0) {+ if (outcomes.length === 0) {+ label = phrase(+ "Started writing",+ "start writing",+ `review guides${selected.length === 1 ? "" : ` ${times}`}`,+ );+ } else if (started === 0) {label = `Could not start ${quantity(failed, "review guide")}`;} else {label = phrase("Started","start",- outcomes.length === 0- ? `review guides ${times}`- : `${quantity(started, "review guide")}${failed > 0 ? `, ${failed} failed` : ""}`,+ `${quantity(started, "review guide")}${failed > 0 ? `, ${failed} failed` : ""}`,);}break;diff --git a/packages/client-runtime/src/work-log/presentation.test.ts b/packages/client-runtime/src/work-log/presentation.test.tsindex e5f0acd9d9e..11c4cb78fdf 100644--- a/packages/client-runtime/src/work-log/presentation.test.ts+++ b/packages/client-runtime/src/work-log/presentation.test.ts@@ -375,6 +375,49 @@ describe("resolveWorkEntryToolPresentation", () => {).toBe(completed);});+ it("distinguishes an interrupted unwatch from a completed unwatch", () => {+ const entry = { label: "T3-code.unwatch_pull_request" };+ expect(+ (["inProgress", "stopped", "completed"] as const).map(+ (toolLifecycleStatus) =>+ resolveWorkEntryToolPresentation({ ...entry, toolLifecycleStatus })?.displayName,+ ),+ ).toEqual([+ "Unwatching a pull request",+ "Stopped unwatching a pull request",+ "Stopped watching a pull request",+ ]);+ });++ it("describes starting review-guide writing in rows and groups without outcomes", () => {+ const entry = {+ id: "guides",+ createdAt: "2026-10-07T00:00:00.000Z",+ tone: "tool",+ label: "T3-code.write_pull_request_guides",+ toolLifecycleStatus: "completed",+ } satisfies WorkLogPresentationEntry;+ expect({+ row: resolveWorkEntryToolPresentation(entry)?.displayName,+ single: summarizeToolGroup([entry]).summary,+ repeated: summarizeToolGroup([entry, { ...entry, id: "guides-2" }]).summary,+ }).toEqual({+ row: "Started writing review guides",+ single: "Started writing review guides",+ repeated: "Started writing review guides 2 times",+ });+ });++ it("describes delegated-task cancellation as an ongoing action then a request", () => {+ const entry = { label: "T3-code.task_cancel" };+ expect(+ (["inProgress", "completed"] as const).map(+ (toolLifecycleStatus) =>+ resolveWorkEntryToolPresentation({ ...entry, toolLifecycleStatus })?.displayName,+ ),+ ).toEqual(["Canceling a delegated task", "Requested cancellation of a delegated task"]);+ });+it("summarizes workflow stop targets separately from their parent thread", () => {const entry = {id: "workflow-stop",diff --git a/packages/shared/src/t3McpToolPresentation.ts b/packages/shared/src/t3McpToolPresentation.tsindex b18351cdd2c..8541958758d 100644--- a/packages/shared/src/t3McpToolPresentation.ts+++ b/packages/shared/src/t3McpToolPresentation.ts@@ -106,12 +106,12 @@ const T3_MCP_TOOLS: Readonly<Record<string, T3McpToolDefinition>> = {"pull-request",),unwatch_pull_request: tool(- ["Stop watching", "Stopping watching", "Stopped watching", "a pull request"],+ ["Stop watching", "Unwatching", "Stopped watching", "a pull request"],"unwatch-pr","pull-request",),write_pull_request_guides: tool(- ["Write", "Writing", "Started", "review guides"],+ ["Write", "Writing", "Started writing", "review guides"],"write-pr-guides","pull-request",),@@ -127,7 +127,7 @@ const T3_MCP_TOOLS: Readonly<Record<string, T3McpToolDefinition>> = {delegate_task: tool(["Delegate", "Delegating", "Delegated", "a child task"], "delegate"),task_status: tool(["Get", "Getting", "Got", "delegated task status"], "task-status"),task_cancel: tool(- ["Cancel", "Canceling", "Requested cancellation of", "delegated task"],+ ["Cancel", "Canceling", "Requested cancellation of", "a delegated task"],"task-cancel",),schedule_task: tool(