{"record":{"id":"2dc6d3259089778d","repo":"diegosouzapw/OmniRoute","slug":"failed-to-apply-settings","errorCode":null,"errorMessage":"Failed to apply settings","messagePattern":"Failed to apply settings","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/cli-code/components/GrokBuildToolCard.tsx","lineNumber":292,"sourceCode":"      };\n      const response = await fetch(SETTINGS_ENDPOINT, {\n        method: \"POST\",\n        headers: { \"content-type\": \"application/json\" },\n        body: JSON.stringify({\n          baseUrl,\n          keyId: selectedKeyId || null,\n          model,\n          contextWindow: selectedContext(model),\n          subagentModels: Object.fromEntries(\n            Object.entries(desiredSubagents).map(([type, entry]) => [\n              type,\n              { ...entry, contextWindow: selectedContext(entry.model) },\n            ])\n          ),\n        }),\n      });\n      const body: unknown = await response.json();\n      if (!response.ok) throw new Error(errorText(body, \"Failed to apply settings\"));\n      setMessage({ type: \"success\", text: \"Grok Build settings applied.\" });\n      await Promise.all([refreshStatus(), refreshBackups()]);\n    } catch (error) {\n      setMessage({ type: \"error\", text: error instanceof Error ? error.message : String(error) });\n    } finally {\n      setApplying(false);\n    }\n  };\n\n  const reset = async () => {\n    setResetting(true);\n    setMessage(null);\n    try {\n      const response = await fetch(SETTINGS_ENDPOINT, { method: \"DELETE\" });\n      const body: unknown = await response.json();\n      if (!response.ok) throw new Error(errorText(body, \"Failed to reset settings\"));\n      setMessage({ type: \"success\", text: \"Grok Build settings reset.\" });\n      await Promise.all([refreshStatus(), refreshBackups()]);","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/cli-code/components/GrokBuildToolCard.tsx#L274-L310","documentation":"Error \"Failed to apply settings\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/cli-code/components/GrokBuildToolCard.tsx:292 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"}