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.
Summary
A
4xxfrom/routing/evaluate/batchshowed 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_batchonly incremented the failure counter and returned. Worse than simply missing — the handler recordsrequest_hiton 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_batchnow records the sameRoutingEvaluateErroreventfail_previewdoes, each site naming its stage. Stages carry a deliberatebatch_prefix —AnalyticsRoutehas 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 sharedfallback_output/algorithm_for, and the first entry's parameters.Verified against a live engine: the same oversized batch (51 entries) left
request_hitonly onmain, andrequest_hit+routing_evaluate_error/batch_size_validation_failed/failureon this build.Noted for later:
/routing/evaluate/batchhas no Playwright coverage at all — worth adding separately.PRs
Part of #395.