fix(hermes): decode hook IO as utf-8#80
Merged
Merged
Conversation
Make the Hermes Python hooks read payload/state files and mnemon recall stdout with explicit UTF-8 encoding so Windows locale defaults do not corrupt Unicode memory content. The recall subprocess also replaces malformed bytes so parsing fallback paths still receive a string instead of crashing downstream. This also covers the post-call nudge hook's queued reminder file, keeping the remind/nudge state handoff independent of platform default encodings. Validation: go test ./internal/setup; go build -o mnemon .; make test.
3eda759 to
6070cb4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #77.
The Hermes remind hook now uses explicit UTF-8 decoding for its JSON payload, persisted mnemon state files, and
mnemon recallsubprocess stdout. This avoids Windows locale defaults such as cp1252 when recalled memory content contains typographic or other Unicode characters.The recall subprocess also uses replacement for malformed bytes so parsing fallback paths still receive a string instead of crashing downstream. I also swept the adjacent Hermes Python hooks and updated the post-call nudge hook to read its payload and write its queued reminder file with explicit UTF-8.
Validation
go test ./internal/setupgo build -o mnemon .make test(147/147 E2E checks passed)