can1357/oh-my-pi · error · AggregateError

Mnemopi recall failed for all scoped targets (${details})

Error message

Mnemopi recall failed for all scoped targets (${details})

What it means

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.

Source

Thrown at packages/coding-agent/src/mnemopi/state.ts:424

					targetSucceeded = true;
					for (const result of results) {
						mergeRecallResult(merged, byId, byContent, result);
					}
				}
			} catch (error) {
				const failure = toError(error);
				failures.push({ bank: target.bank, error: failure });
				logger.warn("Mnemopi: scoped recall target failed", {
					bank: target.bank,
					error: failure.message,
				});
			}
			if (targetSucceeded) successfulTargets++;
		}
		if (successfulTargets === 0 && failures.length > 0) {
			if (failures.length === 1) throw failures[0].error;
			const details = failures.map(({ bank, error }) => `${bank}: ${error.message}`).join("; ");
			throw new AggregateError(
				failures.map(({ error }) => error),
				`Mnemopi recall failed for all scoped targets (${details})`,
			);
		}
		merged.sort(compareRecallResults);
		if (merged.length > this.config.recallLimit) merged.length = this.config.recallLimit;
		return merged;
	}

	recallResultsScoped(query: string): Promise<RecallResult[]> {
		return this.collectScopedRecallResults(query);
	}

	formatScopedRecallContext(
		results: readonly RecallResult[],
		format: "bullet" | "json" = "bullet",
	): string | undefined {
		if (results.length === 0) return undefined;

View on GitHub (pinned to 9690622007)

Solutions

  1. Inspect the AggregateError.errors and the '(bank: message; ...)' details to find each bank's root cause and fix individually.
  2. Verify each scoped bank's directory exists, is readable, and its index is present; rebuild indexes if corrupt.
  3. Check the shared backend (embedding/query service) health since all banks failing together usually indicates a common dependency.
  4. Narrow the recall scope to a healthy bank to unblock while repairing the others.

Example fix

// before
const results = await recallResultsScoped({ banks: ["a", "b"] }); // both fail
// after
try {
  return await recallResultsScoped({ banks: ["a", "b"] });
} catch (agg) {
  for (const e of agg.errors) logger.warn("bank recall failed", { e });
  return []; // degrade gracefully instead of throwing
}
Defensive patterns

Strategy: try-catch

Validate before calling

for (const bank of scope.banks) {
  const ok = await checkBankHealthy(bank); // index exists + readable + backend up
  if (!ok) scope.banks = scope.banks.filter(b => b !== bank);
}
if (scope.banks.length === 0) return [];

Try / catch

let results;
try {
  results = await recallResultsScoped(scope);
} catch (err) {
  if (err instanceof AggregateError) {
    for (const e of err.errors) logger.warn("mnemopi bank failed", { e });
    results = [];
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/45bd68ae9743dcbb. Report an issue: GitHub.