ruvnet/ruflo · error
[Q-Learning] Failed to load model: ${err}
Error message
[Q-Learning] Failed to load model: ${err} What it means
Log warning in loadModel: an error was caught while reading/parsing the persisted Q-learning model file, so the model is not restored (fresh Q-table state is used) and the failure reason is printed.
Source
Thrown at v3/@claude-flow/cli/src/ruvector/q-learning-router.ts:292
const persistedEncoder = model.encoderVersion ?? 1;
if (persistedEncoder === ENCODER_VERSION) {
this.import(model.qTable);
} else {
console.warn(
`[Q-Learning] Encoder version mismatch (persisted=${persistedEncoder}, current=${ENCODER_VERSION}); resetting Q-table (see #2239).`,
);
}
// Restore stats
this.stepCount = model.stats.stepCount || 0;
this.updateCount = model.stats.updateCount || 0;
this.avgTDError = model.stats.avgTDError || 0;
this.epsilon = model.stats.epsilon || this.config.explorationInitial;
this.totalExperiences = model.metadata?.totalExperiences || 0;
return true;
} catch (err) {
console.warn(`[Q-Learning] Failed to load model: ${err}`);
return false;
}
}
/**
* Save model to persistence file
*/
async saveModel(path?: string): Promise<boolean> {
const modelPath = path || this.config.modelPath;
try {
// Ensure directory exists
const dir = dirname(modelPath);
if (!existsSync(dir)) {
mkdirSync(dir, { recursive: true });
}
const model: PersistedModel = {
version: '1.0.0',View on GitHub (pinned to fa13ee4ad6)
Solutions
- Fix or remove the corrupted persisted Q-learning model file; the router starts with a fresh table when loading fails.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at v3/@claude-flow/cli/src/ruvector/q-learning-router.ts:292 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/c24dfb693b1108f5.
Report an issue: GitHub.