mirror of
https://github.com/aaddrick/claude-desktop-debian.git
synced 2026-05-17 00:26:21 +03:00
fix: remove self-referential .mcpb-cache symlinks before bwrap mount (#342)
Upstream fs-extra can replace .mcpb-cache directories with self-referential symlinks after repeated Cowork sessions, causing ELOOP errors on subsequent launches. Detect and remove these before the bind-mount setup in BwrapBackend spawn, then let the existing mkdirSync recreate as a proper directory. Fixes #342 Co-Authored-By: Claude <claude@anthropic.com>
This commit is contained in:
@@ -848,6 +848,22 @@ class BwrapBackend extends LocalBackend {
|
||||
|
||||
for (const [mountName, hostPath] of Object.entries(mountMap)) {
|
||||
try {
|
||||
// Fix #342: upstream fs-extra can create .mcpb-cache
|
||||
// as a self-referential symlink after repeated sessions.
|
||||
// Detect and remove before mkdir so the bind mount works.
|
||||
try {
|
||||
const st = fs.lstatSync(hostPath);
|
||||
if (st.isSymbolicLink()) {
|
||||
const target = fs.readlinkSync(hostPath);
|
||||
const resolved = path.resolve(
|
||||
path.dirname(hostPath), target
|
||||
);
|
||||
if (resolved === hostPath) {
|
||||
log(`BwrapBackend spawn: removing self-referential symlink: ${hostPath}`);
|
||||
fs.unlinkSync(hostPath);
|
||||
}
|
||||
}
|
||||
} catch { /* ENOENT is fine — path doesn't exist yet */ }
|
||||
if (!fs.existsSync(hostPath)) {
|
||||
fs.mkdirSync(hostPath, { recursive: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user