[karthik] fix: resolve debugger filepath-not-found on Linux#59
[karthik] fix: resolve debugger filepath-not-found on Linux#59Karthik-MP wants to merge 1 commit into
Conversation
On Linux (case-sensitive FS), Directory.py lowercased child paths before os.path.isfile(), so mixed-case files like Apps.py were never indexed. Debugleton.py then lowercased the lookup too, guaranteeing no match. Fix: store real paths always; on darwin only, lowercase both sides at compare time. Closes openswarm-ai#58.
Fix summaryStop lowercasing filesystem paths. Store and compare real (original-case) paths everywhere; only fold case on macOS, where the filesystem is case-insensitive.
child_abspath = os.path.join(root_dir, child.path)
if sys.platform == "darwin":
abspaths = [p.lower() for p in self.abspaths]
filepath_id = abspaths.index(filepath.lower())
else:
filepath_id = self.abspaths.index(filepath)The caller ( Behavior matrix
Verification
Note
|
What
Fixes
Filepath not found: <lowercase-path>spam on Linux startup, and the debugger failing to index any mixed-case file (e.g.Apps.py,Directory.py).Closes #58.
Root cause
Two
.lower()calls interacted to silently break the debugger on Linux:debugger/debugger_backend/Directory.py:44os.path.isfile("apps.py")returnsFalseon Linux when the real file isApps.py. Files are silently dropped from the index.debugger/debugger_backend/Debugleton.py:78macOS HFS+/APFS is case-insensitive so both sides match regardless — the bug is invisible there.
Fix
Store real filesystem paths always. On
darwinonly, lowercase both the stored list and the lookup at compare time.Test
Run
bash backend/run.shon Linux — no moreFilepath not foundlines on startup.