Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2255,6 +2255,18 @@ export class ClineProvider
return
}

// Log out from cloud if authenticated
if (CloudService.hasInstance() && CloudService.instance.isAuthenticated()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Consider using hasActiveSession() instead of isAuthenticated() to decide whether to logout. This better reflects the condition that a session exists and avoids coupling to auth semantics that may require initialization states.

Suggested change
if (CloudService.hasInstance() && CloudService.instance.isAuthenticated()) {
if (CloudService.hasInstance() && CloudService.instance.hasActiveSession()) {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (CloudService.hasInstance() && CloudService.instance.isAuthenticated()) {
if (CloudService.hasInstance()) {

try {
await CloudService.instance.logout()
} catch (error) {
this.log(
`Failed to logout from cloud during reset: ${error instanceof Error ? error.message : String(error)}`,
)
// Continue with reset even if logout fails
}
}

await this.contextProxy.resetAllState()
await this.providerSettingsManager.resetAllConfigs()
await this.customModesManager.resetCustomModes()
Expand Down
Loading