{"record":{"id":"885c90e34d884183","repo":"diegosouzapw/OmniRoute","slug":"connection-not-found","errorCode":"connection_not_found","errorMessage":"Connection not found.","messagePattern":"Connection not found\\.","errorType":"exception","errorClass":"CodexResetCreditError","httpStatus":404,"severity":"error","filePath":"src/lib/usage/codexResetCredits.ts","lineNumber":319,"sourceCode":"  if (workspaceId) headers[\"chatgpt-account-id\"] = workspaceId;\n\n  return headers;\n}\n\nasync function loadCodexConnection(connectionId: string): Promise<CodexConnectionLike> {\n  if (await isConnectionUnavailableToAuxiliaryActivity(connectionId)) {\n    throw new CodexResetCreditError(\n      409,\n      \"exclusive_lease_active\",\n      \"Reset-credit operations are deferred while an exclusive lease is active.\"\n    );\n  }\n  const connection = (await getProviderConnectionById(\n    connectionId\n  )) as unknown as CodexConnectionLike | null;\n\n  if (!connection) {\n    throw new CodexResetCreditError(404, \"connection_not_found\", \"Connection not found.\");\n  }\n\n  if (connection.provider !== \"codex\") {\n    throw new CodexResetCreditError(\n      400,\n      \"codex_provider_required\",\n      \"Reset credits can only be redeemed for OpenAI Codex accounts.\"\n    );\n  }\n\n  if (connection.authType !== \"oauth\") {\n    throw new CodexResetCreditError(\n      400,\n      \"codex_oauth_required\",\n      \"Codex reset credits require an OAuth connection.\"\n    );\n  }\n","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/usage/codexResetCredits.ts#L301-L337","documentation":"Error \"Connection not found.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/usage/codexResetCredits.ts:319 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"}