The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 05:30 UTC
perf(web): reasoning rows skip the tool-failure text scan (#21146)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 18, 2026 at 02:12 UTC
e0366ad0e41ccf8a22d8faa665c96fd469d891ce
2 files changed
+17
-1
packages/client-runtime/src/work-log/presentation.test.ts
+13
@@ -78,6 +78,19 @@ describe("workEntryIndicatesToolFailure", () => {
78
},
79
);
80
81
+ it("ignores failure phrases in reasoning text", () => {
82
+ const entry: WorkLogPresentationEntry = {
83
+ ...base,
84
+ label: "Thinking",
85
+ tone: "thinking",
86
+ itemType: "reasoning",
87
+ toolLifecycleStatus: "completed",
88
+ detail: "That exit code 2 is just from listing the deleted directory, which is expected.",
89
+ };
90
+ expect(workEntryIndicatesToolFailure(entry)).toBe(false);
91
+ expect(workEntryDisplayIndicatesToolFailure(entry)).toBe(false);
92
+ });
93
+
94
it("is true for error tone", () => {
95
expect(
96
workEntryIndicatesToolFailure({
packages/client-runtime/src/work-log/presentation.ts
+4
-1
@@ -365,7 +365,10 @@ function workEntryIndicatesToolFailureFromOutput(
365
) {
366
return true;
367
}
368
- if (!workLogEntryIsToolLike(entry)) return false;
368
+ // Reasoning detail is the model's own prose (often tens of KB), not tool
369
+ // output: scanning it is slow on long threads and misreads phrases like
370
+ // "that exit code 2 is expected" as a failed tool.
371
+ if (!workLogEntryIsToolLike(entry) || entry.itemType === "reasoning") return false;
372
if (
373
resolveT3McpToolDefinition(workEntryToolName(entry)) &&
374
t3ToolResultIndicatesFailure(workEntryToolOutput(entry))