ruvnet/ruflo · error

[router] candidate failed

Error message

[router] candidate failed

What it means

Log warning in makeRouterEndpoint's candidate loop: the current candidate model threw during endpoint creation or generation; the error is recorded as lastErr and the loop proceeds to the next candidate in the resolved route list.

Solutions

  1. Inspect the candidate endpoint's error details in the log context; fix the failing candidate (auth, model name, or availability) or remove it from the candidate list.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at ruflo/src/ruvocal/src/lib/server/router/endpoint.ts:298 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/cb03a3323b0e4fc7. Report an issue: GitHub.

Appendix: source

Thrown at ruflo/src/ruvocal/src/lib/server/router/endpoint.ts:298

		}

		const fallbackModel = config.LLM_ROUTER_FALLBACK_MODEL || routerModel.id;
		const { candidates } = resolveRouteModels(routeSelection.routeName, routes, fallbackModel);

		let lastErr: unknown = undefined;
		for (const candidate of candidates) {
			try {
				logger.info(
					{ route: routeSelection.routeName, model: candidate },
					"[router] trying candidate"
				);
				const ep = await createCandidateEndpoint(candidate);
				const gen = await ep({ ...params });
				return metadataThenStream(gen, candidate, routeSelection.routeName);
			} catch (e) {
				lastErr = e;
				const { message: errMsg, statusCode: errStatus } = extractUpstreamError(e);
				logger.warn(
					{
						route: routeSelection.routeName,
						model: candidate,
						err: errMsg,
						...(errStatus && { status: errStatus }),
					},
					"[router] candidate failed"
				);
				continue;
			}
		}

		// Exhausted all candidates — throw to signal upstream failure
		// Forward the upstream error to the client
		const { message, statusCode } = extractUpstreamError(lastErr);
		throw statusCode ? new HTTPError(message, statusCode) : new Error(message);
	};
}

View on GitHub (pinned to fa13ee4ad6)