Skip to content

fix(eval): filter scopeless spans in CloudWatch query#738

Open
jariy17 wants to merge 1 commit intomainfrom
fix/eval-scope-filter
Open

fix(eval): filter scopeless spans in CloudWatch query#738
jariy17 wants to merge 1 commit intomainfrom
fix/eval-scope-filter

Conversation

@jariy17
Copy link
Copy Markdown
Collaborator

@jariy17 jariy17 commented Mar 31, 2026

Summary

  • Adds ispresent(scope.name) filter to the CloudWatch Insights span query in fetchSessionSpans()
  • Spans without a scope field were being sent to the Evaluate API, which rejects them with: Failed to parse span data for entry at index [0] with validation errors: [Field 'scope': Field required (type: missing)]
  • Aligns with the Python SDK's CloudWatchAgentSpanCollector which already filters for scope.name

Test plan

  • All 39 existing run-eval unit tests pass
  • Manual test: agentcore run eval --runtime-arn ... --evaluator-arn "Builtin.Correctness" succeeds
  • Manual test: same command with --expected-response ground truth succeeds

Add ispresent(scope.name) filter to the span query so entries
missing the required scope field are excluded before being sent
to the Evaluate API.
@jariy17 jariy17 requested a review from a team March 31, 2026 02:25
@github-actions github-actions bot added the size/xs PR size: XS label Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.5.0.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-738-tarball/aws-agentcore-0.5.0.tgz

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 45.98% 6575 / 14297
🔵 Statements 45.56% 6986 / 15333
🔵 Functions 44.68% 1177 / 2634
🔵 Branches 46.18% 4362 / 9444
Generated in workflow #1543 for commit 09ba53a by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants