xonecas.io
64875
Mc

mini-coder / commit f1dc947

refactor: use finally block for stopping subagent spinner

xonecas2026-03-11 f1dc9477cdd7a28281a49939cff012e754b88316 parent 651e1a6

1 file changed

src/cli/commands.ts+2−2
@@ -370,7 +370,6 @@ async function handleCustomCommand(
370370 try {
371371 ctx.startSpinner("subagent");
372372 const output = await ctx.runSubagent(prompt, cmd.agent, cmd.model);
373- ctx.stopSpinner();
374373 assertSubagentMerged(output);
375374
376375 write(renderMarkdown(output.result));
@@ -381,9 +380,10 @@ async function handleCustomCommand(
381380 text: `/${cmd.name} output:\n\n${output.result}\n\n<system-message>Summarize the findings above to the user.</system-message>`,
382381 };
383382 } catch (e) {
384- ctx.stopSpinner();
385383 writeln(`${PREFIX.error} /${cmd.name} failed: ${String(e)}`);
386384 return { type: "handled" };
385+ } finally {
386+ ctx.stopSpinner();
387387 }
388388 }