Repository navigation
fix: add integrity verification to RAG cache pickle loading (#447) - #722
Conversation
Add format version header (GAIA_CACHE_V1), SHA-256 checksum verification, file size limits, and auto-recovery for corrupted or outdated cache files. Corrupted cache files are now deleted and re-indexed automatically. Old-format caches (pre-header) are detected and rebuilt on first load. Fixes amd#447
|
@claude review this PR |
|
Claude finished @itomek's task —— View job PR Review: Integrity Verification for RAG Cache
SummaryThis PR adds integrity verification to RAG cache pickle loading, addressing issue #447. The implementation adds:
Review🟢 Strengths
🟡 Suggestions (Non-blocking)
🟢 Security Notes
VerdictApprove - This is a well-implemented security improvement. The test coverage is thorough and the implementation follows defensive programming practices. |
Release notes for v0.17.2. See [docs/releases/v0.17.2.mdx](https://github.com/amd/gaia/blob/v0.17.2-release/docs/releases/v0.17.2.mdx) for the full body. **Headline features:** - One-click desktop installers for Windows, macOS, and Linux (#731 + #743) - Customizable agents and Builder Agent (#720) - MCP tool execution visibility in Agent Activity panel (#717) **Security:** RAG cache integrity verification (#722, closes #447) **Bug fixes:** drag-and-drop upload in any browser (#729), Linux install fixes (#743) **Release & CI:** unified publish workflow (#715), Claude review on fork PRs (#685), npm OIDC fix (#683), webui package.json sync (#682) Full changelog: v0.17.1...v0.17.2 --------- Co-authored-by: Tomasz Iniewicz <[email protected]>
Summary
GAIA_CACHE_V1format header and SHA-256 checksum verificationto cache files before deserializing with
pickle.loads()Context
pickle.load()was called on cached RAG data without any validation(#447). A corrupted cache file would crash the RAG system permanently
with no recovery path. This adds integrity verification at read time
and writes a self-verifying format at cache time.
Note: the diff includes an indentation change (~80 lines dedented)
because data is now read from the file and validated before processing,
so the processing logic moved outside the
with open()block.Test plan
python -m pytest tests/test_rag.py)python util/lint.py --all)