exit_order is for placing the exit order for CO. You need to use place_order to exit the order for regular order. There you can use the tag param to specify the source.
You don't need to use generate_session for every run. You can directly set access_token kite.set_access_token("your obtained access token"), post successfully generating access toke…
pykiteconnect comes with reconnect support. You don't have to do anything, library itself takes care of reconnection and re-subscribes after reconnect. You can check out documentation to know how to …