xonecas.io
64875
Mc

mini-coder / commit 651e1a6

fix: show spinner when a custom command spawns a subagent

xonecas2026-03-11 651e1a6548d026577c015c60322ae4137f195d8d parent 1232496

3 files changed

TODO.md+0−1
@@ -2,7 +2,6 @@
22
33 - Investigate why orc subagent never calls subagents.
44 - Remember active agent across sessions.
5-- When a command spawns a subagent, there is no spinner shown
65
76 ## Investigate error:
87
src/agent/agent.ts+2−0
@@ -171,6 +171,8 @@ export async function runAgent(
171171 reporter: opts.reporter,
172172 }),
173173 connectMcpServer: connectAndAddMcp,
174+ startSpinner: (label?: string) => opts.reporter.startSpinner(label),
175+ stopSpinner: () => opts.reporter.stopSpinner(),
174176 startNewSession: () => runner.startNewSession(),
175177 };
176178
src/cli/commands.ts+5−0
@@ -45,6 +45,8 @@ export interface CommandContext {
4545 activeAgent: string | null;
4646 setActiveAgent: (name: string | null, systemPrompt?: string) => void;
4747
48+ startSpinner: (label?: string) => void;
49+ stopSpinner: () => void;
4850 cwd: string;
4951 }
5052
@@ -366,7 +368,9 @@ async function handleCustomCommand(
366368 }
367369
368370 try {
371+ ctx.startSpinner("subagent");
369372 const output = await ctx.runSubagent(prompt, cmd.agent, cmd.model);
373+ ctx.stopSpinner();
370374 assertSubagentMerged(output);
371375
372376 write(renderMarkdown(output.result));
@@ -377,6 +381,7 @@ async function handleCustomCommand(
377381 text: `/${cmd.name} output:\n\n${output.result}\n\n<system-message>Summarize the findings above to the user.</system-message>`,
378382 };
379383 } catch (e) {
384+ ctx.stopSpinner();
380385 writeln(`${PREFIX.error} /${cmd.name} failed: ${String(e)}`);
381386 return { type: "handled" };
382387 }