Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Resolve relative storage paths in doctor image_assets check (#2971)

zsimovanforgeops6db4cea2e451
diff --git a/src/commands/doctor.ts b/src/commands/doctor.ts
index 3e1bcb4cc2..8914cc7075 100644
--- a/src/commands/doctor.ts
+++ b/src/commands/doctor.ts
@@ -7178,9 +7178,17 @@ export async function buildChecks(
let vanished = 0;
const vanishedPaths: string[] = [];
const fs = await import('node:fs');
+ const nodePath = await import('node:path');
+ // storage_path is repo-relative for sync-ingested assets. Resolving
+ // against cwd made this check a false-positive WARN whenever doctor
+ // ran outside the brain repo.
+ const repoRoot = (await engine.getConfig('sync.repo_path')) ?? process.cwd();
for (const r of rows) {
+ const abs = nodePath.isAbsolute(r.storage_path)
+ ? r.storage_path
+ : nodePath.join(repoRoot, r.storage_path);
try {
- fs.statSync(r.storage_path);
+ fs.statSync(abs);
} catch {
vanished++;
if (vanishedPaths.length < 5) vanishedPaths.push(r.storage_path);