Skip to content

Commit 3d2d671

Browse files
authored
fix: allow code-based evaluators in online eval configs (#947)
* fix: allow code-based evaluators in online eval configs Remove restrictions that blocked code-based evaluators from being used in online evaluation configs. The service now supports code-based evaluators for online evaluation. Changes: - Remove code-based evaluator block in OnlineEvalConfigPrimitive - Remove code-based evaluator validation in schema superRefine - Remove code-based evaluator filter in TUI evaluator picker * style: fix prettier formatting
1 parent cb1e81a commit 3d2d671

3 files changed

Lines changed: 6 additions & 32 deletions

File tree

src/cli/primitives/OnlineEvalConfigPrimitive.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,18 +211,6 @@ export class OnlineEvalConfigPrimitive extends BasePrimitive<AddOnlineEvalConfig
211211

212212
this.checkDuplicate(project.onlineEvalConfigs, options.name, 'Online eval config');
213213

214-
// Block code-based evaluators — only LLM-as-a-Judge evaluators are supported for online evaluation.
215-
// Checks local project config. ARN-based evaluators are filtered in the TUI by API evaluatorType.
216-
// TODO: For ARN-based evaluators in non-interactive mode, call getEvaluator to check type.
217-
for (const evalName of options.evaluators) {
218-
const evaluator = project.evaluators.find(e => e.name === evalName);
219-
if (evaluator?.config.codeBased) {
220-
throw new Error(
221-
`Code-based evaluator "${evalName}" cannot be used in online eval configs. Only LLM-as-a-Judge evaluators are supported for online evaluation.`
222-
);
223-
}
224-
}
225-
226214
const config: OnlineEvalConfig = {
227215
name: options.name,
228216
agent: options.agent,

src/cli/tui/screens/online-eval/AddOnlineEvalFlow.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,12 @@ export function AddOnlineEvalFlow({ isInteractive = true, onExit, onBack, onDev,
4848
const result = await listEvaluators({ region });
4949
if (cancelled) return;
5050

51-
// Filter out code-based evaluators — not supported for online evaluation.
52-
// Check both the API response type ('CustomCode') and local config (codeBased).
53-
const codeBasedNames = new Set(projectSpec.evaluators.filter(e => e.config.codeBased).map(e => e.name));
54-
const items: EvaluatorItem[] = result.evaluators
55-
.filter(e => e.evaluatorType !== 'CustomCode' && !codeBasedNames.has(e.evaluatorName))
56-
.map(e => ({
57-
arn: e.evaluatorArn,
58-
name: e.evaluatorName,
59-
type: e.evaluatorType,
60-
description: e.description,
61-
}));
51+
const items: EvaluatorItem[] = result.evaluators.map(e => ({
52+
arn: e.evaluatorArn,
53+
name: e.evaluatorName,
54+
type: e.evaluatorType,
55+
description: e.description,
56+
}));
6257

6358
const agentNames = projectSpec.runtimes.map(a => a.name);
6459

src/schema/schemas/agentcore-project.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,6 @@ export const AgentCoreProjectSpecSchema = z
337337
message: `Online eval config "${config.name}" references unknown evaluator "${evalName}"`,
338338
});
339339
}
340-
341-
// Block code-based evaluators in online eval configs
342-
const evaluator = spec.evaluators.find(e => e.name === evalName);
343-
if (evaluator?.config.codeBased) {
344-
ctx.addIssue({
345-
code: z.ZodIssueCode.custom,
346-
message: `Online eval config "${config.name}" references code-based evaluator "${evalName}". Code-based evaluators are not supported for online evaluation.`,
347-
});
348-
}
349340
}
350341
}
351342
});

0 commit comments

Comments
 (0)