diegosouzapw/OmniRoute · error · Error

detail || "Failed to save model endpoint settings"

Error message

detail || "Failed to save model endpoint settings"

What it means

Thrown when saving a custom model's endpoint settings fails and the API returned a plain detail string instead of a structured error. Covers PUT/PATCH rejections: Zod validation (e.g. bad targetFormat), unknown endpoint names, or DB failure.

Solutions

  1. Verify supportedEndpoints values are valid for the provider format
  2. Omit targetFormat entirely when 'Default (auto)' is selected (issue #2905)
  3. Retry; if persistent, check provider-models API logs
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/CustomModelsSection.tsx:345 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/d6a337ece2bbe4cf. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/CustomModelsSection.tsx:345

          modelName: model?.name || modelId,
          source: model?.source || "manual",
          apiFormat: editingApiFormat,
          supportedEndpoints: editingEndpoints,
          // #2905: send targetFormat only when set; the API treats the field
          // as optional. Sending an empty string would fail Zod's enum check,
          // so we omit it entirely when the user picks "Default (auto)".
          ...(editingTargetFormat ? { targetFormat: editingTargetFormat } : {}),
          // #4125: manual context-window override — number to set, null to clear.
          contextWindowOverride,
          // #1904: manual vision-capability override — true/false to set, null to
          // clear back to the id-based heuristic.
          supportsVision: editingSupportsVision ? true : null,
        }),
      });

      if (!res.ok) {
        const detail = await formatProviderModelsErrorResponse(res);
        throw new Error(
          detail ||
            providerText(
              t,
              "failedSaveModelEndpointSettings",
              "Failed to save model endpoint settings"
            )
        );
      }

      await fetchCustomModels();
      onModelsChanged?.();
      notify.success(
        providerText(t, "savedModelEndpointSettings", "Saved model endpoint settings")
      );
      cancelEdit();
    } catch (e) {
      console.error("Failed to save custom model:", e);
      notify.error(

View on GitHub (pinned to a179ffed5b)