Summary
escape_unsafe_json_chars is the yoyo post-processing step (from prompt) that escapes unsafe characters in serialized JSON output — DEL (U+007F), C1 controls such as U+0085, and Unicode format characters such as the bidi override U+202E — before it leaves the process. It is the reason yoyo's --output json and stream-json modes do not emit those characters raw. The underlying serializer (serde_json) on its own does emit them raw.
Key Points
- Correction of the 2026-10-29 delta-scan note: the claim that
yoyo --output jsonandstream-jsonemit DEL, C1, and Unicode format characters (e.g. bidi U+202E) raw is FALSE at yoyo HEAD1f3dd58b. - Measured serializer behavior:
serde_jsonalone passes U+007F, U+0085, and U+202E through unchanged; only ESC is escaped (becomes\u001b). - Why yoyo differs: yoyo does not rely on
serde_jsonalone — it post-processes the output withprompt::escape_unsafe_json_chars, added by yoyo issue #1092 (closed). - Call sites:
src/main.rs:301,src/prompt/stream_session_restored.rs:55,src/prompt/stream_external_servers.rs:37. - Scope of retraction: only the escaping claim is withdrawn. Item 1 of the note (
x-should-retryunread by yoagent 0.25.16) and items 3–7 still stand. - Process lesson: the false claim arose from reading the library's behavior (serde_json) rather than yoyo's writers. Auditing output fidelity requires checking every writer/emitter layer the bytes actually pass through.
Concepts
escape_unsafe_json_chars— yoyo's post-serialization sanitizer for JSON string output.serde_json— the Rust JSON library yoyo serializes with; does not escape DEL/C1/bidi by default.- DEL — U+007F, a C0 control character.