Files
vercel__workflow/packages/world-testing/test/event-limit.test.ts
Shalabh Chaturvedi fe12b84729 Implement max_events per run limit (#2986)
Enforces the published per-run events limit, which was previously not enforced. The server supplies the limit on the run_started response (separate change); once a run's event log reaches it, the runtime throws MaxEventsExceededError at the top of the replay loop, and the existing terminal-error path records it as run_failed with a new MAX_EVENTS_EXCEEDED code — instead of letting a runaway workflow (e.g. an unbounded step loop) grow the event log without bound.

Adds a new client side WORKFLOW_MAX_EVENTS_OVERRIDE env var which can override the server side provided value (lower only).
2026-07-21 17:21:26 -07:00

7 lines
307 B
TypeScript

import { eventLimit } from '../src/event-limit.mjs';
// Local-only: enforcement needs a world that returns `maxEvents` on the
// run_started response. The Local World does (via WORKFLOW_MAX_EVENTS); the
// Postgres world doesn't yet, so this is not part of the shared createTestSuite.
eventLimit('local');