Repository navigation
Fix incomplete links showing [blocked] during chat streaming - #12104
danielhanchen merged 8 commits into
Conversation
|
Review record for #12104, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#418. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
Fixes #11848.
While a reply is streaming, an unfinished Markdown link gets a temporary
streamdown:incomplete-linkdestination from Streamdown's repair step. That destination is treated as unsafe, so the chat shows[blocked](and sometimes exposes the placeholder) even though the model is still writing the link.This keeps an unfinished link as plain text until its destination is complete. The same check applies when a response ends mid-link, while other incomplete Markdown still uses the existing repair behavior. Completed links keep the normal URL safety checks.
I added rendered regression cases for partial and completed links, including an unsafe completed URL. The focused Markdown tests pass (51/51), and the frontend TypeScript build passes.
Before / after
Same scripted reply on both builds (merge base vs this branch, head 8b27b04). Mid-stream, the link destination is half written:
Settled, on a reply that ends with an unclosed
[(compare arr[i). The completed link still renders normally on both:![Settled: BEFORE ends "arri [blocked]", AFTER ends "arri"
Follow-up commits
linksandimagespasses off (LITERAL_LINK_REMEND), instead of being shown raw. Every other repair (comparison escapes, emphasis, inline code) still applies, so- >= 16 GBfollowed bySee [foostays a list item. The settled path passes the same options through Streamdown'sremendprop, soparseIncompleteMarkdownis unchanged from main.[skip the extra settled remend pass.repairStreamingMarkdown.