Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 25 additions & 0 deletions src/core/config/ContextProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export class ContextProxy {
private stateCache: GlobalState
private secretCache: SecretState
private _isInitialized = false
private secretsChangeDisposable?: vscode.Disposable
private onSecretChangeCallback?: () => void | Promise<void>

constructor(context: vscode.ExtensionContext) {
this.originalContext = context
Expand Down Expand Up @@ -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()
}
})
Comment on lines +98 to +103
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 Code Quality

Issue: The event listener for secret changes lacks error handling. If refreshSecrets or the callback fails, it could lead to unhandled promise rejections.

Fix: Wrap the execution in a try-catch block to safely handle any errors during the update process.

Impact: Prevents silent failures and unhandled rejections

Suggested change
this.secretsChangeDisposable = this.originalContext.secrets.onDidChange(async () => {
await this.refreshSecrets()
if (this.onSecretChangeCallback) {
await this.onSecretChangeCallback()
}
})
this.secretsChangeDisposable = this.originalContext.secrets.onDidChange(async () => {
try {
await this.refreshSecrets()
if (this.onSecretChangeCallback) {
await this.onSecretChangeCallback()
}
} catch (error) {
console.error("Failed to handle secret change:", error)
}
})


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<void>) {
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
*/
Expand Down
15 changes: 15 additions & 0 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +304 to +311
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 Performance

Issue: The onDidChangeWindowState listener triggers a secret refresh every time the window gains focus. Since secrets.onDidChange (handled in ContextProxy) already provides reliable cross-window synchronization, this focus handler creates unnecessary overhead.

Fix: Remove the redundant focus listener and rely on the event-driven synchronization.

Impact: Reduces unnecessary IPC calls and secret storage reads

Suggested change
// 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()
})
}

/**
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading