TypeScript
perf(web): reasoning rows skip the tool-failure text scan (#21146)
Julius Marmingee0366ad0e41c
diff --git a/packages/client-runtime/src/work-log/presentation.test.ts b/packages/client-runtime/src/work-log/presentation.test.tsindex 212d6600cdf..e5f0acd9d9e 100644--- a/packages/client-runtime/src/work-log/presentation.test.ts+++ b/packages/client-runtime/src/work-log/presentation.test.ts@@ -78,6 +78,19 @@ describe("workEntryIndicatesToolFailure", () => {},);+ it("ignores failure phrases in reasoning text", () => {+ const entry: WorkLogPresentationEntry = {+ ...base,+ label: "Thinking",+ tone: "thinking",+ itemType: "reasoning",+ toolLifecycleStatus: "completed",+ detail: "That exit code 2 is just from listing the deleted directory, which is expected.",+ };+ expect(workEntryIndicatesToolFailure(entry)).toBe(false);+ expect(workEntryDisplayIndicatesToolFailure(entry)).toBe(false);+ });+it("is true for error tone", () => {expect(workEntryIndicatesToolFailure({diff --git a/packages/client-runtime/src/work-log/presentation.ts b/packages/client-runtime/src/work-log/presentation.tsindex 727f1b4ccde..e05b1392656 100644--- a/packages/client-runtime/src/work-log/presentation.ts+++ b/packages/client-runtime/src/work-log/presentation.ts@@ -365,7 +365,10 @@ function workEntryIndicatesToolFailureFromOutput() {return true;}- if (!workLogEntryIsToolLike(entry)) return false;+ // Reasoning detail is the model's own prose (often tens of KB), not tool+ // output: scanning it is slow on long threads and misreads phrases like+ // "that exit code 2 is expected" as a failed tool.+ if (!workLogEntryIsToolLike(entry) || entry.itemType === "reasoning") return false;if (resolveT3McpToolDefinition(workEntryToolName(entry)) &&t3ToolResultIndicatesFailure(workEntryToolOutput(entry))