Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 3d37e05

Browse files
authored
Remove MDM and organization membership enforcement (#12323)
1 parent ad25634 commit 3d37e05

28 files changed

Lines changed: 11 additions & 914 deletions

packages/types/src/vscode-extension-host.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ export type ExtensionState = Pick<
370370
lastShownAnnouncementId?: string
371371
apiModelId?: string
372372
mcpServers?: McpServer[]
373-
mdmCompliant?: boolean
374373
taskSyncEnabled: boolean
375374
openAiCodexIsAuthenticated?: boolean
376375
debug?: boolean
@@ -542,7 +541,6 @@ export interface WebviewMessage {
542541
| "deleteCommand"
543542
| "createCommand"
544543
| "insertTextIntoTextarea"
545-
| "showMdmAuthRequiredNotification"
546544
| "imageGenerationSettings"
547545
| "queueMessage"
548546
| "removeQueuedMessage"

src/__tests__/extension.spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,6 @@ vi.mock("../services/code-index/manager", () => ({
143143
},
144144
}))
145145

146-
vi.mock("../services/mdm/MdmService", () => ({
147-
MdmService: {
148-
createInstance: vi.fn().mockResolvedValue(null),
149-
},
150-
}))
151-
152146
vi.mock("../utils/migrateSettings", () => ({
153147
migrateSettings: vi.fn().mockResolvedValue(undefined),
154148
}))

src/activate/registerCommands.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { focusPanel } from "../utils/focusPanel"
1212
import { handleNewTask } from "./handleTask"
1313
import { CodeIndexManager } from "../services/code-index/manager"
1414
import { importSettingsWithFeedback } from "../core/config/importExport"
15-
import { MdmService } from "../services/mdm/MdmService"
1615
import { t } from "../i18n"
1716

1817
/**
@@ -205,16 +204,7 @@ export const openClineInNewTab = async ({ context, outputChannel }: Omit<Registe
205204
const contextProxy = await ContextProxy.getInstance(context)
206205
const codeIndexManager = CodeIndexManager.getInstance(context)
207206

208-
// Get the existing MDM service instance to ensure consistent policy enforcement
209-
let mdmService: MdmService | undefined
210-
try {
211-
mdmService = MdmService.getInstance()
212-
} catch (error) {
213-
// MDM service not initialized, which is fine - extension can work without it
214-
mdmService = undefined
215-
}
216-
217-
const tabProvider = new ClineProvider(context, outputChannel, "editor", contextProxy, mdmService)
207+
const tabProvider = new ClineProvider(context, outputChannel, "editor", contextProxy)
218208
const lastCol = Math.max(...vscode.window.visibleTextEditors.map((editor) => editor.viewColumn || 0))
219209

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

src/core/webview/ClineProvider.ts

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ import { MarketplaceManager } from "../../services/marketplace"
7474
import { ShadowCheckpointService } from "../../services/checkpoints/ShadowCheckpointService"
7575
import { CodeIndexManager } from "../../services/code-index/manager"
7676
import type { IndexProgressUpdate } from "../../services/code-index/interfaces/manager"
77-
import { MdmService } from "../../services/mdm/MdmService"
7877
import { SkillsManager } from "../../services/skills/SkillsManager"
7978

8079
import { fileExistsAtPath } from "../../utils/fs"
@@ -143,7 +142,6 @@ export class ClineProvider
143142
protected mcpHub?: McpHub // Change from private to protected
144143
protected skillsManager?: SkillsManager
145144
private marketplaceManager: MarketplaceManager
146-
private mdmService?: MdmService
147145
private taskCreationCallback: (task: Task) => void
148146
private taskEventListeners: WeakMap<Task, Array<() => void>> = new WeakMap()
149147
private currentWorkspacePath: string | undefined
@@ -178,14 +176,12 @@ export class ClineProvider
178176
private readonly outputChannel: vscode.OutputChannel,
179177
private readonly renderContext: "sidebar" | "editor" = "sidebar",
180178
public readonly contextProxy: ContextProxy,
181-
mdmService?: MdmService,
182179
) {
183180
super()
184181
this.currentWorkspacePath = getWorkspacePath()
185182

186183
ClineProvider.activeInstances.add(this)
187184

188-
this.mdmService = mdmService
189185
this.updateGlobalState("codebaseIndexModels", EMBEDDING_MODEL_PROFILES)
190186

191187
// Initialize the per-task file-based history store.
@@ -1971,12 +1967,6 @@ export class ClineProvider
19711967
this.clineMessagesSeq++
19721968
state.clineMessagesSeq = this.clineMessagesSeq
19731969
this.postMessageToWebview({ type: "state", state })
1974-
1975-
// Check MDM compliance and send user to account tab if not compliant
1976-
// Only redirect if there's an actual MDM policy requiring authentication
1977-
if (this.mdmService?.requiresCloudAuth() && !this.checkMdmCompliance()) {
1978-
await this.postMessageToWebview({ type: "action", action: "cloudButtonClicked" })
1979-
}
19801970
}
19811971

19821972
/**
@@ -1993,11 +1983,6 @@ export class ClineProvider
19931983
state.clineMessagesSeq = this.clineMessagesSeq
19941984
const { taskHistory: _omit, ...rest } = state
19951985
this.postMessageToWebview({ type: "state", state: rest })
1996-
1997-
// Preserve existing MDM redirect behavior
1998-
if (this.mdmService?.requiresCloudAuth() && !this.checkMdmCompliance()) {
1999-
await this.postMessageToWebview({ type: "action", action: "cloudButtonClicked" })
2000-
}
20011986
}
20021987

20031988
/**
@@ -2015,11 +2000,6 @@ export class ClineProvider
20152000
const state = await this.getStateToPostToWebview()
20162001
const { clineMessages: _omitMessages, taskHistory: _omitHistory, ...rest } = state
20172002
this.postMessageToWebview({ type: "state", state: rest })
2018-
2019-
// Preserve existing MDM redirect behavior
2020-
if (this.mdmService?.requiresCloudAuth() && !this.checkMdmCompliance()) {
2021-
await this.postMessageToWebview({ type: "action", action: "cloudButtonClicked" })
2022-
}
20232003
}
20242004

20252005
/**
@@ -2335,9 +2315,6 @@ export class ClineProvider
23352315
codebaseIndexBedrockProfile: codebaseIndexConfig?.codebaseIndexBedrockProfile,
23362316
codebaseIndexOpenRouterSpecificProvider: codebaseIndexConfig?.codebaseIndexOpenRouterSpecificProvider,
23372317
},
2338-
// Only set mdmCompliant if there's an actual MDM policy
2339-
// undefined means no MDM policy, true means compliant, false means non-compliant
2340-
mdmCompliant: this.mdmService?.requiresCloudAuth() ? this.checkMdmCompliance() : undefined,
23412318
profileThresholds: profileThresholds ?? {},
23422319
cloudApiUrl: getRooCodeApiUrl(),
23432320
hasOpenedModeSelector: this.getGlobalState("hasOpenedModeSelector") ?? false,
@@ -2751,24 +2728,6 @@ export class ClineProvider
27512728
return this.skillsManager
27522729
}
27532730

2754-
/**
2755-
* Check if the current state is compliant with MDM policy
2756-
* @returns true if compliant or no MDM policy exists, false if MDM policy exists and user is non-compliant
2757-
*/
2758-
public checkMdmCompliance(): boolean {
2759-
if (!this.mdmService) {
2760-
return true // No MDM service, allow operation
2761-
}
2762-
2763-
const compliance = this.mdmService.isCompliant()
2764-
2765-
if (!compliance.compliant) {
2766-
return false
2767-
}
2768-
2769-
return true
2770-
}
2771-
27722731
/**
27732732
* Gets the CodeIndexManager for the current active workspace
27742733
* @returns CodeIndexManager instance for the current workspace or the default one

src/core/webview/webviewMessageHandler.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3229,12 +3229,6 @@ export const webviewMessageHandler = async (
32293229
}
32303230
break
32313231
}
3232-
case "showMdmAuthRequiredNotification": {
3233-
// Show notification that organization requires authentication
3234-
vscode.window.showWarningMessage(t("common:mdm.info.organization_requires_auth"))
3235-
break
3236-
}
3237-
32383232
/**
32393233
* Chat Message Queue
32403234
*/

src/extension.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import { TerminalRegistry } from "./integrations/terminal/TerminalRegistry"
3535
import { openAiCodexOAuthManager } from "./integrations/openai-codex/oauth"
3636
import { McpServerManager } from "./services/mcp/McpServerManager"
3737
import { CodeIndexManager } from "./services/code-index/manager"
38-
import { MdmService } from "./services/mdm/MdmService"
3938
import { migrateSettings } from "./utils/migrateSettings"
4039
import { autoImportSettings } from "./utils/autoImportSettings"
4140
import { API } from "./extension/api"
@@ -146,9 +145,6 @@ export async function activate(context: vscode.ExtensionContext) {
146145
// Create logger for cloud services.
147146
const cloudLogger = createDualLogger(createOutputChannelLogger(outputChannel))
148147

149-
// Initialize MDM service
150-
const mdmService = await MdmService.createInstance(cloudLogger)
151-
152148
// Initialize i18n for internationalization support.
153149
initializeI18n(context.globalState.get("language") ?? formatLanguage(vscode.env.language))
154150

@@ -192,7 +188,7 @@ export async function activate(context: vscode.ExtensionContext) {
192188
}
193189

194190
// Initialize the provider *before* the Roo Code Cloud service.
195-
const provider = new ClineProvider(context, outputChannel, "sidebar", contextProxy, mdmService)
191+
const provider = new ClineProvider(context, outputChannel, "sidebar", contextProxy)
196192

197193
// Initialize Roo Code Cloud service.
198194
const postStateListener = () => ClineProvider.getVisibleInstance()?.postStateToWebviewWithoutClineMessages()

src/i18n/locales/ca/common.json

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/de/common.json

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/en/common.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,6 @@
217217
"rulesCleanupFailed": "Mode removed successfully, but failed to delete rules folder at {{rulesFolderPath}}. You may need to delete it manually."
218218
}
219219
},
220-
"mdm": {
221-
"errors": {
222-
"cloud_auth_required": "Your organization requires Roo Code Cloud authentication. Please sign in to continue.",
223-
"organization_mismatch": "You must be authenticated with your organization's Roo Code Cloud account.",
224-
"verification_failed": "Unable to verify organization authentication."
225-
},
226-
"info": {
227-
"organization_requires_auth": "Your organization requires authentication."
228-
}
229-
},
230220
"prompts": {
231221
"deleteMode": {
232222
"title": "Delete Custom Mode",

src/i18n/locales/es/common.json

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)