{"record":{"id":"45bd68ae9743dcbb","repo":"can1357/oh-my-pi","slug":"mnemopi-recall-failed-for-all-scoped-targets-de","errorCode":null,"errorMessage":"Mnemopi recall failed for all scoped targets (${details})","messagePattern":"Mnemopi recall failed for all scoped targets \\((.+?)\\)","errorType":"exception","errorClass":"AggregateError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/mnemopi/state.ts","lineNumber":424,"sourceCode":"\t\t\t\t\ttargetSucceeded = true;\n\t\t\t\t\tfor (const result of results) {\n\t\t\t\t\t\tmergeRecallResult(merged, byId, byContent, result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconst failure = toError(error);\n\t\t\t\tfailures.push({ bank: target.bank, error: failure });\n\t\t\t\tlogger.warn(\"Mnemopi: scoped recall target failed\", {\n\t\t\t\t\tbank: target.bank,\n\t\t\t\t\terror: failure.message,\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (targetSucceeded) successfulTargets++;\n\t\t}\n\t\tif (successfulTargets === 0 && failures.length > 0) {\n\t\t\tif (failures.length === 1) throw failures[0].error;\n\t\t\tconst details = failures.map(({ bank, error }) => `${bank}: ${error.message}`).join(\"; \");\n\t\t\tthrow new AggregateError(\n\t\t\t\tfailures.map(({ error }) => error),\n\t\t\t\t`Mnemopi recall failed for all scoped targets (${details})`,\n\t\t\t);\n\t\t}\n\t\tmerged.sort(compareRecallResults);\n\t\tif (merged.length > this.config.recallLimit) merged.length = this.config.recallLimit;\n\t\treturn merged;\n\t}\n\n\trecallResultsScoped(query: string): Promise<RecallResult[]> {\n\t\treturn this.collectScopedRecallResults(query);\n\t}\n\n\tformatScopedRecallContext(\n\t\tresults: readonly RecallResult[],\n\t\tformat: \"bullet\" | \"json\" = \"bullet\",\n\t): string | undefined {\n\t\tif (results.length === 0) return undefined;","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/mnemopi/state.ts#L406-L442","documentation":"collectScopedRecallResults queries multiple mnemopi memory banks and merges results. If every scoped target failed, it throws an AggregateError whose message lists each bank and its error message, and whose errors array carries the individual errors. Single-target failures are rethrown as-is; this error is specifically the all-targets-failed case, meaning recall returned nothing because no bank was reachable.","triggerScenarios":"Calling recallResultsScoped/results when every bank in the current scope failed — e.g. all bank indexes missing/corrupt, all storage paths unreadable, or all embedding/query backends erroring.","commonSituations":"Bank directories deleted or on an unmounted volume; permissions changed after an OS upgrade; embedding service down for every bank; config scopes all banks out to invalid paths.","solutions":["Inspect the AggregateError.errors and the '(bank: message; ...)' details to find each bank's root cause and fix individually.","Verify each scoped bank's directory exists, is readable, and its index is present; rebuild indexes if corrupt.","Check the shared backend (embedding/query service) health since all banks failing together usually indicates a common dependency.","Narrow the recall scope to a healthy bank to unblock while repairing the others."],"exampleFix":"// before\nconst results = await recallResultsScoped({ banks: [\"a\", \"b\"] }); // both fail\n// after\ntry {\n  return await recallResultsScoped({ banks: [\"a\", \"b\"] });\n} catch (agg) {\n  for (const e of agg.errors) logger.warn(\"bank recall failed\", { e });\n  return []; // degrade gracefully instead of throwing\n}","handlingStrategy":"try-catch","validationCode":"for (const bank of scope.banks) {\n  const ok = await checkBankHealthy(bank); // index exists + readable + backend up\n  if (!ok) scope.banks = scope.banks.filter(b => b !== bank);\n}\nif (scope.banks.length === 0) return [];","typeGuard":null,"tryCatchPattern":"let results;\ntry {\n  results = await recallResultsScoped(scope);\n} catch (err) {\n  if (err instanceof AggregateError) {\n    for (const e of err.errors) logger.warn(\"mnemopi bank failed\", { e });\n    results = [];\n  } else throw err;\n}","preventionTips":["Pre-flight each scoped bank's directory/index readability.","Monitor the shared embedding/query backend — all banks failing together points at a common dependency.","Design recall callers to degrade to empty results rather than hard-fail."],"tags":["mnemopi","memory","aggregate-error","storage"],"backgroundTag":"all-recall-targets-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}