(host: SlashCommandHost)
| 423 | } |
| 424 | |
| 425 | async 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 | |
| 442 | async function resumeGoal(host: SlashCommandHost): Promise<void> { |
| 443 | if (host.state.appState.model.trim().length === 0 || host.session === undefined) { |
no test coverage detected