Skip to content

fix: skip corrupted run state files in list_runs (import of github/spec-kit#3817) - #119

Open
one-kash wants to merge 2 commits into
mainfrom
import/pr-3817
Open

fix: skip corrupted run state files in list_runs (import of github/spec-kit#3817)#119
one-kash wants to merge 2 commits into
mainfrom
import/pr-3817

Conversation

@one-kash

Copy link
Copy Markdown

Imported from upstream PR github#3817
Original author: @Quratulain-bilal
Original head branch: fix/json-decode-error-in-runstate


Wrap json.load() in workflows/engine.py list_runs with ry/except (json.JSONDecodeError, OSError) so a single corrupted state.json doesn't crash the entire listing.

…n, and regression tests

- Catch UnicodeDecodeError for invalid UTF-8 encoding
- Validate loaded JSON is a dict with required 'run_id' key
- Add 5 regression tests for corrupted state files

Fixes github#3817
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants