2 Commits

Author SHA1 Message Date
Mohammad Hijjawi
d16481a77c fix: decode escaped emoji in ask_user cards as real characters (#1780)
decode_escaped_unicode_for_display repairs double-encoded \uXXXX runs
(#973) with the unicode_escape codec, which turns a surrogate-pair escape
for an emoji into two lone surrogates instead of one emoji. The
result cannot be encoded as UTF-8, so an ask_user card or mastery question
whose escaped text contains an emoji fails when the event is persisted to
SQLite or sent over the WebSocket.

Decode each run as a JSON string instead, matching the web decoder's
JSON.parse, and leave runs with an unpaired surrogate escaped.
2026-10-07 20:21:09 +08:00
ZQR1101
81e5ff8e3d fix(tools): decode unicode escapes in ask_user payloads
Models sometimes emit literal \\uXXXX runs in ask_user and mastery_quiz tool args. Decode dense non-ASCII runs when building learner-facing payloads so cards do not leak escapes (#973).
2026-08-28 13:21:08 +08:00