fix(local-cli): Loosen the ARN-mode gate in run eval from `!!(runtimeAr... (#737)#42
Draft
aidandaly24 wants to merge 1 commit into
Draft
fix(local-cli): Loosen the ARN-mode gate in run eval from `!!(runtimeAr... (#737)#42aidandaly24 wants to merge 1 commit into
run eval from `!!(runtimeAr... (#737)#42aidandaly24 wants to merge 1 commit into
Conversation
…for Builtin evaluators The ARN-mode gate required both --runtime-arn and --evaluator-arn, so `run eval --runtime-arn ... --evaluator Builtin.Correctness` was wrongly rejected with "No agentcore project found." even though resolveFromArn already supports Builtin.* evaluators in ARN mode. Loosen the gate to key off --runtime-arn alone, and clarify the --evaluator-arn description to steer Builtin.* IDs toward -e/--evaluator.
Coverage Report
|
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.
Refs aws#737
Issues
agentcore run eval --runtime-arn ... --evaluator Builtin.Correctness(no project) is wrongly rejected with "No agentcore project found." despite Builtin evaluators being supported in ARN mode; the workaround--evaluator-arn Builtin.Correctnessis non-obvious. The--evaluator-arnflag also misleadingly accepts non-ARN Builtin IDs.Root cause
command.tsx:121 gates with
!!(runtimeArn && evaluatorArn)requiring both flags;--evaluator Builtin.*alone yields isArnMode=false and triggers requireProject() (project.tsx:88-91) before handleRunEval, even though resolveFromArn (run-eval.ts:76-86) supports Builtin.* in ARN mode. Misleading name: resolveEvaluatorArns (run-eval.ts:40-45) passes non-ARNs through verbatim. Both from d41e14b (aws#706), unchanged at HEAD v0.20.2.The fix
Loosen command.tsx:121 to
const isArnMode = !!cliOptions.runtimeArn;(resolveFromArn already validates evaluators and errors cleanly). Fix/rename the misleading--evaluator-arnflag at :86 (and :198 batch-eval): minimally correct the description to note it accepts ARNs or Builtin.*/managed IDs; preferably add--evaluator-idwith--evaluator-arnas a deprecated alias. Design decision: hidden alias vs breaking hard rename.Files touched: src/cli/commands/run/command.tsx:121 (isArnMode gate) and :86 (--evaluator-arn flag definition/description); :198 (batch-evaluation --evaluator-arn) for naming consistency. Behavior already supported in src/cli/operations/eval/run-eval.ts:76-96 (resolveFromArn) and :40-45 (resolveEvaluatorArns). Error origin: src/cli/tui/guards/project.tsx:84-92.
Validation evidence
The fix was verified by reproducing the original symptom and re-running after the change:
BEFORE (reverted gate to buggy
!!(runtimeArn && evaluatorArn), rebuilt, ran from /tmp non-project dir):node dist/cli/index.mjs run eval --runtime-arn arn:aws:bedrock-agentcore:us-east-1:123456789012:runtime/my-runtime-abc123 --evaluator Builtin.Correctness --region us-east-1 --json=> printed
No agentcore project found./Run agentcore create to fix this.— requireProject() fired before handleRunEval/resolveFromArn. Symptom confirmed.AFTER (restored fix, rebuilt OK -> dist/cli/index.mjs, same non-project dir):
Test suite: green.
Staged on the fork as a draft for human review. Promote to aws/agentcore-cli after vetting.