{"record":{"id":"81ab56955ea62be2","repo":"diegosouzapw/OmniRoute","slug":"innerai-ai-models-fetch-failed-status-err-in","errorCode":null,"errorMessage":"[InnerAI] /ai-models fetch failed (status=${err instanceof InnerAiModelsError ? err.status : \"n/a\"}) — falling back to synthetic model entry","messagePattern":"\\[InnerAI\\] /ai-models fetch failed \\(status=(.+?)\\) — falling back to synthetic model entry","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"open-sse/executors/inner-ai.ts","lineNumber":595,"sourceCode":"    const requestedModel = String(bodyObj.model ?? \"\").trim() || \"gpt-4o\";\n    let models: InnerAiModel[] = [];\n    try {\n      models = await resolveModels(token, deviceId, email, signal);\n    } catch (err) {\n      // Auth failures on /ai-models are surfaced explicitly so operators don't\n      // chase a \"Inner.ai invalid model\" downstream symptom when the real cause\n      // is the user's token expiring on the models endpoint.\n      if (err instanceof InnerAiModelsError && (err.status === 401 || err.status === 403)) {\n        return makeErrorResult(\n          err.status,\n          \"Inner.ai /ai-models authentication failed — re-paste your token cookie\",\n          body\n        );\n      }\n      // Non-auth failures (5xx, network): proceed with empty list and let the\n      // synthetic-model fallback try. Log so the operator sees the upstream blip.\n      // No `log` accessor in this executor scope — propagate via a runtime warning.\n      console.warn(\n        `[InnerAI] /ai-models fetch failed (status=${\n          err instanceof InnerAiModelsError ? err.status : \"n/a\"\n        }) — falling back to synthetic model entry`\n      );\n    }\n\n    const modelEntry: InnerAiModel = findModel(models, requestedModel) ?? {\n      id: \"\",\n      llm_model: requestedModel,\n    };\n\n    // Build message content from OpenAI messages array\n    const rawMessages = Array.isArray(bodyObj.messages) ? bodyObj.messages : [];\n    const { hasTools, requestedTools, effectiveMessages } = prepareToolMessages(\n      bodyObj,\n      rawMessages\n    );\n    const messages = effectiveMessages as Array<Record<string, unknown>>;","sourceCodeStart":577,"sourceCodeEnd":613,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/inner-ai.ts#L577-L613","documentation":"Error \"[InnerAI] /ai-models fetch failed (status=${err instanceof InnerAiModelsError ? err.status : \"n/a\"}) — falling back to synthetic model entry\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at open-sse/executors/inner-ai.ts:595 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"}