This website requires JavaScript.
Explore
Help
Register
Sign in
viktor
/
infra
Watch
1
Star
0
Fork
You've already forked infra
0
Code
Issues
Pull requests
Projects
Releases
Packages
Wiki
Activity
Actions
2
0fa5852ec6
infra
/
cli
/
VERSION
2 lines
7 B
Text
Raw
Normal View
History
Unescape
Escape
homelab v0.8.2: fix `memory recall` truncating multibyte UTF-8 mid-character emo's Claude Code sessions hit "UserPromptSubmit hook error" on almost every prompt. Root cause: the homelab-memory-recall.py UserPromptSubmit hook runs `homelab memory recall <prompt>` and strict-decodes its stdout. printMemories truncated each memory's preview with a BYTE slice (c[:240]), which cuts through the middle of a 2-byte Cyrillic character and emits invalid UTF-8 (a dangling 0xd0 lead byte). The hook's subprocess.run(text=True) then raised UnicodeDecodeError — not caught by its `except (TimeoutExpired, OSError)` — so the hook exited non-zero and Claude surfaced the error. It is Cyrillic-specific (ASCII has no multibyte chars to split), so it bit emo (Bulgarian prompts) every turn while English users almost never saw it. Two-layer fix: - cli: truncatePreview() now counts RUNES, not bytes, so the preview never splits a character. Regression test asserts valid UTF-8 on a long Cyrillic string. Fixes the root for every consumer of `memory recall` / `memory list`. - hook: subprocess.run gains errors="replace" and the except is broadened to honor the script's own "best-effort, exit 0" contract — so a truncated or otherwise odd payload can never again surface as a hook error. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 09:40:51 +00:00
v0.8.2
Reference in a new issue
Copy permalink