(session: Session, statusMessage: string)
| 1648 | } |
| 1649 | |
| 1650 | async reloadCurrentSessionView(session: Session, statusMessage: string): Promise<void> { |
| 1651 | this.sessionEventUnsubscribe?.(); |
| 1652 | this.sessionEventUnsubscribe = undefined; |
| 1653 | this.clearReverseRpcPanels(); |
| 1654 | session.setApprovalHandler(undefined); |
| 1655 | session.setQuestionHandler(undefined); |
| 1656 | this.approvalController.cancelAll('reloading session'); |
| 1657 | this.questionController.cancelAll('reloading session'); |
| 1658 | |
| 1659 | this.resetSessionRuntime(); |
| 1660 | this.session = session; |
| 1661 | this.harness.setTelemetryContext({ sessionId: session.id }); |
| 1662 | this.registerSessionHandlers(session); |
| 1663 | await this.syncRuntimeState(session); |
| 1664 | this.updateTerminalTitle(); |
| 1665 | try { |
| 1666 | await this.refreshSkillCommands(session); |
| 1667 | await this.refreshPluginCommands(session); |
| 1668 | } catch { |
| 1669 | /* keep the reloaded session usable even if dynamic skills fail */ |
| 1670 | } |
| 1671 | this.sessionEventHandler.startSubscription(); |
| 1672 | const resumeState = session.getResumeState(); |
| 1673 | if (resumeState?.warning !== undefined) { |
| 1674 | this.showStatus(`Warning: ${resumeState.warning}`, 'warning'); |
| 1675 | } |
| 1676 | this.showStatus(statusMessage); |
| 1677 | void this.showSessionWarnings(session); |
| 1678 | } |
| 1679 | |
| 1680 | async createNewSession(): Promise<void> { |
| 1681 | if (this.state.appState.isReplaying) { |
nothing calls this directly
no test coverage detected