Skip to content

fix: handle TOCTOU race in list_runs state file read (import of github/spec-kit#3838) - #127

Open
one-kash wants to merge 1 commit into
mainfrom
import/pr-3838
Open

fix: handle TOCTOU race in list_runs state file read (import of github/spec-kit#3838)#127
one-kash wants to merge 1 commit into
mainfrom
import/pr-3838

Conversation

@one-kash

Copy link
Copy Markdown

Imported from upstream PR github#3838
Original author: @Quratulain-bilal
Original head branch: fix/list-runs-toctou


Summary

Handle TOCTOU race where state.json is deleted between exists() check and open().

Changes

  • engine.py: Removed exists() guard, wrapped open/load in try/except to skip missing/corrupt state files

Remove exists() check and wrap open/load in try/except to handle the
case where state.json is deleted between the check and open. A missing
or corrupt state file now skips that run instead of crashing the
entire list_runs operation.
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