From f6677748a0376a386bb339a7ac4a7264d2b5675c Mon Sep 17 00:00:00 2001 From: Santosh Date: Tue, 28 Apr 2026 05:35:22 -0500 Subject: [PATCH] fix(claw): handle missing dir in _scan_workspace_state --- hermes_cli/claw.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hermes_cli/claw.py b/hermes_cli/claw.py index f6e2521eb0..5f9d728252 100644 --- a/hermes_cli/claw.py +++ b/hermes_cli/claw.py @@ -235,6 +235,9 @@ def _scan_workspace_state(source_dir: Path) -> list[tuple[Path, str]]: """ findings: list[tuple[Path, str]] = [] + if not source_dir.exists(): + return findings + # Direct state files in the root for name in ("todo.json", "sessions", "logs"): candidate = source_dir / name @@ -243,7 +246,12 @@ def _scan_workspace_state(source_dir: Path) -> list[tuple[Path, str]]: findings.append((candidate, f"Root {kind}: {name}")) # State files inside workspace directories - for child in sorted(source_dir.iterdir()): + try: + children = sorted(source_dir.iterdir()) + except OSError: + return findings + + for child in children: if not child.is_dir() or child.name.startswith("."): continue # Check for workspace-like subdirectories