Skip to content

Commit 08c9420

Browse files
fix (#5540)
1 parent 6e473f5 commit 08c9420

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/activate/registerCommands.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { registerHumanRelayCallback, unregisterHumanRelayCallback, handleHumanRe
1414
import { handleNewTask } from "./handleTask"
1515
import { CodeIndexManager } from "../services/code-index/manager"
1616
import { importSettingsWithFeedback } from "../core/config/importExport"
17+
import { MdmService } from "../services/mdm/MdmService"
1718
import { t } from "../i18n"
1819

1920
/**
@@ -226,7 +227,17 @@ export const openClineInNewTab = async ({ context, outputChannel }: Omit<Registe
226227
// https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/src/extension.ts
227228
const contextProxy = await ContextProxy.getInstance(context)
228229
const codeIndexManager = CodeIndexManager.getInstance(context)
229-
const tabProvider = new ClineProvider(context, outputChannel, "editor", contextProxy, codeIndexManager)
230+
231+
// Get the existing MDM service instance to ensure consistent policy enforcement
232+
let mdmService: MdmService | undefined
233+
try {
234+
mdmService = MdmService.getInstance()
235+
} catch (error) {
236+
// MDM service not initialized, which is fine - extension can work without it
237+
mdmService = undefined
238+
}
239+
240+
const tabProvider = new ClineProvider(context, outputChannel, "editor", contextProxy, codeIndexManager, mdmService)
230241
const lastCol = Math.max(...vscode.window.visibleTextEditors.map((editor) => editor.viewColumn || 0))
231242

232243
// Check if there are any visible text editors, otherwise open a new group

0 commit comments

Comments
 (0)