Overview
Several crash bugs exist at system boundaries (config loading, GitHub API responses, file I/O) that cause unhandled exceptions and tracebacks instead of user-friendly error messages.
Bugs
1. config.py — Unhandled JSON parse error (~line 56)
json.load(f) can raise json.JSONDecodeError on malformed config files, crashing the app on startup.
Fix: Wrap in try-except, raise ValueError with user-friendly message including file path and parse details.
2. github_api.py — Unhandled JSON parse in get_issue() (~line 148)
json.loads(output) crashes on non-JSON responses from gh CLI.
Fix: Wrap in try-except, raise GitHubAPIError.
3. github_api.py — Unhandled JSON parse in get_pr_description() (~line 202)
Same pattern as above.
Fix: Wrap in try-except, raise GitHubAPIError.
4. cli.py — Unprotected get_issue() call in cmd_start() (~line 193)
GitHubAPIError from get_issue() propagates as an unhandled traceback.
Fix: Wrap in try-except, print error, sys.exit(1).
5. cli.py — File read permission error in prompt file handling (~line 508)
open(prompt_file) can raise PermissionError / OSError. No try-except around it.
Fix: Wrap in try-except, print error, sys.exit(1).
Acceptance Criteria
- All five bugs fixed with proper error handling
- Tests added for each fix
python3 -m ruff check src/ tests/ passes
python3 -m pytest tests/ passes
🤖 autopilot-loop
Overview
Several crash bugs exist at system boundaries (config loading, GitHub API responses, file I/O) that cause unhandled exceptions and tracebacks instead of user-friendly error messages.
Bugs
1. config.py — Unhandled JSON parse error (~line 56)
json.load(f)can raisejson.JSONDecodeErroron malformed config files, crashing the app on startup.Fix: Wrap in try-except, raise
ValueErrorwith user-friendly message including file path and parse details.2. github_api.py — Unhandled JSON parse in
get_issue()(~line 148)json.loads(output)crashes on non-JSON responses fromghCLI.Fix: Wrap in try-except, raise
GitHubAPIError.3. github_api.py — Unhandled JSON parse in
get_pr_description()(~line 202)Same pattern as above.
Fix: Wrap in try-except, raise
GitHubAPIError.4. cli.py — Unprotected
get_issue()call incmd_start()(~line 193)GitHubAPIErrorfromget_issue()propagates as an unhandled traceback.Fix: Wrap in try-except, print error,
sys.exit(1).5. cli.py — File read permission error in prompt file handling (~line 508)
open(prompt_file)can raisePermissionError/OSError. No try-except around it.Fix: Wrap in try-except, print error,
sys.exit(1).Acceptance Criteria
python3 -m ruff check src/ tests/passespython3 -m pytest tests/passes🤖 autopilot-loop