Skip to content

feat(eval): add eval online-eval CLI commands - #1841

Closed
jariy17 wants to merge 2 commits into
refactorfrom
feat/eval-online-eval-cli
Closed

feat(eval): add eval online-eval CLI commands#1841
jariy17 wants to merge 2 commits into
refactorfrom
feat/eval-online-eval-cli

Conversation

@jariy17

@jariy17 jariy17 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds agentcore eval online-eval create/get/list/update/pause/resume/delete.
  • --agent <id> accepts a plain AgentCore Runtime ID or a Harness ID and derives the CloudWatch log group + service name from it (a harness is itself backed by a runtime; resolution falls back from GetAgentRuntime to GetHarness). Verified against real resources in a live account.
  • --log-group-name/--service-name are the escape hatch for agents that emit traces under a custom OTel service name rather than AgentCore's default runtime path.
  • No execution role required at create time: Core auto-provisions and reuses a default one scoped to the resolved log group, mirroring the harness execution-role pattern.
  • update merges over the existing config (the API replaces the whole rule/dataSourceConfig), so unset fields are preserved.

Test plan

  • bun x tsc --noEmit clean
  • bun test — 391/391 pass
  • Smoke-tested get/list against real production online-eval configs in account 725476964917
  • Derivation formula verified against a real harness-backed runtime (create/get/delete round-trip)

@github-actions github-actions Bot added the size/xl PR size: XL label Jul 27, 2026
@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 Jul 27, 2026
@jariy17
jariy17 force-pushed the feat/eval-evaluator-cli branch from 0a2afdb to 122b13f Compare July 28, 2026 20:31
Base automatically changed from feat/eval-evaluator-cli to refactor July 29, 2026 14:36
Adds `agentcore eval online-eval create/get/list/update/pause/resume/delete`,
following the conventions established in the eval evaluator review (#1822).

- `--agent <id>` accepts a plain AgentCore Runtime ID or a Harness ID and
  derives the CloudWatch data source from it. A harness is itself backed by a
  runtime, so resolution tries GetAgentRuntime and falls back to GetHarness,
  reading the underlying runtime out of the harness environment. The log group
  is keyed by runtime *id*, the service name by runtime *name* — verified
  against live resources, the two are not interchangeable.
- `--log-group-name`/`--service-name` are the escape hatch for agents emitting
  traces under a custom OTel service name rather than AgentCore's default path.
- No execution role required at create time: Core auto-provisions and reuses a
  default one, mirroring the harness execution-role pattern. The policy grants
  Logs Insights query access over `aws/spans` plus the runtime's log-group
  prefix, since the service validates query access at the runtime level and
  rejects a role scoped to a single endpoint.
- `update` merges over the current config because UpdateOnlineEvaluationConfig
  replaces the whole `rule`, so unset fields are preserved.
- `list` exposes only the API's server-side pagination; no client-side filters.
@jariy17
jariy17 force-pushed the feat/eval-online-eval-cli branch from 679b473 to 13ee2dd Compare July 30, 2026 13:58
@codecov-commenter

codecov-commenter commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.31104% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.46%. Comparing base (5b9506f) to head (57787f3).

Files with missing lines Patch % Lines
src/core/onlineEvalExecutionRole.tsx 82.60% 20 Missing ⚠️
src/handlers/eval/online-eval/create/index.tsx 84.34% 18 Missing ⚠️
src/core/eval.tsx 98.93% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #1841      +/-   ##
============================================
- Coverage     95.61%   95.46%   -0.15%     
============================================
  Files           181      190       +9     
  Lines          8842     9439     +597     
============================================
+ Hits           8454     9011     +557     
- Misses          388      428      +40     

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

Core sub-clients are scoped to a CLI namespace, not an AWS resource type:
HarnessClient spans harness, versions, endpoints, invoke, and exec. Online
evaluation configs live under `agentcore eval` alongside evaluators, so they
belong on EvalClient / CoreEvalClient rather than a sibling core.onlineEval.

- Merged OnlineEvalClient's methods into EvalClient; deleted core/onlineEval.tsx.
- Moved CreateOnlineEvalInput / UpdateOnlineEvalInput into eval/types.tsx and
  the method signatures into CoreEvalClient; deleted online-eval/types.tsx.
- Dropped `onlineEval` from Core and CoreClient; handlers call core.eval.*.
- Folded TestOnlineEvalClient into TestEvalClient behind a shared record()
  helper.

Pure restructuring: no request shape changed, so every recorded fixture and
golden file still matches (513 tests green, unchanged).
@jariy17

jariy17 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by a rebase onto the latest refactor — reopening as a fresh PR with a single squashed commit.

@jariy17 jariy17 closed this Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants