Skip to content

fix(core): reject authored use_target targets#1688

Merged
christso merged 1 commit into
mainfrom
fix/reject-authored-use-target
Jul 6, 2026
Merged

fix(core): reject authored use_target targets#1688
christso merged 1 commit into
mainfrom
fix/reject-authored-use-target

Conversation

@christso

@christso christso commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Authored targets.yaml entries now fail validation when they use use_target, including env-template forms such as use_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_target as a targeted unsupported field in AgentV 5 authored targets.

Validation

  • bun test packages/core/test/evaluation/validation/targets-validator.test.ts
  • bun run build
  • bun apps/cli/src/cli.ts validate /tmp/tmp.dii994QnHC/use/.agentv/targets.yaml confirmed use_target exits non-zero.
  • bun apps/cli/src/cli.ts validate /tmp/tmp.dii994QnHC/warn/.agentv/targets.yaml confirmed unknown provider settings remain warnings with exit 0.
  • bun apps/cli/src/cli.ts validate /tmp/tmp.dii994QnHC/project/.agentv/config.yaml confirmed unexpected config fields remain warnings with exit 0.
  • bun apps/cli/src/cli.ts validate /tmp/tmp.dii994QnHC/warn/.agentv/targets.yaml --max-warnings 0 confirmed 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

Compound Engineering
Codex

Entire-Checkpoint: 99ac33df0820
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

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

View logs

@christso christso merged commit ce83a4d into main Jul 6, 2026
8 checks passed
@christso christso deleted the fix/reject-authored-use-target branch July 6, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant