




























@@ -246,6 +246,26 @@ test("background exec without explicit timeout applies default timeout", async (
246246});
247247});
248248249+test("background exec with timeout zero bypasses default timeout", async () => {
250+const tool = createTestExecTool({
251+allowBackground: true,
252+backgroundMs: 0,
253+timeoutSec: BACKGROUND_TIMEOUT_SEC,
254+});
255+const result = await tool.execute("toolcall", {
256+command: BACKGROUND_HOLD_CMD,
257+background: true,
258+timeout: 0,
259+});
260+expect(result.details.status).toBe("running");
261+const sessionId = (result.details as { sessionId: string }).sessionId;
262+expect(supervisorMockState.spawnInputs.at(-1)?.timeoutMs).toBeUndefined();
263+expect(getFinishedSession(sessionId)).toBeUndefined();
264+expect(getSession(sessionId)?.exited).toBe(false);
265+266+cleanupRunningSession(sessionId);
267+});
268+249269test("yielded background exec still times out", async () => {
250270const tool = createTestExecTool({ allowBackground: true, backgroundMs: 10 });
251271await expectBackgroundSessionTimesOut({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。