From 6d9404aa4dc14236fbe5ebd5ed3e2686e5d0d552 Mon Sep 17 00:00:00 2001 From: code-crusher Date: Tue, 3 Feb 2026 18:24:47 +0530 Subject: [PATCH 1/2] fix multi-window auth sync --- src/core/config/ContextProxy.ts | 25 +++++++++++++++++++++++++ src/core/webview/ClineProvider.ts | 15 +++++++++++++++ src/package.json | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/core/config/ContextProxy.ts b/src/core/config/ContextProxy.ts index 035ebb6bd2..58a0304c94 100644 --- a/src/core/config/ContextProxy.ts +++ b/src/core/config/ContextProxy.ts @@ -40,6 +40,8 @@ export class ContextProxy { private stateCache: GlobalState private secretCache: SecretState private _isInitialized = false + private secretsChangeDisposable?: vscode.Disposable + private onSecretChangeCallback?: () => void | Promise constructor(context: vscode.ExtensionContext) { this.originalContext = context @@ -92,9 +94,32 @@ export class ContextProxy { // Migration: Check for old nested image generation settings and migrate them await this.migrateImageGenerationSettings() + // Listen for secret changes from other windows to keep cache in sync + this.secretsChangeDisposable = this.originalContext.secrets.onDidChange(async () => { + await this.refreshSecrets() + if (this.onSecretChangeCallback) { + await this.onSecretChangeCallback() + } + }) + this._isInitialized = true } + /** + * Register a callback to be invoked when secrets change (e.g., from another window). + * This enables cross-window synchronization of auth tokens and other secrets. + */ + public setOnSecretsChanged(callback: () => void | Promise) { + this.onSecretChangeCallback = callback + } + + /** + * Dispose of resources, including the secrets change listener. + */ + public dispose() { + this.secretsChangeDisposable?.dispose() + } + /** * Migrates old nested openRouterImageGenerationSettings to the new flattened structure */ diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 8344f61ab7..3fee89dc0f 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -300,6 +300,20 @@ export class ClineProvider } else { this.log("CloudService not ready, deferring cloud profile sync") } + + // Multi-window synchronization: refresh secrets when window gains focus + const windowStateDisposable = vscode.window.onDidChangeWindowState(async (e) => { + if (e.focused && this.contextProxy.isInitialized) { + await this.contextProxy.refreshSecrets() + await this.postStateToWebview() + } + }) + this.disposables.push(windowStateDisposable) + + // Listen for secret changes from other windows + this.contextProxy.setOnSecretsChanged(async () => { + await this.postStateToWebview() + }) } /** @@ -628,6 +642,7 @@ export class ClineProvider this.mcpHub = undefined this.marketplaceManager?.cleanup() this.customModesManager?.dispose() + this.contextProxy?.dispose() this.log("Disposed all disposables") ClineProvider.activeInstances.delete(this) diff --git a/src/package.json b/src/package.json index aafed05c10..98b4b25ee0 100644 --- a/src/package.json +++ b/src/package.json @@ -3,7 +3,7 @@ "displayName": "%extension.displayName%", "description": "%extension.description%", "publisher": "matterai", - "version": "5.3.3", + "version": "5.3.4", "icon": "assets/icons/matterai-ic.png", "galleryBanner": { "color": "#FFFFFF", From c1e309a5f8c9bd59daa42ccad7ad98d1a963c7b4 Mon Sep 17 00:00:00 2001 From: code-crusher Date: Tue, 3 Feb 2026 18:28:08 +0530 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e53e9f87d..5cfe418674 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,40 @@ # Changelog +## [v5.3.4] - 2026-02-03 + +### Fixed + +- Fixed multi-window authentication synchronization +- Fixed beta model access for axon-code-2-pro + +--- + +## [v5.3.3] - 2026-02-02 + +### Fixed + +- Fixed beta model access for axon-code-2-pro + +--- + +## [v5.3.2] - 2026-02-02 + +### Added + +- Beta models gating for axon-code-2-pro with backend API integration +- Custom icons utility for improved UI components + +### Changed + +- Set temperature to 0.2 for OpenRouter provider +- Enhanced file edit tool with improved functionality +- Updated kilocode models configuration +- Cleaned up chat text area component +- Updated and optimized test files +- UI improvements across chat components + +--- + ## [v5.3.1] - 2026-01-30 ### Added