In incrementalAppend(), when a prose line follows a closed code fence,
the code checked only whether the last segment was type Text (which code
fences also are) and then tried to append. Since the finalized fence HTML
ends in </pre> not </div>, it fell into the 'shouldn't happen' branch and
overwrote the segment with escapeForHtml(proseLines) — destroying the
rendered tool output.
Tool blocks are always shaped:
```
<output>
```
<blank>
<blank>
so the trailing blank lines triggered this on every tool call, leaving
only <div>\n</div> in renderedHtml.
Fix: gate extension on the segment actually being an in-progress prose
segment (trailing </div>). Otherwise start a new prose segment.
Verified: tool blocks now render 'hi\nexit: 0', file_glob results, and
syntax-highlighted diffs correctly.