@@ -8,7 +8,8 @@ import {
88 listMcpServers,
99 upsertMcpServer,
1010 } from "../session/db.ts";
11-import { PREFIX, renderError, renderInfo, writeln } from "./output.ts";
11+import { renderMarkdown } from "./markdown.ts";
12+import { PREFIX, renderError, renderInfo, write, writeln } from "./output.ts";
1213
1314 // ─── Types ────────────────────────────────────────────────────────────────────
1415
@@ -31,7 +32,8 @@ export interface CommandContext {
3132 export type CommandResult =
3233 | { type: "handled" }
3334 | { type: "unknown"; command: string }
34- | { type: "exit" };
35+ | { type: "exit" }
36+ | { type: "inject-user-message"; text: string };
3537
3638 // ─── Command handlers ─────────────────────────────────────────────────────────
3739
@@ -268,7 +270,10 @@ Only review the changed code, not pre-existing code.
268270 - End with a short **Summary** of the most important items.
269271 `;
270272
271-async function handleReview(ctx: CommandContext, args: string): Promise<void> {
273+async function handleReview(
274+ ctx: CommandContext,
275+ args: string,
276+): Promise<CommandResult> {
272277 const focus = args.trim();
273278 writeln(
274279 `${PREFIX.info} ${c.cyan("review")} ${c.dim("— spawning review subagent…")}`,
@@ -278,13 +283,18 @@ async function handleReview(ctx: CommandContext, args: string): Promise<void> {
278283 try {
279284 const { result } = await ctx.runSubagent(REVIEW_PROMPT(ctx.cwd, focus));
280285
281- // Stream the result line-by-line for readable output
282- for (const line of result.split("\n")) {
283- writeln(` ${line}`);
284- }
286+ // Show review results.
287+ write(renderMarkdown(result));
285288 writeln();
289+
290+ // Send results to LLM as well.
291+ return {
292+ type: "inject-user-message",
293+ text: `Code review output:\n\n${result}\n\n<system-message>Review the findings and summarize them to the user.</system-message>`,
294+ };
286295 } catch (e) {
287296 writeln(`${PREFIX.error} review failed: ${String(e)}`);
297+ return { type: "handled" };
288298 }
289299 }
290300
@@ -357,8 +367,7 @@ export async function handleCommand(
357367 return { type: "handled" };
358368
359369 case "review":
360- await handleReview(ctx, args);
361- return { type: "handled" };
370+ return await handleReview(ctx, args);
362371
363372 case "help":
364373 case "?":