Skip to content

Commit 4658b63

Browse files
committed
fix(tests): recheck abort after lazy handler load; list script tests by file
1 parent 5c51db6 commit 4658b63

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

apps/sim/lib/copilot/request/tools/executor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ async function executeToolAndReportInner(
505505
})
506506
}
507507

508+
// Loads the handler map on first use; the abort check below covers that wait.
509+
await ensureHandlersRegistered()
508510
if (abortRequested(context, execContext, options)) {
509511
markToolCallCancelled('Request aborted before tool execution')
510512
markToolResultSeen(toolCall.id)
@@ -608,7 +610,6 @@ async function executeToolAndReportInner(
608610
}
609611

610612
try {
611-
await ensureHandlersRegistered()
612613
let result = await executeToolWithWatchdog(toolCall, toolExecutionContext)
613614
if (toolCall.endTime || isTerminalToolCallStatus(toolCall.status)) {
614615
endToolSpanFromTerminalState()

scripts/check-script-test-coverage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ if (!reachableScripts('test').has('test:scripts')) {
4242
}
4343

4444
const listed = Bun.spawnSync(
45-
['bunx', 'vitest', 'list', '--json', '--config', 'vitest.scripts.config.ts'],
45+
['bunx', 'vitest', 'list', '--json', '--filesOnly', '--config', 'vitest.scripts.config.ts'],
4646
{
4747
cwd: ROOT,
4848
}
@@ -53,7 +53,7 @@ if (listed.exitCode !== 0) {
5353
}
5454
const collected = new Set(
5555
(JSON.parse(listed.stdout.toString()) as Array<{ file: string }>).map((entry) =>
56-
path.relative(ROOT, entry.file)
56+
path.relative(ROOT, entry.file).split(path.sep).join('/')
5757
)
5858
)
5959

0 commit comments

Comments
 (0)