From 02813895ee48376db9abd42b76d197bee10b81ae Mon Sep 17 00:00:00 2001 From: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Date: Thu, 3 Sep 2026 13:02:16 -0300 Subject: [PATCH] fix(relay): consolidate the bifrost error-helper imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit added `buildErrorBody`/`sanitizeErrorMessage` and pulled `parseUpstreamError` from `handlers/usageExtractor`, where it does not live — it is exported from `utils/error.ts` alongside the other two. That produced TS2300 (duplicate `buildErrorBody`, already imported below) and TS2305 on the same route, caught by check:api-typecheck. One import from utils/error.ts for all three. check:api-typecheck now reports OK — 289 pre-existing errors, all within the frozen baseline (was FAIL with 2 new/regressed). Relay tests 6/6, prettier clean. --- src/app/api/v1/relay/chat/completions/bifrost/route.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/api/v1/relay/chat/completions/bifrost/route.ts b/src/app/api/v1/relay/chat/completions/bifrost/route.ts index 9f0576bf19..8674125c38 100644 --- a/src/app/api/v1/relay/chat/completions/bifrost/route.ts +++ b/src/app/api/v1/relay/chat/completions/bifrost/route.ts @@ -30,11 +30,13 @@ import { CORS_HEADERS, handleCorsOptions } from "@/shared/utils/cors"; import { stripSensitiveResponseHeaders } from "@omniroute/open-sse/utils/upstreamResponseHeaders"; -import { buildErrorBody, sanitizeErrorMessage } from "@omniroute/open-sse/utils/error"; -import { parseUpstreamError } from "@omniroute/open-sse/handlers/usageExtractor"; import { createInjectionGuard } from "@/middleware/promptInjectionGuard"; import { getRelayTokenByHash, checkRateLimit, recordRelayUsage } from "@/lib/db/relayProxies"; -import { buildErrorBody } from "@omniroute/open-sse/utils/error"; +import { + buildErrorBody, + parseUpstreamError, + sanitizeErrorMessage, +} from "@omniroute/open-sse/utils/error"; import { getProviderPluginManifestHeader } from "@omniroute/open-sse/config/providerPluginManifestUrl.ts"; import { z } from "zod"; import {