{"record":{"id":"38ace4b8046f18f3","repo":"diegosouzapw/OmniRoute","slug":"startup-could-not-restore-runtime-settings","errorCode":null,"errorMessage":"[STARTUP] Could not restore runtime settings:","messagePattern":"\\[STARTUP\\] Could not restore runtime settings:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/instrumentation-node.ts","lineNumber":462,"sourceCode":"    if (migration.migrated) {\n      console.log(\n        `[STARTUP] Migrated Codex connection defaults for ${migration.updatedConnectionIds.length} connection(s)`\n      );\n      if (settings.cloudEnabled === true) {\n        const [{ syncToCloud }, { getConsistentMachineId }] = await Promise.all([\n          import(\"@/lib/cloudSync\"),\n          import(\"@/shared/utils/machineId\"),\n        ]);\n        const machineId = await getConsistentMachineId();\n        await syncToCloud(machineId);\n        console.log(\"[STARTUP] Synced migrated Codex connection defaults to cloud\");\n      }\n    }\n\n    startRuntimeConfigHotReload();\n  } catch (err: unknown) {\n    const msg = err instanceof Error ? err.message : String(err);\n    console.warn(\"[STARTUP] Could not restore runtime settings:\", msg);\n  }\n\n  // Proactively start the credential-health sweep at boot so stale web-session\n  // connections (cookies that expired overnight) get re-probed and recovered on\n  // startup — instead of staying red until the first real request lazily imports\n  // the on-demand credentialGate. Idempotent; self-disables via\n  // OMNIROUTE_DISABLE_CREDENTIAL_HEALTH_CHECK and its cadence is tunable via\n  // CREDENTIAL_HEALTH_CHECK_INTERVAL. NOTE: this MUST live here (the real Next.js\n  // instrumentation startup), NOT in the unused src/server-init.ts.\n  try {\n    const { initCredentialHealthCheck } = await import(\"@/lib/credentialHealth/scheduler\");\n    const started = initCredentialHealthCheck();\n    console.log(\n      started\n        ? \"[STARTUP] Credential health scheduler started\"\n        : \"[STARTUP] Credential health scheduler disabled\"\n    );\n  } catch (err: unknown) {","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/instrumentation-node.ts#L444-L480","documentation":"Error \"[STARTUP] Could not restore runtime settings:\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/instrumentation-node.ts:462 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"}