From 5af4904211150100762b63f93cb5cd96e7dc9a5d Mon Sep 17 00:00:00 2001 From: The-AarushiSingh <175547726+The-AarushiSingh@users.noreply.github.com> Date: Thu, 3 Sep 2026 18:05:47 +0530 Subject: [PATCH] test(execution): fix flaky tool-invoker test - Add timeout: 10000 to prevent CI timeouts - Add changeset for @executor-js/execution Closes #1928 --- .changeset/tool-invoker-test-timeout.md | 5 ++ .../core/execution/src/tool-invoker.test.ts | 65 ++++++++++--------- 2 files changed, 39 insertions(+), 31 deletions(-) create mode 100644 .changeset/tool-invoker-test-timeout.md diff --git a/.changeset/tool-invoker-test-timeout.md b/.changeset/tool-invoker-test-timeout.md new file mode 100644 index 0000000000..032b60f1bc --- /dev/null +++ b/.changeset/tool-invoker-test-timeout.md @@ -0,0 +1,5 @@ +--- +"@executor-js/execution": patch +--- + +Give the sandbox describe/invoke contract test a 10s timeout so it does not flake on slow CI. diff --git a/packages/core/execution/src/tool-invoker.test.ts b/packages/core/execution/src/tool-invoker.test.ts index 747bd23105..cf24e2922f 100644 --- a/packages/core/execution/src/tool-invoker.test.ts +++ b/packages/core/execution/src/tool-invoker.test.ts @@ -905,39 +905,42 @@ describe("tool discovery", () => { }), ); - it.effect("describes a return type that accepts the sandbox invocation result", () => - Effect.gen(function* () { - const executor = yield* makeSearchExecutor(); - const engine = createExecutionEngine({ executor, codeExecutor }); + it.effect( + "describes a return type that accepts the sandbox invocation result", + () => + Effect.gen(function* () { + const executor = yield* makeSearchExecutor(); + const engine = createExecutionEngine({ executor, codeExecutor }); - const execution = yield* engine.execute( - [ - 'const details = await tools.describe.tool({ path: "github.org.main.getRepositoryDetails" });', - "const result = await tools.github.org.main.getRepositoryDetails({ owner: 'executor', repo: 'executor' });", - "return {", - " outputTypeScript: details.outputTypeScript,", - " typeScriptDefinitions: details.typeScriptDefinitions,", - " result,", - "};", - ].join("\n"), - { onElicitation: acceptAll }, - ); + const execution = yield* engine.execute( + [ + 'const details = await tools.describe.tool({ path: "github.org.main.getRepositoryDetails" });', + "const result = await tools.github.org.main.getRepositoryDetails({ owner: 'executor', repo: 'executor' });", + "return {", + " outputTypeScript: details.outputTypeScript,", + " typeScriptDefinitions: details.typeScriptDefinitions,", + " result,", + "};", + ].join("\n"), + { onElicitation: acceptAll }, + ); - expect(execution.error).toBeUndefined(); - const observed = execution.result as DescribedToolContract & { readonly result: unknown }; - const diagnostics = typeCheckDescribedInvocation( - observed, - observed.result, - [ - "function readDefaultBranch(result: ToolOutput): string {", - " if (!result.ok) return result.error.message;", - " return result.data.defaultBranch;", - "}", - "readDefaultBranch(invokedResult);", - ].join("\n"), - ); - expect(diagnostics).toEqual([]); - }), + expect(execution.error).toBeUndefined(); + const observed = execution.result as DescribedToolContract & { readonly result: unknown }; + const diagnostics = typeCheckDescribedInvocation( + observed, + observed.result, + [ + "function readDefaultBranch(result: ToolOutput): string {", + " if (!result.ok) return result.error.message;", + " return result.data.defaultBranch;", + "}", + "readDefaultBranch(invokedResult);", + ].join("\n"), + ); + expect(diagnostics).toEqual([]); + }), + { timeout: 10000 }, ); it.effect(