mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-14 04:02:26 +00:00
fix(claw): handle missing dir in _scan_workspace_state
This commit is contained in:
parent
f844e516d8
commit
f6677748a0
1 changed files with 9 additions and 1 deletions
|
|
@ -235,6 +235,9 @@ def _scan_workspace_state(source_dir: Path) -> list[tuple[Path, str]]:
|
||||||
"""
|
"""
|
||||||
findings: list[tuple[Path, str]] = []
|
findings: list[tuple[Path, str]] = []
|
||||||
|
|
||||||
|
if not source_dir.exists():
|
||||||
|
return findings
|
||||||
|
|
||||||
# Direct state files in the root
|
# Direct state files in the root
|
||||||
for name in ("todo.json", "sessions", "logs"):
|
for name in ("todo.json", "sessions", "logs"):
|
||||||
candidate = source_dir / name
|
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}"))
|
findings.append((candidate, f"Root {kind}: {name}"))
|
||||||
|
|
||||||
# State files inside workspace directories
|
# 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("."):
|
if not child.is_dir() or child.name.startswith("."):
|
||||||
continue
|
continue
|
||||||
# Check for workspace-like subdirectories
|
# Check for workspace-like subdirectories
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue