Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit e5ff7c0

Browse files
committed
feat: improve config validation to ensure dict type
1 parent efa5b9c commit e5ff7c0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

taskweaver/utils/app_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ def validate_app_config(workspace: str) -> bool:
1616
return False
1717
try:
1818
with open(config_path, "r", encoding="utf-8") as f:
19-
json.load(f)
20-
except json.JSONDecodeError:
19+
data = json.load(f)
20+
# Config must be a dictionary (key-value pairs)
21+
if not isinstance(data, dict):
22+
return False
23+
except (json.JSONDecodeError, OSError):
2124
return False
2225
return True
2326

0 commit comments

Comments
 (0)