Skip to content

fix(ext/ai): use SHA-256 for ONNX session cache keys - #754

Merged
nyannyacha merged 1 commit into
mainfrom
ny/fix/ai-hashing
Oct 20, 2026
Merged

nyannyacha merged 1 commit into
mainfrom
ny/fix/ai-hashing

Conversation

@nyannyacha

Copy link
Copy Markdown
Contributor

Description

The ONNX session cache (SESSIONS) keyed entries by XXH3-64 (model bytes) and FxHash (model URL), and trusted a key match without re-checking the model.

Neither hash is collision-resistant. Both keys and the on-disk .checksum now use SHA-256; bytes are hashed on spawn_blocking so the heavier hash stays off the isolate thread.

Cache directory names change, so models are re-downloaded once on the next cold start after upgrading.

@nyannyacha
nyannyacha merged commit 6df9f1f into main Oct 20, 2026
4 checks passed
@nyannyacha
nyannyacha deleted the ny/fix/ai-hashing branch October 20, 2026 07:48
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