From c0bb2575a5f9a59f4554ecc3a5a314658ab62a9c Mon Sep 17 00:00:00 2001 From: filip <44206832+filipkujawa@users.noreply.github.com> Date: Wed, 5 Aug 2026 10:13:34 -0700 Subject: [PATCH] test: early-exit code-exec smoke tests once tool invocation is observed (#10954) --- .../test_providers_code_exec.test.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ui/desktop/tests/integration/test_providers_code_exec.test.ts b/ui/desktop/tests/integration/test_providers_code_exec.test.ts index f1d8c0c90..5db51778e 100644 --- a/ui/desktop/tests/integration/test_providers_code_exec.test.ts +++ b/ui/desktop/tests/integration/test_providers_code_exec.test.ts @@ -22,6 +22,13 @@ beforeAll(() => { const { testAll } = providerTest(discoverTestCases({ skipAgentic: true })); +// Matches: "execute_typescript | code_execution", "get_function_details | code_execution", +// "tool call | execute", "tool calls | execute" (old format) +// "▸ execute N tool call" (new format with tool_graph) +// "▸ execute_typescript" (plain tool name in output) +const codeExecPattern = + /(execute_typescript \| code_execution)|(get_function_details \| code_execution)|(tool calls? \| execute)|(▸.*execute.*tool call)|(▸ execute_typescript)/; + testAll('invokes code_execution tool', async (tc, { expect }) => { const testdir = fs.mkdtempSync(path.join(os.tmpdir(), 'goose-codeexec-')); try { @@ -30,16 +37,11 @@ testAll('invokes code_execution tool', async (tc, { expect }) => { testdir, "Store a memory with category 'test' and data 'hello world', then retrieve all memories from category 'test'.", BUILTINS, - { GOOSE_PROVIDER: tc.provider, GOOSE_MODEL: tc.model } + { GOOSE_PROVIDER: tc.provider, GOOSE_MODEL: tc.model }, + 55_000, + (output) => codeExecPattern.test(output) ); - // Matches: "execute_typescript | code_execution", "get_function_details | code_execution", - // "tool call | execute", "tool calls | execute" (old format) - // "▸ execute N tool call" (new format with tool_graph) - // "▸ execute_typescript" (plain tool name in output) - const codeExecPattern = - /(execute_typescript \| code_execution)|(get_function_details \| code_execution)|(tool calls? \| execute)|(▸.*execute.*tool call)|(▸ execute_typescript)/; - expect( codeExecPattern.test(output), `Expected code_execution tool to be called\n\nFull output:\n${output}`