Skip to content

feat(eval): batch simulate — --ingestion-wait-ms + per-example failures/sessions - #2098

Merged
jariy17 merged 7 commits into
refactorfrom
feat/eval-simulate-followups
Aug 27, 2026
Merged

feat(eval): batch simulate — --ingestion-wait-ms + per-example failures/sessions#2098
jariy17 merged 7 commits into
refactorfrom
feat/eval-simulate-followups

Conversation

@jariy17

@jariy17 jariy17 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What

Batch simulate review follow-ups (base: refactor):

  1. --ingestion-wait-ms flag (default 180000, 0 skips) → InvokeDatasetInput.waitIngestionMs. Drops the SIMULATE_INGESTION_WAIT_MS env var — value flows through the input only.
  2. Per-example failures. runExamples returns failures: {item,error}[]; invokeDataset surfaces failures: [{exampleId, error}] — names which examples dropped + why, not just a count.
  3. Output now renders sessions[] + failures[] (below).
  4. Uses Golden Test Pattern for simulate instead of dedicated unit tests for invokeDataset

Output

{
  "batchEvaluationId": "batch-eval-test", "status": "RUNNING",
  "examplesInvoked": 1, "examplesFailed": 1,
  "sessions": [ { "exampleId": "ok1", "sessionId": "s1" } ],
  "failures": [ { "exampleId": "bad", "error": "HTTP 500" } ]
}
  • sessions[]exampleId ↔ sessionId. Join key: a later eval batch-evaluation get returns results[] keyed by sessionId, mapping each score back to its dataset row.
  • failures[] — always present ([] on a clean run); names which examples dropped + why.

…ailures/sessions

Follow-ups from the batch-evaluation simulate review:
- Add --ingestion-wait-ms (default 180000, 0 skips); thread via InvokeDatasetInput.waitIngestionMs.
  Removes the SIMULATE_INGESTION_WAIT_MS env var — tests pass the value through the input.
- runExamples now returns per-item failures (item + error), not a bare count + firstError; invokeDataset
  surfaces failures: [{ exampleId, error }] so a partial failure names which examples dropped and why.
- batch simulate output renders sessions[] (exampleId <-> sessionId join key for a later get) and
  failures[] (omitted when empty).
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Aug 25, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.23%. Comparing base (343d213) to head (ebc604e).
⚠️ Report is 12 commits behind head on refactor.

Files with missing lines Patch % Lines
src/core/eval.tsx 86.36% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2098      +/-   ##
============================================
- Coverage     97.33%   97.23%   -0.11%     
============================================
  Files           417      417              
  Lines         25250    25269      +19     
============================================
- Hits          24578    24570       -8     
- Misses          672      699      +27     

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

@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 25, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 26, 2026
- inject newSessionId into EvalClient (default randomUUID) so replay fixtures + goldens are deterministic
- teach makeRecordingSend to freeze/revive a streaming SDK response (InvokeAgentRuntime), which stringify couldn't serialize
- add simulate fixture-golden case; move handler edges to batch-evaluation.test.tsx
- split invokeDataset.test.ts into run.test.ts (pool) + load.test.ts (parse + GT-shape); delete it and simulate.test.tsx
@github-actions github-actions Bot added size/l PR size: L and removed size/m PR size: M labels Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Aug 26, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Aug 26, 2026
@jariy17
jariy17 marked this pull request as ready for review August 26, 2026 22:34
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot added claude-security-reviewing Claude Code /security-review in progress and removed claude-security-reviewing Claude Code /security-review in progress labels Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
);
if (r.invoked === 0) {
const detail = r.firstError ? `; first error: ${r.firstError.message}` : "";
const first = r.failures[0];

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.

would it make sense to just join all the errors? Or are these already communicated to the customer somewhere else?

Just wanted to make sure they'd be aware of individual datasets failing even if the overall command doesn't fail.

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.

Yes all the errors would show in the debug logs. I assumed that if all dataset examples have failed, it would be the same error. However, maybe we should convene these errors directly to the tui or cli. I'll look into this in a follow up

Comment thread src/testing/fixtures.tsx

const STREAM_TAG = "$stream";

async function freezeStream(response: unknown): Promise<unknown> {

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.

took me a sec, but this makes sense and feels like a simple solution.

correct me if I misunderstood, but for streaming apis the response is not json serializable, so we convert the response via the stream tag. In the process, we resolve the whole stream, so we need to convert the data back to a stream before passing it downstream to consumers who are expecting a stream.

nice!

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.

Yep ur correct. The reviveStream name seems a little weird to me, maybe Ill use mimicStream.

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

PR overall LGTM. One concern with a gap in testing. Tests are all either exercise happy path, or mock invokeDataset with a mocked failure object in the response. Nowhere is exercising actual invocation failures assemble that failure object correctly.

The deleted invokeDataset test is actually the only place that exercised this.

@notgitika notgitika 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 a comment, could be followup

Comment thread src/testing/fixtures.tsx
if (typeof stream?.transformToString !== "function") return response;
return {
...(response as Record<string, unknown>),
response: { [STREAM_TAG]: await stream.transformToString() },

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.

Could we serialize transformToByteArray() as base64 instead? transformToString() decodes as UTF-8, so binary or invalid UTF-8 runtime responses are changed during replay.

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.

can do in a follow up.

@jariy17
jariy17 merged commit b78d396 into refactor Aug 27, 2026
26 checks passed
@jariy17
jariy17 deleted the feat/eval-simulate-followups branch August 27, 2026 16:57
@jariy17

jariy17 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

I'll address the missing bad paths in a follow up

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

Labels

size/l PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants