(reason: string)
| 1504 | } |
| 1505 | |
| 1506 | private unloadCurrentSession(reason: string): Session | undefined { |
| 1507 | const previous = this.session; |
| 1508 | this.sessionEventUnsubscribe?.(); |
| 1509 | this.sessionEventUnsubscribe = undefined; |
| 1510 | this.clearReverseRpcPanels(); |
| 1511 | previous?.setApprovalHandler(undefined); |
| 1512 | previous?.setQuestionHandler(undefined); |
| 1513 | this.approvalController.cancelAll(reason); |
| 1514 | this.questionController.cancelAll(reason); |
| 1515 | this.session = undefined; |
| 1516 | this.state.swarmModeEntry = undefined; |
| 1517 | this.harness.setTelemetryContext({ sessionId: null }); |
| 1518 | this.setAppState({ goal: null }); |
| 1519 | return previous; |
| 1520 | } |
| 1521 | |
| 1522 | private clearReverseRpcPanels(): void { |
| 1523 | for (const dispose of this.reverseRpcDisposers) { |
no test coverage detected