This repository was archived by the owner on Mar 23, 2026. It is now read-only.
Commit 5de27a6
authored
feat: Implement validation for taskweaver_config.json (#511)
### Description
This PR addresses the `TODO` in
[taskweaver/utils/app_utils.py](cci:7://file:///c:/Users/singh/OneDrive/Documents/Open%20Source/TaskWeaver/taskweaver/utils/app_utils.py:0:0-0:0)
by implementing validation logic for the `taskweaver_config.json` file.
### Changes
- Implemented `json.load` to verify the configuration file contains
valid JSON.
- Added a check to ensure the root element is a dictionary
([dict](cci:1://file:///c:/Users/singh/OneDrive/Documents/Open%20Source/TaskWeaver/taskweaver/session/session.py:357:4-362:9)),
as expected for configuration files.
- Added error handling for `json.JSONDecodeError` and `OSError` to
prevent crashes when reading the file.
### Related Issues
Resolves TODO in `taskweaver/utils/app_utils.py`1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
17 | 25 | | |
18 | 26 | | |
19 | 27 | | |
| |||
0 commit comments