Own the surrogate-crash class at three chokepoints instead of leaf sites: - finalize_turn scrubs final_response once where model text leaves the conversation loop — covers oneshot stdout (#80366), NIM/any-provider responses (#19819), and every delivery consumer of the turn result. - _sanitize_gateway_final_response scrubs at the gateway chat-surface boundary — Telegram utf16_len (#55309) and Signal formatting (#55143) can no longer see a lone surrogate; raw-text surfaces keep passthrough. - run_conversation walks the fully-built api_kwargs with _sanitize_structure_surrogates so tool descriptions (session_search, #50959) and every other request-body leaf are JSON-encodable before any provider sees them. Regression tests pin all three chokepoints plus helper semantics. Cherry-picked alongside #79240 (TheophilusChinomona) and #80374 (rainbowgore) whose commits precede this one with authorship preserved.
2 lines
20 B
Plaintext
2 lines
20 B
Plaintext
TheophilusChinomona
|