Skip to content

Commit a042adc

Browse files
committed
extend default timeout on commands to 10s.
1 parent 7ea5414 commit a042adc

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/tools/system/shellStart.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("shellStartTool", () => {
2323
description: "Test process",
2424
timeout: 500, // Generous timeout to ensure sync mode
2525
},
26-
{ logger },
26+
{ logger }
2727
);
2828

2929
expect(result.mode).toBe("sync");
@@ -41,7 +41,7 @@ describe("shellStartTool", () => {
4141
description: "Slow command test",
4242
timeout: 50, // Short timeout to force async mode
4343
},
44-
{ logger },
44+
{ logger }
4545
);
4646

4747
expect(result.mode).toBe("async");
@@ -57,7 +57,7 @@ describe("shellStartTool", () => {
5757
command: "nonexistentcommand",
5858
description: "Invalid command test",
5959
},
60-
{ logger },
60+
{ logger }
6161
);
6262

6363
expect(result.mode).toBe("sync");
@@ -75,7 +75,7 @@ describe("shellStartTool", () => {
7575
description: "Sync completion test",
7676
timeout: 500,
7777
},
78-
{ logger },
78+
{ logger }
7979
);
8080

8181
// Even sync results should be in processStates
@@ -88,7 +88,7 @@ describe("shellStartTool", () => {
8888
description: "Async completion test",
8989
timeout: 50,
9090
},
91-
{ logger },
91+
{ logger }
9292
);
9393

9494
if (asyncResult.mode === "async") {
@@ -103,7 +103,7 @@ describe("shellStartTool", () => {
103103
description: "Pipe test",
104104
timeout: 50, // Force async for interactive command
105105
},
106-
{ logger },
106+
{ logger }
107107
);
108108

109109
expect(result.mode).toBe("async");
@@ -130,15 +130,15 @@ describe("shellStartTool", () => {
130130
}
131131
});
132132

133-
it("should use default timeout of 100ms", async () => {
133+
it("should use default timeout of 10000ms", async () => {
134134
const result = await shellStartTool.execute(
135135
{
136136
command: "sleep 1",
137137
description: "Default timeout test",
138138
},
139-
{ logger },
139+
{ logger }
140140
);
141141

142-
expect(result.mode).toBe("async");
142+
expect(result.mode).toBe("sync");
143143
});
144144
});

src/tools/system/shellStart.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const parameterSchema = z.object({
2929
timeout: z
3030
.number()
3131
.optional()
32-
.describe("Timeout in ms before switching to async mode (default: 100ms)"),
32+
.describe(
33+
"Timeout in ms before switching to async mode (default: 10s, which usually is sufficient)"
34+
),
3335
});
3436

3537
const returnSchema = z.union([
@@ -58,7 +60,7 @@ const returnSchema = z.union([
5860
type Parameters = z.infer<typeof parameterSchema>;
5961
type ReturnType = z.infer<typeof returnSchema>;
6062

61-
const DEFAULT_TIMEOUT = 100;
63+
const DEFAULT_TIMEOUT = 1000 * 10;
6264

6365
export const shellStartTool: Tool<Parameters, ReturnType> = {
6466
name: "shellStart",

0 commit comments

Comments
 (0)