fix(gateway): support ES2022 metadata consumers

This commit is contained in:
Josh Lambert
2026-07-16 14:47:14 -04:00
parent bb75928749
commit b6472fe4e3
@@ -54,7 +54,7 @@ type Data = z.infer<typeof dataSchema>
function routed(meta: Gateway) {
const route = meta.routing
if (!route) return
const hit = route.modelAttempts?.findLast((item) => item.success === true)
const hit = route.modelAttempts?.slice().reverse().find((item) => item.success === true)
const id = hit?.canonicalSlug ?? route.canonicalSlug
if (!id) return
const value = id.trim()