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 f1d8c0c904bc..5db51778eab7 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}`