fix(sandbox): narrow 'no such file or directory' heuristic to Docker socket paths

Greptile review feedback: the bare string is a generic POSIX error.
Now requires it to appear alongside '/var/run/docker' or 'docker.sock'
to avoid false positives.
This commit is contained in:
metal
2026-04-29 00:02:52 +00:00
committed by sallyom
parent f322b9e7c9
commit 570f60b557

View File

@@ -276,10 +276,12 @@ export function isDockerDaemonUnavailable(stderr: string): boolean {
const lower = stderr.toLowerCase();
return (
lower.includes("cannot connect to the docker daemon") ||
lower.includes("no such file or directory") ||
lower.includes("dial unix") ||
lower.includes("docker daemon is not running") ||
lower.includes("connection refused")
lower.includes("connection refused") ||
// Docker socket path errors — narrow enough to avoid false positives
lower.includes("no such file or directory") &&
(lower.includes("/var/run/docker") || lower.includes("docker.sock"))
);
}