ruvnet/ruflo · error

HF_TOKEN is deprecated in favor of OPENAI_API_KEY. Please mi

Error message

HF_TOKEN is deprecated in favor of OPENAI_API_KEY. Please migrate to OPENAI_API_KEY.

What it means

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).

Source

Thrown at ruflo/src/ruvocal/src/lib/server/hooks/init.ts:23

import { refreshConversationStats } from "$lib/jobs/refresh-conversation-stats";
import { loadMcpServersOnStartup } from "$lib/server/mcp/registry";
import { AbortedGenerations } from "$lib/server/abortedGenerations";
import { adminTokenManager } from "$lib/server/adminToken";
import { MetricsServer } from "$lib/server/metrics";

export async function initServer(): Promise<void> {
	// Wait for config to be fully loaded
	await ready;

	// Ensure legacy env expected by some libs: map OPENAI_API_KEY -> HF_TOKEN if absent
	const canonicalToken = config.OPENAI_API_KEY || config.HF_TOKEN;
	if (canonicalToken) {
		process.env.HF_TOKEN ??= canonicalToken;
	}

	// Warn if legacy-only var is used
	if (!config.OPENAI_API_KEY && config.HF_TOKEN) {
		logger.warn(
			"HF_TOKEN is deprecated in favor of OPENAI_API_KEY. Please migrate to OPENAI_API_KEY."
		);
	}

	logger.info("Starting server...");
	initExitHandler();

	if (config.METRICS_ENABLED === "true") {
		MetricsServer.getInstance();
	}

	checkAndRunMigrations();
	refreshConversationStats();

	// Load MCP servers at startup
	loadMcpServersOnStartup();

	// Init AbortedGenerations refresh process

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Rename HF_TOKEN to OPENAI_API_KEY in the environment; HF_TOKEN support will be removed.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at ruflo/src/ruvocal/src/lib/server/hooks/init.ts:23 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/390d564677ef3943. Report an issue: GitHub.