3 Commits

Author SHA1 Message Date
Leveling
d889815577 fix(mastery): resolve formatted choice answers by exact option body (#3129)
Fixes #2863.

Exact normalized option-body matching for resolve_answer (whitespace / Markdown / LaTeX wrappers), without normalized substring false positives. Preserves literal operators and unresolved ambiguity.

Co-authored-by: Chih-Kai-Wang <290806361+Chih-Kai-Wang@users.noreply.github.com>
2026-12-01 16:51:36 +08:00
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