Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/client-runtime/src/t3ToolSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
43 changes: 43 additions & 0 deletions packages/client-runtime/src/work-log/presentation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/src/t3McpToolPresentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
Expand All @@ -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(
Expand Down
Loading