MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / cancelGoal

Function cancelGoal

apps/kimi-code/src/tui/commands/goal.ts:462–477  ·  view source on GitHub ↗
(host: SlashCommandHost)

Source from the content-addressed store, hash-verified

460}
461
462async function cancelGoal(host: SlashCommandHost): Promise<void> {
463 const session = host.requireSession();
464 try {
465 await session.cancelGoal();
466 if (isStreaming(host)) await session.cancel();
467 } catch (error) {
468 if (isKimiError(error) && error.code === ErrorCodes.GOAL_NOT_FOUND) {
469 host.showStatus('No goal to cancel.');
470 return;
471 }
472 host.showError(formatErrorMessage(error));
473 return;
474 }
475 host.track('goal_cancel');
476 host.showNotice('Goal cancelled.');
477}
478
479async function showGoalStatus(host: SlashCommandHost): Promise<void> {
480 const { goal } = await host.requireSession().getGoal();

Callers 1

handleGoalCommandFunction · 0.70

Calls 10

formatErrorMessageFunction · 0.90
isStreamingFunction · 0.85
isKimiErrorFunction · 0.85
requireSessionMethod · 0.65
cancelMethod · 0.65
showStatusMethod · 0.65
showErrorMethod · 0.65
trackMethod · 0.65
showNoticeMethod · 0.65
cancelGoalMethod · 0.45

Tested by

no test coverage detected