(input: ReloadSessionPayload)
| 453 | } |
| 454 | |
| 455 | async reloadSession(input: ReloadSessionPayload): Promise<ResumeSessionResult> { |
| 456 | const summary = await this.sessionStore.get(input.sessionId); |
| 457 | const active = this.sessions.get(summary.id); |
| 458 | if (active?.hasActiveTurn === true) { |
| 459 | throw new KimiError( |
| 460 | ErrorCodes.TURN_AGENT_BUSY, |
| 461 | `Session "${summary.id}" cannot be reloaded while a turn is running`, |
| 462 | { details: { sessionId: summary.id } }, |
| 463 | ); |
| 464 | } |
| 465 | |
| 466 | this.reloadProviderManager(); |
| 467 | this.clearRuntimeCache(); |
| 468 | await this.reloadPlugins({}); |
| 469 | |
| 470 | if (active !== undefined) { |
| 471 | await active.closeForReload(); |
| 472 | this.sessions.delete(summary.id); |
| 473 | } |
| 474 | return this.resumeSessionWithOverrides( |
| 475 | { sessionId: summary.id }, |
| 476 | { forcePluginSessionStartReminder: input.forcePluginSessionStartReminder }, |
| 477 | ); |
| 478 | } |
| 479 | |
| 480 | async forkSession(input: ForkSessionPayload): Promise<ResumeSessionResult> { |
| 481 | const source = await this.sessionStore.get(input.sessionId); |
no test coverage detected