Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(client): skip irrelevant exit-code scans in tool output #12782

Closedrobertnisipeanu(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/12782/headopened View on GitHub

Showing 2 changed files with 56 additions and 3 deletions.

x
0 of 2 viewed, 2 left
52 additions and 0 deletionspackages/client-runtime/src/work-log/presentation.test.tsModified
View file
@@ -86,6 +86,58 @@
).toBe(false);
});
​
+ it.each([
+ "FILE NOT FOUND",
+ "No files found",
+ "ENOENT",
+ "No such file or directory",
+ "No such file",
+ "CommandNotFoundException",
+ "Command not found",
+ "Cannot find path 'example'\nbecause it does not exist",
+ "The term 'example'\nis not recognized",
+ "Is not recognized as the name of a cmdlet",
+ "A parameter cannot be found that matches parameter name",
+ "<exited with exit code 12>",
+ "Exited with exit code\t2",
+ "Exit with exit code 1",
+ "Exit code: 9",
+ "Exit code\n3",
+ ])("detects an error after a long successful output: %s", (error) => {
+ const entry = {
+ ...base,
+ tone: "tool" as const,
+ toolLifecycleStatus: "completed",
+ detail: `${"Synthetic successful output.\n".repeat(512)}${error}`,
+ };
+ expect(workEntryIndicatesToolFailure(entry)).toBe(true);
+ expect(workEntryDisplayIndicatesToolFailure(entry)).toBe(true);