MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / resetState

Method resetState

src/core/webview/ClineProvider.ts:2810–2839  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2808 // dev
2809
2810 async resetState() {
2811 const answer = await vscode.window.showInformationMessage(
2812 t("common:confirmation.reset_state"),
2813 { modal: true },
2814 t("common:answers.yes"),
2815 )
2816
2817 if (answer !== t("common:answers.yes")) {
2818 return
2819 }
2820
2821 // Log out from cloud if authenticated
2822 if (CloudService.hasInstance()) {
2823 try {
2824 await CloudService.instance.logout()
2825 } catch (error) {
2826 this.log(
2827 `Failed to logout from cloud during reset: ${error instanceof Error ? error.message : String(error)}`,
2828 )
2829 // Continue with reset even if logout fails
2830 }
2831 }
2832
2833 await this.contextProxy.resetAllState()
2834 await this.providerSettingsManager.resetAllConfigs()
2835 await this.customModesManager.resetCustomModes()
2836 await this.removeClineFromStack()
2837 await this.postStateToWebview()
2838 await this.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
2839 }
2840
2841 // logging
2842

Callers 1

webviewMessageHandlerFunction · 0.80

Calls 12

logMethod · 0.95
removeClineFromStackMethod · 0.95
postStateToWebviewMethod · 0.95
postMessageToWebviewMethod · 0.95
tFunction · 0.90
resetAllStateMethod · 0.80
resetAllConfigsMethod · 0.80
resetCustomModesMethod · 0.80
logoutMethod · 0.65
StringInterface · 0.50
hasInstanceMethod · 0.45

Tested by

no test coverage detected