{"record":{"id":"d6a337ece2bbe4cf","repo":"diegosouzapw/OmniRoute","slug":"detail-failed-to-save-model-endpoint-settings","errorCode":null,"errorMessage":"detail || \"Failed to save model endpoint settings\"","messagePattern":"detail \\|\\| \"Failed to save model endpoint settings\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/providers/[id]/components/CustomModelsSection.tsx","lineNumber":345,"sourceCode":"          modelName: model?.name || modelId,\n          source: model?.source || \"manual\",\n          apiFormat: editingApiFormat,\n          supportedEndpoints: editingEndpoints,\n          // #2905: send targetFormat only when set; the API treats the field\n          // as optional. Sending an empty string would fail Zod's enum check,\n          // so we omit it entirely when the user picks \"Default (auto)\".\n          ...(editingTargetFormat ? { targetFormat: editingTargetFormat } : {}),\n          // #4125: manual context-window override — number to set, null to clear.\n          contextWindowOverride,\n          // #1904: manual vision-capability override — true/false to set, null to\n          // clear back to the id-based heuristic.\n          supportsVision: editingSupportsVision ? true : null,\n        }),\n      });\n\n      if (!res.ok) {\n        const detail = await formatProviderModelsErrorResponse(res);\n        throw new Error(\n          detail ||\n            providerText(\n              t,\n              \"failedSaveModelEndpointSettings\",\n              \"Failed to save model endpoint settings\"\n            )\n        );\n      }\n\n      await fetchCustomModels();\n      onModelsChanged?.();\n      notify.success(\n        providerText(t, \"savedModelEndpointSettings\", \"Saved model endpoint settings\")\n      );\n      cancelEdit();\n    } catch (e) {\n      console.error(\"Failed to save custom model:\", e);\n      notify.error(","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/providers/[id]/components/CustomModelsSection.tsx#L327-L363","documentation":"Error \"detail || \"Failed to save model endpoint settings\"\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/CustomModelsSection.tsx:345 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}