Skip to content

Commit a71b297

Browse files
christsoclaude
andcommitted
fix(core): allow use_target in targets-file.ts parser
Third place that validated provider as required. This is exactly the brittle duplication that #909 will fix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b19efb3 commit a71b297

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/core/src/evaluation/providers/targets-file.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ function assertTargetDefinition(value: unknown, index: number, filePath: string)
3232
);
3333
}
3434

35-
if (typeof provider !== 'string' || provider.trim().length === 0) {
36-
throw new Error(`targets.yaml entry '${name}' in ${filePath} is missing a valid 'provider'`);
35+
const hasUseTarget = typeof value.use_target === 'string' && value.use_target.trim().length > 0;
36+
if (!hasUseTarget && (typeof provider !== 'string' || provider.trim().length === 0)) {
37+
throw new Error(
38+
`targets.yaml entry '${name}' in ${filePath} is missing a valid 'provider' (or use use_target for delegation)`,
39+
);
3740
}
3841

3942
// Pass through all properties from the YAML to support the flattened schema

0 commit comments

Comments
 (0)