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

Function pauseGoal

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

Source from the content-addressed store, hash-verified

423}
424
425async function pauseGoal(host: SlashCommandHost): Promise<void> {
426 const session = host.requireSession();
427 try {
428 await session.pauseGoal();
429 if (isStreaming(host)) await session.cancel();
430 } catch (error) {
431 if (isKimiError(error) && error.code === ErrorCodes.GOAL_NOT_FOUND) {
432 host.showStatus('No goal to pause.');
433 return;
434 }
435 host.showError(formatErrorMessage(error));
436 return;
437 }
438 host.track('goal_pause');
439 host.showStatus('Goal paused. Use `/goal resume` to continue.');
440}
441
442async function resumeGoal(host: SlashCommandHost): Promise<void> {
443 if (host.state.appState.model.trim().length === 0 || host.session === undefined) {

Callers 1

handleGoalCommandFunction · 0.70

Calls 9

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

Tested by

no test coverage detected