{"record":{"id":"91af9d1e9eeaf488","repo":"different-ai/openwork","slug":"desktop-integration-is-disabled-for-test-profiles","errorCode":null,"errorMessage":"Desktop integration is disabled for test profiles.","messagePattern":"Desktop integration is disabled for test profiles\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/desktop/electron/main.mjs","lineNumber":1862,"sourceCode":"      return showDesktopNotification(args[0] ?? {});\n  },\n  \"desktopSentrySetSession\": async (event, ...args) => {\n      const input = args[0] ?? {};\n      return {\n        enabled: setOpenworkSentrySession({\n          userId: input.userId,\n          orgId: input.orgId,\n        }),\n      };\n  },\n  \"desktopSentryClearSession\": async (event, ...args) => {\n      return { enabled: clearOpenworkSentrySession() };\n  },\n  \"desktopIntegrationStatus\": async (event, ...args) => {\n      return linuxDesktopIntegration.getStatus();\n  },\n  \"desktopIntegrationInstall\": async (event, ...args) => {\n      if (BLANK_SLATE_LAUNCH.enabled) throw new Error(\"Desktop integration is disabled for test profiles.\");\n      return linuxDesktopIntegration.install(args[0] ?? {});\n  },\n  \"desktopIntegrationRemove\": async (event, ...args) => {\n      if (BLANK_SLATE_LAUNCH.enabled) throw new Error(\"Desktop integration is disabled for test profiles.\");\n      return linuxDesktopIntegration.remove();\n  },\n  \"getUiControlBridgeInfo\": async (event, ...args) => {\n      try {\n        const raw = await readFile(path.join(app.getPath(\"userData\"), \"openwork-ui-control.json\"), \"utf8\");\n        return JSON.parse(raw);\n      } catch {\n        return null;\n      }\n  },\n  \"getOpenworkUiMcpCommand\": async (event, ...args) => {\n      if (process.env.OPENWORK_DEV_MODE === \"1\") {\n        return [\"node\", path.resolve(__dirname, \"../../..\", \"packages/openwork-ui-mcp/index.mjs\")];\n      }","sourceCodeStart":1844,"sourceCodeEnd":1880,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/desktop/electron/main.mjs#L1844-L1880","documentation":"The desktopIntegrationInstall IPC handler refuses to install OS-level desktop integration (app shortcuts/registrations via linuxDesktopIntegration) when the app was launched in BLANK_SLATE mode — an isolated test/development profile (fresh home/userData) used for deterministic testing. Installing shortcuts from a throwaway profile would pollute the real desktop, so it is hard-disabled.","triggerScenarios":"Calling the desktopIntegrationInstall IPC (or UI button backed by it) while the app runs with BLANK_SLATE_LAUNCH.enabled — e.g. launched via eval/test harness flags like OPENWORK_EVAL blank-slate profile env variables.","commonSituations":"Running automated desktop tests/E2E with a blank-slate profile and clicking the desktop-integration install control; a settings screen exercising all IPC handlers regardless of profile.","solutions":["Relaunch the app normally (without the blank-slate/test-profile flags) before installing desktop integration.","Hide or disable the desktop-integration install UI when a test profile is active.","Skip the integration step in test/E2E flows and assert status only via desktopIntegrationStatus.","If you control the harness, disable BLANK_SLATE_LAUNCH for manual validation runs that need real shortcuts."],"exampleFix":"// before: installing regardless of profile\nawait window.api.desktopIntegrationInstall({});\n// after: gate on profile\nif (!isBlankSlateProfile()) {\n  await window.api.desktopIntegrationInstall({});\n}","handlingStrategy":"try-catch","validationCode":"// detect blank-slate/test launch before attempting install\nconst isTestProfile = process.env.OPENWORK_EVAL_FATAL_DESKTOP_BOOTSTRAP_FAILURE !== undefined ||\n  process.env.OPENWORK_BLANK_SLATE === '1';","typeGuard":null,"tryCatchPattern":"try {\n  await window.api.desktopIntegrationInstall({});\n} catch (err) {\n  if (err.message.includes('disabled for test profiles')) {\n    // expected under blank-slate/test launch — skip, do not retry\n    return { skipped: true };\n  }\n  throw err;\n}","preventionTips":["Hide desktop-integration controls when a test/blank-slate profile is active.","In E2E specs, assert desktopIntegrationStatus instead of calling install/remove.","Document that OS-integration features require a normal user profile launch."],"tags":["electron","test-profile","ipc","disabled-feature"],"backgroundTag":"feature-disabled-in-test-environment","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}