From 9f9bcfe231e41b6289bf4aeb93c7f3bcb3e911f3 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 27 Apr 2026 23:47:23 +0100 Subject: [PATCH] perf: reduce hot test imports and duplicate scans --- src/agents/bash-tools.exec-runtime.ts | 5 ++++- test/scripts/test-live-shard.test.ts | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/agents/bash-tools.exec-runtime.ts b/src/agents/bash-tools.exec-runtime.ts index deb20bced03..2b66c11d028 100644 --- a/src/agents/bash-tools.exec-runtime.ts +++ b/src/agents/bash-tools.exec-runtime.ts @@ -27,7 +27,10 @@ import { logWarn } from "../logger.js"; import type { ManagedRun } from "../process/supervisor/index.js"; import { getProcessSupervisor } from "../process/supervisor/index.js"; import type { RunExit, TerminationReason } from "../process/supervisor/types.js"; -import { normalizeDeliveryContext, type DeliveryContext } from "../utils/delivery-context.js"; +import { + normalizeDeliveryContext, + type DeliveryContext, +} from "../utils/delivery-context.shared.js"; import { addSession, appendOutput, diff --git a/test/scripts/test-live-shard.test.ts b/test/scripts/test-live-shard.test.ts index f4c16db286c..8e4d112ba6c 100644 --- a/test/scripts/test-live-shard.test.ts +++ b/test/scripts/test-live-shard.test.ts @@ -6,8 +6,9 @@ import { } from "../../scripts/test-live-shard.mjs"; describe("scripts/test-live-shard", () => { + const allFiles = collectAllLiveTestFiles(); + it("partitions every native live test into exactly one release shard", () => { - const allFiles = collectAllLiveTestFiles(); const selected = LIVE_TEST_SHARDS.flatMap((shard) => selectLiveShardFiles(shard, allFiles).map((file) => ({ file, shard })), ); @@ -19,8 +20,6 @@ describe("scripts/test-live-shard", () => { }); it("keeps slow gateway backend and media-capable extension files in their own shards", () => { - const allFiles = collectAllLiveTestFiles(); - expect(selectLiveShardFiles("native-live-src-gateway-backends", allFiles)).toEqual( expect.arrayContaining([ "src/gateway/gateway-acp-bind.live.test.ts",