Skip to content

chore: left-shift insight filtering and pagination into EvalClient - #2092

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

chore: left-shift insight filtering and pagination into EvalClient#2092
nborges-aws wants to merge 1 commit into
refactorfrom
batch-insights-polish

Conversation

@nborges-aws

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

Copy link
Copy Markdown
Contributor

Description

Move filtering and pagination handling logic into EvalClient

  • Adds dedicated listBatchInsights API -- backed by listBatchEvaluations
  • Scans batch eval pages until it collects correct number of Insight jobs (following gateway pattern)
  • Preserves continuation tokens without skipping Insights jobs at service-page boundaries
  • update imperative and TUI callers to consume pre-filtered insights
  • Adds dedicated BatchInsightsPicker and restores BatchEvaluationsPicker to eval-only interface

This is a follow up to PR #2078. Along with improving filtering/pagination handling, this PR scaffolds a standalone insights API and picker. This creates an existing degree of separation between insights and evaluations, proofing our code for any divergence between the two in the future.

Type of Change

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

Testing

How have you tested the change?

  • bun run test (1805 pass, 0 fail)
  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@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 24, 2026
@codecov-commenter

codecov-commenter commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.37%. Comparing base (768ef10) to head (1b61a60).

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2092   +/-   ##
=========================================
  Coverage     97.36%   97.37%           
=========================================
  Files           410      411    +1     
  Lines         24796    24879   +83     
=========================================
+ Hits          24142    24225   +83     
  Misses          654      654           

☔ 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.

@@ -0,0 +1,168 @@
import { describe, expect, mock, test } from "bun:test";

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.

Does gateway have a seperate unit test for this? Can this be tested within the handler tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

gateway tests this via unit tests also: src/core/gateway.test.ts:65

@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.

export type ListBatchInsightsResponse = Omit<ListBatchEvaluationsResponse, "batchEvaluations"> & {
batchEvaluations: BatchEvaluationSummary[];
};
I think this will remove all of results

@nborges-aws

nborges-aws commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

export type ListBatchInsightsResponse = Omit<ListBatchEvaluationsResponse, "batchEvaluations"> & { batchEvaluations: BatchEvaluationSummary[]; }; I think this will remove all of results

@jariy17 This doesn't remove all results. It's a shortcut to avoid adding ?? [] at all call sites. I can remove and add the optional check to all the call sites if this is too confusing

@nborges-aws
nborges-aws force-pushed the batch-insights-polish branch from 1f8181a to 1b61a60 Compare August 24, 2026 21:08
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