{"record":{"id":"3546e882bec33aff","repo":"diegosouzapw/OmniRoute","slug":"no-credit","errorCode":"no_credit","errorMessage":"No Codex reset credits are available.","messagePattern":"No Codex reset credits are available\\.","errorType":"exception","errorClass":"CodexResetCreditError","httpStatus":409,"severity":"error","filePath":"src/lib/usage/codexResetCredits.ts","lineNumber":94,"sourceCode":"  const direct = normalizeOutcome(payload);\n  if (direct) return direct;\n\n  const record = toRecord(payload);\n  for (const key of [\"code\", \"outcome\", \"status\", \"result\", \"type\"]) {\n    const normalized = normalizeOutcome(record[key]);\n    if (normalized) return normalized;\n  }\n\n  return null;\n}\n\nfunction parseConsumeOutcome(payload: unknown): CodexResetCreditOutcome {\n  const outcome = extractOutcome(payload);\n  if (outcome === \"reset\") return \"reset\";\n  if (outcome === \"alreadyredeemed\") return \"alreadyRedeemed\";\n\n  if (outcome === \"nocredit\" || outcome === \"nocredits\") {\n    throw new CodexResetCreditError(409, \"no_credit\", \"No Codex reset credits are available.\");\n  }\n\n  if (outcome === \"nothingtoreset\") {\n    throw new CodexResetCreditError(\n      409,\n      \"nothing_to_reset\",\n      \"No exhausted Codex usage limit can be reset right now.\"\n    );\n  }\n\n  throw new CodexResetCreditError(\n    502,\n    \"unknown_reset_credit_response\",\n    \"Codex returned an unknown reset-credit response.\"\n  );\n}\n\nfunction throwKnownConsumeError(payload: unknown): void {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/usage/codexResetCredits.ts#L76-L112","documentation":"Codex upstream outcome mapped in parseConsumeOutcome: the reset-credit consume response carried a `nocredit`/`nocredits` outcome, so a CodexResetCreditError(409, no_credit) is thrown. The account has zero unspent reset credits — nothing to redeem — which is a legitimate upstream state, not a transport failure.","triggerScenarios":"Thrown at src/lib/usage/codexResetCredits.ts:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the monthly/periodic reset-credit grant on the Codex account","Verify the account tier actually includes reset credits"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}