The commandcode branch of emitUpstreamTruncation emitted a blank line
("\n\n") after the error record. The commandcode wire is bare JSONL and
every other record on it (nativeErrorChunk, legacyCompletionChunk,
emitPreflightError) is single-newline terminated; a blank line is not a
valid JSONL record and chokes strict consumers at the moment the stream
already failed. Revert to single newline and pin the invariant in the
commandcode-plugin-pipe test (no blank line, endsWith }\n).
PR description claimed the commandcode branch "keeps its shape" from
#5958 — it did not; this restores it.
(cherry picked from commit 910bc13249)
pipePluginJsonlWithStrip flushed its tag-echo/marker filters after every JSONL line. The filters hold partial tag heads and marker prefixes across deltas by design; a per-line flush destroyed that state, so a render tag split across two text-delta lines leaked its ref into client-visible prose, a held prefix at the terminal frame was silently dropped, and a forged marker line completed across deltas escaped stripping. The SSE pipe (pipePluginChatWithStrip) already resolves tails only before terminal frames / EOF / read failure — mirror that here: one filter instance per prose field, tails written back as synthetic lines of the original event type before finish/error/EOF/truncation. Regression tests pin all three facets (#1295).