@@ -14,6 +14,7 @@ import { registerHumanRelayCallback, unregisterHumanRelayCallback, handleHumanRe
1414import { handleNewTask } from "./handleTask"
1515import { CodeIndexManager } from "../services/code-index/manager"
1616import { importSettingsWithFeedback } from "../core/config/importExport"
17+ import { MdmService } from "../services/mdm/MdmService"
1718import { 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