Skip to content

High-severity crash bugs at system boundaries #73

@chanakyav

Description

@chanakyav

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions