Skip to content

feat: add imperative batch-insights command - #2066

Open
nborges-aws wants to merge 1 commit into
refactorfrom
batch-eval-insights
Open

feat: add imperative batch-insights command#2066
nborges-aws wants to merge 1 commit into
refactorfrom
batch-eval-insights

Conversation

@nborges-aws

@nborges-aws nborges-aws commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

Adds imperative batch insights commands for AgentCore evaluations:

  • eval batch-insights run
  • eval batch-insights get
  • eval batch-insights list

Summary of changes

  • run starts a batch eval with the insights field populated; --insight defaults to Builtin.Insight.FailureAnalysis
  • get verifies that the requested batch evaluation contains insights and returns service-provided insight results
  • list filters the shared Batch Evaluation response to entries containing insights and preserves pagination
  • extracts existing batch-evaluation source parsing and validation into a shared sessionSource utility

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

Added unit tests along with golden fixture tests (recorded against team AWS account). Also ran manual smoke tests against runtime invocations in my personal account, succeeding on all three added commands.

  • Focused tests: 20 pass, 0 fail
  • bun run typecheck
  • bun run lint:check
  • bun run format:check
  • bun test (1627 pass, 0 fail)

Checklist

  • I have read the CONTRIBUTING document
  • I have added tests that prove the feature works
  • No documentation changes are required for this implementation layer
  • My changes generate no new warnings
  • No dependent asset or snapshot changes are required

Stack created with GitHub Stacks CLIGive Feedback 💬

@github-actions github-actions Bot added agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Aug 21, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.72197% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.24%. Comparing base (d7f3fd4) to head (2ec82da).

Files with missing lines Patch % Lines
src/handlers/eval/sessionSource.tsx 86.27% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2066      +/-   ##
============================================
+ Coverage     97.15%   97.24%   +0.08%     
============================================
  Files           387      392       +5     
  Lines         23142    23266     +124     
============================================
+ Hits          22483    22624     +141     
+ Misses          659      642      -17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jariy17 jariy17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. Pretty good thou

import { EvalClient } from "./eval";
import type { AwsClients } from "./types";

describe("EvalClient.startBatchInsights", () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this unit test. This should be captured by handler unit tests

z.string().optional(),
),
flag(
"online-eval",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use online-eval as a data source for batch insight?

import { parseJsonFlag } from "../utils";
import type { SessionSourceValue, SessionWindow } from "./types";

export const sessionSourceFlags = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encapsulate this as a class please :)

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.

3 participants