Skip to content

fix: recover from corrupted cache JSON files#245

Closed
Gujiassh wants to merge 1 commit into
FujiwaraChoki:mainfrom
Gujiassh:fix/cache-json-recovery
Closed

fix: recover from corrupted cache JSON files#245
Gujiassh wants to merge 1 commit into
FujiwaraChoki:mainfrom
Gujiassh:fix/cache-json-recovery

Conversation

@Gujiassh

@Gujiassh Gujiassh commented Apr 5, 2026

Copy link
Copy Markdown

Summary

  • recover gracefully when account/product cache files contain invalid JSON instead of crashing on JSONDecodeError
  • reset corrupted cache files back to empty default payloads so the CLI can continue operating
  • add focused regression coverage for corrupted account and product cache files

Fixes #230.

Testing

  • python3 -m unittest tests.test_cache
  • python3 -m py_compile src/cache.py tests/test_cache.py

Reset account/product cache files to empty defaults when JSON decoding fails so corrupted cache files no longer crash the CLI on startup.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@Gujiassh Gujiassh closed this May 13, 2026
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.

fix(cache): JSONDecodeError crashes on corrupted cache files

1 participant