{"record":{"id":"390d564677ef3943","repo":"ruvnet/ruflo","slug":"hf-token-is-deprecated-in-favor-of-openai-api-key","errorCode":null,"errorMessage":"HF_TOKEN is deprecated in favor of OPENAI_API_KEY. Please migrate to OPENAI_API_KEY.","messagePattern":"HF_TOKEN is deprecated in favor of OPENAI_API_KEY\\. Please migrate to OPENAI_API_KEY\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ruflo/src/ruvocal/src/lib/server/hooks/init.ts","lineNumber":23,"sourceCode":"import { refreshConversationStats } from \"$lib/jobs/refresh-conversation-stats\";\nimport { loadMcpServersOnStartup } from \"$lib/server/mcp/registry\";\nimport { AbortedGenerations } from \"$lib/server/abortedGenerations\";\nimport { adminTokenManager } from \"$lib/server/adminToken\";\nimport { MetricsServer } from \"$lib/server/metrics\";\n\nexport async function initServer(): Promise<void> {\n\t// Wait for config to be fully loaded\n\tawait ready;\n\n\t// Ensure legacy env expected by some libs: map OPENAI_API_KEY -> HF_TOKEN if absent\n\tconst canonicalToken = config.OPENAI_API_KEY || config.HF_TOKEN;\n\tif (canonicalToken) {\n\t\tprocess.env.HF_TOKEN ??= canonicalToken;\n\t}\n\n\t// Warn if legacy-only var is used\n\tif (!config.OPENAI_API_KEY && config.HF_TOKEN) {\n\t\tlogger.warn(\n\t\t\t\"HF_TOKEN is deprecated in favor of OPENAI_API_KEY. Please migrate to OPENAI_API_KEY.\"\n\t\t);\n\t}\n\n\tlogger.info(\"Starting server...\");\n\tinitExitHandler();\n\n\tif (config.METRICS_ENABLED === \"true\") {\n\t\tMetricsServer.getInstance();\n\t}\n\n\tcheckAndRunMigrations();\n\trefreshConversationStats();\n\n\t// Load MCP servers at startup\n\tloadMcpServersOnStartup();\n\n\t// Init AbortedGenerations refresh process","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/ruflo/src/ruvocal/src/lib/server/hooks/init.ts#L5-L41","documentation":"Startup deprecation warning from initServer: HF_TOKEN is the legacy variable and OPENAI_API_KEY is canonical; the message fires to push operators toward OPENAI_API_KEY (with legacy mapping still applied for compatibility).","triggerScenarios":"Thrown at ruflo/src/ruvocal/src/lib/server/hooks/init.ts:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename HF_TOKEN to OPENAI_API_KEY in the environment; HF_TOKEN support will be removed."],"exampleFix":null,"handlingStrategy":"validation","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"}