fix(core): reject authored use_target targets#1688
Merged
Conversation
Entire-Checkpoint: 99ac33df0820
Deploying agentv with
|
| Latest commit: |
f7822bc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e24b8b2c.agentv.pages.dev |
| Branch Preview URL: | https://fix-reject-authored-use-targ.agentv.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Authored
targets.yamlentries now fail validation when they useuse_target, including env-template forms such asuse_target: "{{ env.AGENT_TARGET }}". This turns the previous validate/pass then prepare/eval failure into an immediate removed-field validation error.Generic unknown fields remain warning-only by default. That keeps AgentV aligned with Promptfoo's permissive validation behavior for unrecognized fields while still treating
use_targetas a targeted unsupported field in AgentV 5 authored targets.Validation
bun test packages/core/test/evaluation/validation/targets-validator.test.tsbun run buildbun apps/cli/src/cli.ts validate /tmp/tmp.dii994QnHC/use/.agentv/targets.yamlconfirmeduse_targetexits non-zero.bun apps/cli/src/cli.ts validate /tmp/tmp.dii994QnHC/warn/.agentv/targets.yamlconfirmed unknown provider settings remain warnings with exit 0.bun apps/cli/src/cli.ts validate /tmp/tmp.dii994QnHC/project/.agentv/config.yamlconfirmed unexpected config fields remain warnings with exit 0.bun apps/cli/src/cli.ts validate /tmp/tmp.dii994QnHC/warn/.agentv/targets.yaml --max-warnings 0confirmed warnings can still be promoted to failure.bunx biome check packages/core/src/evaluation/providers/targets.ts packages/core/src/evaluation/validation/targets-validator.ts packages/core/test/evaluation/validation/targets-validator.test.ts