{"record":{"id":"0c62fe1228ced799","repo":"diegosouzapw/OmniRoute","slug":"http-res-status-0c62fe","errorCode":null,"errorMessage":"HTTP ${res.status}","messagePattern":"HTTP \\$\\{res\\.status\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/cli-code/components/CliProfileAutoSyncToggles.tsx","lineNumber":34,"sourceCode":"/**\n * Toggle card for the opt-in \"auto-sync CLI profiles after model discovery\" feature.\n * Reads/writes the OMNIROUTE_AUTO_SYNC_{CODEX,CLAUDE}_PROFILES feature flags via\n * /api/settings/feature-flags. Both default off; enabling one makes a provider model\n * sync regenerate that tool's profile files from the live catalog.\n */\nexport default function CliProfileAutoSyncToggles() {\n  const t = useTranslations(\"cliTools\");\n  const [codexOn, setCodexOn] = useState(false);\n  const [claudeOn, setClaudeOn] = useState(false);\n  const [loading, setLoading] = useState(true);\n  const [savingKey, setSavingKey] = useState<string | null>(null);\n  const [error, setError] = useState<string | null>(null);\n\n  const load = useCallback(async () => {\n    setLoading(true);\n    try {\n      const res = await fetch(\"/api/settings/feature-flags\");\n      if (!res.ok) throw new Error(`HTTP ${res.status}`);\n      const data = await res.json();\n      const flags: FlagEntry[] = Array.isArray(data.flags) ? data.flags : [];\n      setCodexOn(isOn(flags.find((f) => f.key === CODEX_KEY)?.effectiveValue));\n      setClaudeOn(isOn(flags.find((f) => f.key === CLAUDE_KEY)?.effectiveValue));\n      setError(null);\n    } catch (err) {\n      setError(err instanceof Error ? err.message : t(\"profileSyncLoadFailed\"));\n    } finally {\n      setLoading(false);\n    }\n  }, [t]);\n\n  useEffect(() => {\n    load();\n  }, [load]);\n\n  const persist = useCallback(\n    async (key: string, next: boolean, previous: boolean, apply: (v: boolean) => void) => {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/cli-code/components/CliProfileAutoSyncToggles.tsx#L16-L52","documentation":"Error \"HTTP ${res.status}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/cli-code/components/CliProfileAutoSyncToggles.tsx:34 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"}