Repository navigation
fix: decode ZCode hook input as UTF-8 on Windows - #151
Merged
Merged
Conversation
Preserve the active-stop guard across console code pages and ship the Chinese completion tokens with a UTF-8 BOM for Windows PowerShell 5.1. Keep shell completion behavior aligned and ask for a language-neutral evaluation marker. Add deployed-byte checks and an opt-in Windows process suite with the old asset as a regression control. Validated with go build, make test, isolated CLI smoke, and real PowerShell 7 UTF-8/CP936 before-and-after probes; Windows PowerShell 5.1 runs through Manual Integration.
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.
Windows PowerShell can decode ZCode's UTF-8 hook payload as CP936, corrupting Chinese text and losing
stop_hook_active. The Stop hook then repeats its blocking reminder. Decode stdin explicitly as UTF-8, preserve the source BOM required for Chinese completion tokens, and accept the documented Chinese evaluations in both PowerShell and shell hooks. The reminder now requests a[mnemon]completion marker for other languages.Closes #142.
{"stop_hook_active":true,"last_assistant_message":"中"}with CP936 console inputblock无需写入持久记忆or已写入记忆blockblockThe opt-in runtime suite installs hooks with the built CLI in an isolated home containing spaces and Chinese characters, verifies the installed bytes, and runs both the original asset and the fixed hooks. Windows runs require
powershell.exe5.1. The regular deterministic CI gate remains unchanged; the Manual Integration workflow adds a targetedzcode-windowsselection.Validation:
go build -o mnemon .andmake testpass.After updating Mnemon, rerun
mnemon setup --target zcode --global --yesand start a new ZCode session to refresh installed hooks. The verification covers actual installed hook processes; it does not exercise the ZCode GUI.