{"record":{"id":"b092f8bf15c4bf1c","repo":"ruvnet/ruflo","slug":"embeddings-agentic-flow-installed-but-does-not-e","errorCode":null,"errorMessage":"[embeddings] agentic-flow installed but does not expose downloadModel — falling back to lazy fetch via @xenova/transformers on first generate.","messagePattern":"\\[embeddings\\] agentic-flow installed but does not expose downloadModel — falling back to lazy fetch via @xenova/transformers on first generate\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/embeddings/src/neural-integration.ts","lineNumber":311,"sourceCode":" * lazily on first `embeddings_generate` call via @xenova/transformers.\n */\nexport async function downloadEmbeddingModel(\n  modelId: string,\n  targetDir?: string,\n  onProgress?: (progress: { percent: number; bytesDownloaded: number; totalBytes: number }) => void\n): Promise<string> {\n  try {\n    const mod = await import('agentic-flow/embeddings').catch((err) => {\n      throw err;\n    });\n    const downloadFn = (mod as Record<string, unknown>).downloadModel;\n    if (typeof downloadFn !== 'function') {\n      // agentic-flow is installed but has no downloadModel export (the\n      // 2.x line shipped clearEmbeddingCache/computeEmbedding* but not\n      // downloadModel; the function lives on a different path or version).\n      // Treat as lazy-fetch path — @xenova/transformers will download on\n      // first generate(). #1700 item 2 follow-up.\n      console.warn('[embeddings] agentic-flow installed but does not expose downloadModel — ' +\n        'falling back to lazy fetch via @xenova/transformers on first generate.');\n      return targetDir ?? '.models';\n    }\n    return await (downloadFn as (id: string, dir: string, cb?: typeof onProgress) => Promise<string>)(\n      modelId, targetDir ?? '.models', onProgress\n    );\n  } catch (err) {\n    const msg = err instanceof Error ? err.message : String(err);\n    // Distinguish \"package missing\" / \"subpath unsupported\" from real\n    // download errors so callers can surface the right hint to users.\n    // #1468: Windows + Node strict-ESM raises\n    //   `Package subpath './embeddings' is not defined by \"exports\"`\n    // when the bundled agentic-flow's package.json doesn't declare the\n    // ./embeddings entry. WSL/Linux is more permissive on the same code,\n    // so the bug only surfaces on Windows. Treat both shapes as\n    // \"agentic-flow neural extras unavailable, fall back to lazy fetch\".\n    if (\n      /Cannot find package 'agentic-flow'|Cannot find module/.test(msg)","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/embeddings/src/neural-integration.ts#L293-L329","documentation":"Log warning in downloadEmbeddingModel: agentic-flow is importable but its 2.x line does not export downloadModel, so the model cannot be pre-downloaded through it; the fallback defers to lazy fetching via @xenova/transformers on first generate.","triggerScenarios":"Thrown at v3/@claude-flow/embeddings/src/neural-integration.ts:311 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No action needed; models are fetched lazily on first generate. To eager-download, upgrade agentic-flow to a version exposing downloadModel."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}