From d3074096e8b0ed45e9974c1a9c6a55e1947fdc77 Mon Sep 17 00:00:00 2001 From: ali Date: Tue, 17 Feb 2026 23:10:01 +0200 Subject: [PATCH] fix always execute capture perf for external runner --- codeflash/version.py | 2 +- packages/codeflash/runtime/capture.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/codeflash/version.py b/codeflash/version.py index 6d60ab0c2..6225467e3 100644 --- a/codeflash/version.py +++ b/codeflash/version.py @@ -1,2 +1,2 @@ # These version placeholders will be replaced by uv-dynamic-versioning during build. -__version__ = "0.20.0.post510.dev0+b8932209" +__version__ = "0.20.0" diff --git a/packages/codeflash/runtime/capture.js b/packages/codeflash/runtime/capture.js index 0fdcc5784..0b6180130 100644 --- a/packages/codeflash/runtime/capture.js +++ b/packages/codeflash/runtime/capture.js @@ -710,12 +710,12 @@ function capturePerf(funcName, lineId, fn, ...args) { for (let batchIndex = 0; batchIndex < batchSize; batchIndex++) { // Check shared time limit BEFORE each iteration - if (shouldLoop && checkSharedTimeLimit()) { + if (!hasExternalLoopRunner && shouldLoop && checkSharedTimeLimit()) { break; } // Check if this invocation has already reached stability - if (getPerfStabilityCheck() && sharedPerfState.stableInvocations[invocationKey]) { + if (!hasExternalLoopRunner && getPerfStabilityCheck() && sharedPerfState.stableInvocations[invocationKey]) { break; } @@ -724,7 +724,7 @@ function capturePerf(funcName, lineId, fn, ...args) { // Check if we've exceeded max loops for this invocation const totalIterations = getTotalIterations(invocationKey); - if (totalIterations > getPerfLoopCount()) { + if (!hasExternalLoopRunner && totalIterations > getPerfLoopCount()) { break; } @@ -776,7 +776,7 @@ function capturePerf(funcName, lineId, fn, ...args) { } // Check stability after accumulating enough samples - if (getPerfStabilityCheck() && runtimes.length >= getPerfMinLoops()) { + if (!hasExternalLoopRunner && getPerfStabilityCheck() && runtimes.length >= getPerfMinLoops()) { const window = getStabilityWindow(); if (shouldStopStability(runtimes, window, getPerfMinLoops())) { sharedPerfState.stableInvocations[invocationKey] = true; @@ -785,7 +785,7 @@ function capturePerf(funcName, lineId, fn, ...args) { } // If we had an error, stop looping - if (lastError) { + if (!hasExternalLoopRunner && lastError) { break; } }