Skip to content

feat(eval): imperative online-insight commands + BYO execution role - #2067

Open
jariy17 wants to merge 4 commits into
refactorfrom
feat/eval-online-insight-imperative
Open

feat(eval): imperative online-insight commands + BYO execution role#2067
jariy17 wants to merge 4 commits into
refactorfrom
feat/eval-online-insight-imperative

Conversation

@jariy17

@jariy17 jariy17 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Draft — Part 1. Deploy bug-bash on the exploratory account: PASSED (results below). Scope TODOs remain.

Command structure

agentcore eval online-insight create --help
  --name <name>                     (required)
  --execution-role-arn <arn>        (required) IAM role the config assumes — NO auto-provisioning
  --agent <agent>                   harness ID or runtime ID whose traffic to sample
  --endpoint <endpoint>             endpoint qualifier (default DEFAULT; requires --agent)
  --data-source-config <json>       traces to evaluate (alt. to --agent)
  --insight <insight...>            (required) Builtin.Insight.* IDs or ARNs
  --clustering-frequency <freq...>  DAILY | WEEKLY | MONTHLY
  --sampling-rate <rate>            (required) 0.01-100
  --session-timeout-minutes <n>     1-1440 (default 15)
  --filters <json>                  trace filters
  --enable-on-create <true|false>   default true
  --description <text>

Also: eval online-insight get | list | pause | resume | delete (by --id).

What this does

  • New eval online-insight command family (service-direct), sibling of eval online-eval.
  • Dedicated client methods on CoreEvalClient: createOnlineInsight, getOnlineInsight, listOnlineInsights, setOnlineInsightExecutionStatus, deleteOnlineInsight.
  • create sets the SDK insights (+ optional clusteringConfig), never evaluators, and requires --execution-role-arn — insight configs are not auto-provisioned a role.
  • get/list/pause/resume/delete delegate to the online-eval control-plane ops (same underlying OnlineEvaluationConfig resource).

Service client (CoreEvalClient)

CreateOnlineInsightInput: name, samplingRate, insightIds (required), evaluationExecutionRoleArn (required), clusteringConfig?, sessionTimeoutMinutes?, filters?, enableOnCreate?, description?, and a source union (agent+endpoint? | dataSourceConfig). The impl maps insightIds → insights[{insightId}] on CreateOnlineEvaluationConfigCommand and passes the caller role straight through (no grantOnlineEvalScope).

Decisions made (flag for review)

  1. New flag named --execution-role-arn (net-new, non-breaking). Online-eval's --role-arn rename is deferred.
  2. Insight methods live on CoreEvalClient (not a separate class file).

TODO (remaining scope)

  • eval online-insight update
  • Make eval online-eval --role-arn required + remove shared auto-provisioning (onlineEvalExecutionRole.tsx, the ?? autoProvision fallback, --update-role, role-scope warning)
  • Deploy bug-bash on exploratory account — PASSED

Verification

tsc --noEmit clean for these changes. Unit test added (online-insight.test.tsx). Note: bun test/unbundled bun run for the eval chain can't execute in the current sandbox (pre-existing missing @opentelemetry/otlp-transformer deep-import that only the bundler resolves) — bug-bash uses the built bundle.

… role

Adds `agentcore eval online-insight` (create/get/list/pause/resume/delete)
backed by dedicated CoreEvalClient methods (createOnlineInsight, getOnlineInsight,
listOnlineInsights, setOnlineInsightExecutionStatus, deleteOnlineInsight).

- create sets insights + optional clusteringConfig (never evaluators) and
  REQUIRES --execution-role-arn — no CLI-side auto-provisioning for insight configs.
- read/lifecycle reuse the online-eval control-plane ops (same resource).

Part 1 (draft). TODO: online-insight update; make online-eval --role-arn
required + remove the shared auto-provisioning (onlineEvalExecutionRole).
@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

codecov-commenter commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.26471% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.26%. Comparing base (38c30ae) to head (f87d01e).

Files with missing lines Patch % Lines
src/handlers/eval/online-insight/create/index.tsx 98.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2067      +/-   ##
============================================
+ Coverage     97.24%   97.26%   +0.02%     
============================================
  Files           396      403       +7     
  Lines         24019    24291     +272     
============================================
+ Hits          23357    23627     +270     
- Misses          662      664       +2     

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

flags: [
flag("name", "the name of the online insight config", z.string().optional()),
flag(
"execution-role-arn",

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.

it should be --role-arn

flag("name", "the name of the online insight config", z.string().optional()),
flag(
"execution-role-arn",
"IAM role the online insight assumes (required; not auto-provisioned)",

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.

remove this: (required; not auto-provisioned)

"IAM role the online insight assumes (required; not auto-provisioned)",
z.string().optional(),
),
flag("agent", "harness ID or runtime ID whose traffic to sample", z.string().optional()),

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.

just runtime id

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

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.

It should use the golden test pattern that harness and runtime have.

jariy17 added 2 commits August 22, 2026 15:03
… drop mock test

- rename --execution-role-arn -> --role-arn (match online-eval)
- drop '(required; not auto-provisioned)' from the flag description
- --agent description: runtime ID only
- remove the TestCoreClient-based test; golden fixture test to follow
@jariy17
jariy17 marked this pull request as ready for review August 22, 2026 15:11
@jariy17 jariy17 changed the title feat(eval): imperative online-insight commands + BYO execution role (draft) feat(eval): imperative online-insight commands + BYO execution role Aug 22, 2026
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.

2 participants