fix(tui): render inline diffs inside assistant completion

Follow-up for #13729: segment-level system artifacts still looked detached in real flow.\n\nInstead of appending inline_diff as a standalone segment/system row, queue sanitized diffs during tool.complete and append them as a fenced diff block to the assistant completion text on message.complete. This keeps the diff in the same message flow as the assistant response.
This commit is contained in:
Brooklyn Nicholson 2026-04-21 19:02:53 -05:00
parent bddf0cd61e
commit 31b3b09ea4
3 changed files with 30 additions and 40 deletions

View file

@ -272,12 +272,10 @@ export function createGatewayEventHandler(ctx: GatewayEventHandlerContext): (ev:
return
}
// Push into the active turn's segment stream so the diff renders
// inline with the assistant's output. Routing through `sys()`
// lands it in the completed-history section above the streaming
// bubble — which is why blitz testers saw diffs "appear at the
// top, out of sequence" with the rest of the turn.
turnController.appendSegmentMessage({ role: 'system', text: diffText })
// Keep inline diffs attached to the assistant completion body so
// they render in the same message flow, not as a standalone system
// artifact that can look out-of-place around tool rows.
turnController.queueInlineDiff(diffText)
}
return