syncAgentTerminalSnapshot checked the stale lastSnapshots prefix-delta before
the authoritative backlog (body) prefix-delta. Live agent.terminal.output
chunks advance the backlog but never lastSnapshots, so once any chunk has
streamed since the last snapshot, body is strictly longer than previous and
both are prefixes of a catch-up process.list snapshot. The fence-first branch
then emitted output.slice(previous.length), re-appending bytes the chunks had
already written and duplicating them on screen and in the replay backlog.
body is the authoritative on-screen state and is always >= previous, so its
delta is the correct, smaller one; check it first. Regression case added to
agent-terminal-stream.bound.test.ts (red without the swap).
Co-authored-by: briandevans <252620095+briandevans@users.noreply.github.com>