@agentv/core 3.9.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1575,6 +1575,7 @@ __export(index_exports, {
1575
1575
  extractTargetsFromSuite: () => extractTargetsFromSuite,
1576
1576
  extractTargetsFromTestCase: () => extractTargetsFromTestCase,
1577
1577
  extractTrialsConfig: () => extractTrialsConfig,
1578
+ extractWorkersFromSuite: () => extractWorkersFromSuite,
1578
1579
  fileExists: () => fileExists2,
1579
1580
  findGitRoot: () => findGitRoot,
1580
1581
  freeformEvaluationSchema: () => freeformEvaluationSchema,
@@ -2256,6 +2257,17 @@ function extractTargetsFromSuite(suite) {
2256
2257
  }
2257
2258
  return void 0;
2258
2259
  }
2260
+ function extractWorkersFromSuite(suite) {
2261
+ const execution = suite.execution;
2262
+ if (!execution || typeof execution !== "object" || Array.isArray(execution)) {
2263
+ return void 0;
2264
+ }
2265
+ const workers = execution.workers;
2266
+ if (typeof workers === "number" && Number.isInteger(workers) && workers >= 1 && workers <= 50) {
2267
+ return workers;
2268
+ }
2269
+ return void 0;
2270
+ }
2259
2271
  function extractTargetsFromTestCase(testCase) {
2260
2272
  const execution = testCase.execution;
2261
2273
  if (!execution || typeof execution !== "object" || Array.isArray(execution)) {
@@ -4556,6 +4568,7 @@ async function loadTestSuite(evalFilePath, repoRoot, options) {
4556
4568
  tests,
4557
4569
  trials: extractTrialsConfig(parsed),
4558
4570
  targets: extractTargetsFromSuite(parsed),
4571
+ workers: extractWorkersFromSuite(parsed),
4559
4572
  cacheConfig: extractCacheConfig(parsed),
4560
4573
  totalBudgetUsd: extractTotalBudgetUsd(parsed),
4561
4574
  ...metadata !== void 0 && { metadata },
@@ -17790,14 +17803,22 @@ async function runEvaluation(options) {
17790
17803
  const usePool = poolEnabled !== false && !!suiteWorkspace?.repos?.length && !isPerTestIsolation && !useStaticWorkspace;
17791
17804
  const resolvedRetainOnSuccess = retainOnSuccess ?? (keepWorkspaces ? "keep" : "cleanup");
17792
17805
  const resolvedRetainOnFailure = retainOnFailure ?? (cleanupWorkspaces ? "cleanup" : "keep");
17793
- const requestedWorkers = options.maxConcurrency ?? target.workers ?? 1;
17794
- const workers = hasSharedWorkspace && !usePool ? 1 : requestedWorkers;
17806
+ const workers = options.maxConcurrency ?? target.workers ?? 1;
17795
17807
  setupLog(
17796
- `sharedWorkspace=${hasSharedWorkspace} perTestIsolation=${isPerTestIsolation} usePool=${usePool} requestedWorkers=${requestedWorkers} effectiveWorkers=${workers}`
17808
+ `sharedWorkspace=${hasSharedWorkspace} perTestIsolation=${isPerTestIsolation} usePool=${usePool} workers=${workers}`
17797
17809
  );
17798
- if (hasSharedWorkspace && !usePool && requestedWorkers > 1) {
17810
+ if (hasSharedWorkspace && !usePool && workers > 1) {
17799
17811
  console.warn(
17800
- `Warning: Shared workspace requires sequential execution. Overriding workers from ${requestedWorkers} to 1.`
17812
+ [
17813
+ `Warning: This eval uses a shared workspace with ${workers} workers.`,
17814
+ "If the agent under test makes file edits, concurrent runs may corrupt each other.",
17815
+ "To limit concurrency, add this to your eval YAML:",
17816
+ "",
17817
+ " execution:",
17818
+ " workers: 1",
17819
+ "",
17820
+ "Or pass --workers 1 on the command line."
17821
+ ].join("\n")
17801
17822
  );
17802
17823
  }
17803
17824
  const limit = pLimit(workers);
@@ -20408,6 +20429,7 @@ function createAgentKernel() {
20408
20429
  extractTargetsFromSuite,
20409
20430
  extractTargetsFromTestCase,
20410
20431
  extractTrialsConfig,
20432
+ extractWorkersFromSuite,
20411
20433
  fileExists,
20412
20434
  findGitRoot,
20413
20435
  freeformEvaluationSchema,