Skip to main content

Overview

A snapshot records the step structure of a known-good agent run — which steps ran, in what order. CompareSnapshotAsync compares a new run against that baseline and reports any differences: added steps, removed steps, or reordering. Two use cases:
  • Production monitoring — detect silent regressions in live traffic
  • CI testing — catch structural changes before they reach production

How it works

  1. Pick a known-good production trace as your golden baseline.
  2. Call LoadSnapshotAsync(traceId) to load its step structure.
  3. After each run, call CompareSnapshotAsync(name, snapshot, ctx).
  4. If the step shape changed, SnapshotDiff.HasChanges is true.

Production monitoring

Compare every live run against a pinned baseline:

CI / integration tests

Use VevalTestSdk to run at zero LLM cost:

SnapshotDiff


Choosing a golden trace

Pick a trace that represents the expected “happy path” structure:
  • All expected steps completed successfully
  • No error steps
  • Representative of typical production behavior
Update your golden trace whenever you intentionally change your agent’s step structure. Leaving a stale baseline will cause false positives.