xonecas.io
64875
Mc

mini-coder / commit 84d8cf8

feat(stream-render): render reasoning blocks raw, dim+italic, 2-space indent

- Remove markdown rendering for reasoning lines; bypass renderLine entirely
- Apply c.dim(c.italic(...)) for completed reasoning lines
- Replace │ gutter with 2-space indent in both renderSingleLine and streamPrefix
- Reset inFence at reasoning block entry/exit boundaries to prevent
  fence state corruption across block transitions
- Update snapshot test to reflect new indent style

xonecas2026-03-14 84d8cf86ae7c0444927cd8d2dc24af527a4ed580 parent 30abd4d

3 files changed

TODO.md+1−1
@@ -1,6 +1,6 @@
11 # TODO
22
3-- Remove markdown rendering from reasoning blocks. render raw in dimmed color. Remove the leading | character but keep the ident. Could we make it italic easily?
3+- ~~Remove markdown rendering from reasoning blocks. render raw in dimmed color. Remove the leading | character but keep the ident. Could we make it italic easily?~~ ✓ Done — reasoning renders raw, dim+italic, 2-space indent; `inFence` reset at block boundaries.
44 - Investigate db lock issues with spawning parallel subagents:
55
66 ```
src/cli/stream-render.test.ts+1−1
@@ -331,7 +331,7 @@ describe("renderTurn", () => {
331331
332332 // The partial reasoning text is streamed raw and then overwritten on
333333 // turn-end with the properly styled (dimmed) version.
334- expect(simulateTerminal(stdout)).toBe("· reasoning\n│ thinking\n");
334+ expect(simulateTerminal(stdout)).toBe("· reasoning\n thinking\n");
335335 expect(hasAnsi(stdout, "[2m")).toBe(true);
336336 expect(result.reasoningText).toBe("thinking");
337337 });
src/cli/stream-render.ts+9−6
@@ -75,9 +75,12 @@ export async function renderTurn(
7575 reasoningBlankLineRun = 0;
7676 }
7777
78+ if (inReasoning) {
79+ return ` ${c.dim(c.italic(source))}`;
80+ }
7881 const rendered = renderLine(source, inFence);
7982 inFence = rendered.inFence;
80- return inReasoning ? `${c.dim("│ ")}${rendered.output}` : rendered.output;
83+ return rendered.output;
8184 }
8285
8386 const emojiLikeRegex = /\p{Extended_Pictographic}/u;
@@ -253,6 +256,7 @@ export async function renderTurn(
253256 writeln();
254257 inText = false;
255258 inReasoning = false;
259+ inFence = false; // reasoning is never markdown; reset fence state at boundary
256260 reasoningBlankLineRun = 0;
257261 styledPrefix = "";
258262 resetLineState();
@@ -363,11 +367,10 @@ export async function renderTurn(
363367 spinner.stop();
364368 writeln(`${G.info} ${c.dim("reasoning")}`);
365369 inReasoning = true;
366- // streamPrefix is written by streamPartialLine before the first
367- // chars of each line to show the "│ " gutter in the raw preview.
368- // styledPrefix is empty because renderSingleLine already includes
369- // "│ " in its output for reasoning lines.
370- streamPrefix = c.dim("│ ");
370+ inFence = false; // reasoning is never markdown; reset fence state at boundary
371+ // streamPrefix provides the 2-space indent for the raw partial
372+ // preview; renderSingleLine applies the same indent for completed lines.
373+ streamPrefix = " ";
371374 styledPrefix = "";
372375 streamPrefixWritten = false;
373376 }