fix(quality): green open-sse+dashboard typecheck base-reds (#9985)

Release-equivalent fast-gates surface 5 real TS regressions inherited by the
base from merged Fal/guardrails/cursor work (fast-gates PR->release do not run
these, so they accrued on release/v3.8.50):
- open-sse/handlers/imageGeneration/providers/fal.ts: normalizeProviderImagePayload
  missing 4th 'b64_json' arg (TS2554).
- open-sse/handlers/videoGeneration/falHandler.ts: narrow video to Record before .url.
- src/app/api/v1/images/generations/route.ts: type the toJsonErrorPayload read.
- src/lib/guardrails/visionBridgeHelpers.ts: cast through unknown for UA fetch.
- src/lib/providers/mergeProviderModelListing.ts: drop index-signature requirement
  that made interface RegistryModel[] unassignable (TS2322, from #9911).

All fixed in source (keeps the gates meaningful); each reproduces on the base tip.

Co-authored-by: OmniRoute maintenance <maintainers@omniroute.local>
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-08-10 13:25:20 -03:00
parent f672ddcc2c
commit 65940dde76
5 changed files with 10 additions and 5 deletions

View File

@@ -89,7 +89,7 @@ export async function handleFalAIImageEdit({
const payload = await response.json();
const normalizedBody =
body.response_format === undefined ? { ...body, response_format: "b64_json" } : body;
const imagesOut = await normalizeProviderImagePayload(payload, normalizedBody, log);
const imagesOut = await normalizeProviderImagePayload(payload, normalizedBody, log, "b64_json");
return saveImageSuccessResult({
provider,
model: editModel,

View File

@@ -90,7 +90,10 @@ function absoluteFalUrl(value: unknown, baseUrl: string): string | undefined {
function normalizeFalVideoResponse(payload: unknown) {
const record = payload && typeof payload === "object" ? (payload as Record<string, unknown>) : {};
const video = record.video && typeof record.video === "object" ? record.video : null;
const video =
record.video && typeof record.video === "object"
? (record.video as Record<string, unknown>)
: null;
const url = video && typeof video.url === "string" ? video.url.trim() : "";
if (!url) {

View File

@@ -307,7 +307,9 @@ async function postHandler(request, context) {
});
}
const errorPayload = toJsonErrorPayload((result as any).error, "Image generation provider error");
const errorPayload = toJsonErrorPayload((result as any).error, "Image generation provider error") as {
error?: { message?: string };
};
const message =
typeof errorPayload?.error?.message === "string"
? errorPayload.error.message

View File

@@ -222,7 +222,7 @@ const VISION_BRIDGE_UA_FETCH: typeof fetch = ((input: RequestInfo | URL, init?:
"user-agent": "omniroute-vision-bridge",
...((init?.headers as Record<string, string> | undefined) ?? {}),
},
})) as typeof fetch;
})) as unknown as typeof fetch;
/**
* Resolve every image part in the body to a base64 data URI when the target

View File

@@ -19,7 +19,7 @@ export type ProviderListingModel = {
export type MergeProviderModelListingInput = {
providerId: string;
registryModels: Array<{ id: string; name?: string; [key: string]: unknown }>;
registryModels: Array<{ id: string; name?: string }>;
syncedModels: Array<{ id: string; name?: string; [key: string]: unknown }>;
customModels: Array<{ id: string; name?: string; source?: string; [key: string]: unknown }>;
usesCuratedModelsOnly?: boolean;