Skip to content

[BUG] Batch evaluate failures leave no trace in the Decision Audit #403

Description

@prajjwalkumar17

Summary

A 4xx from /routing/evaluate/batch showed on the Hyperswitch dashboard but not in the Decision Audit. The two evaluate endpoints disagreed about what a failure looks like: fail_preview (single) recorded an audit event, fail_batch only incremented the failure counter and returned. Worse than simply missing — the handler records request_hit on entry, so a failed batch call appeared in the audit as an evaluation that started and never concluded. Five failure paths were affected: batch too large, routing config unavailable, parameter validation, algorithm resolution, and algorithm-data parse.

Fix

fail_batch now records the same RoutingEvaluateError event fail_preview does, each site naming its stage. Stages carry a deliberate batch_ prefix — AnalyticsRoute has no batch variant yet, and splitting the route label would move existing batch volume between labels and shift dashboard filters, so that split is intentionally left out. A whole-batch failure has no single entry to attribute, so the event is built from one representative request: the caller, the shared fallback_output / algorithm_for, and the first entry's parameters.

Verified against a live engine: the same oversized batch (51 entries) left request_hit only on main, and request_hit + routing_evaluate_error / batch_size_validation_failed / failure on this build.

Noted for later: /routing/evaluate/batch has no Playwright coverage at all — worth adding separately.

PRs

Part of #395.

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions