{"record":{"id":"97971cad1c4ffcc3","repo":"different-ai/openwork","slug":"openwork-server-cannot-remove-skills-for-this-work","errorCode":null,"errorMessage":"OpenWork server cannot remove skills for this workspace.","messagePattern":"OpenWork server cannot remove skills for this workspace\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/settings/state/extensions-store.ts","lineNumber":696,"sourceCode":"  };\n\n  const deleteWorkspaceSkill = async (name: string) => {\n    const isRemoteWorkspace = options.workspaceType() === \"remote\";\n    const isLocalWorkspace = options.workspaceType() === \"local\";\n    const root = options.selectedWorkspaceRoot().trim();\n    const { openworkSnapshot, openworkClient, openworkWorkspaceId, hasOpenworkTarget } =\n      await resolveWorkspaceServerTarget();\n    const canUseOpenworkServer =\n      hasOpenworkTarget &&\n      openworkSnapshot.openworkServerCapabilities?.skills?.write !== false;\n\n    if (canUseOpenworkServer && openworkClient && openworkWorkspaceId) {\n      await openworkClient.deleteSkill(openworkWorkspaceId, name);\n      return;\n    }\n\n    if (hasOpenworkTarget) {\n      throw new Error(\"OpenWork server cannot remove skills for this workspace.\");\n    }\n\n    if (isRemoteWorkspace) {\n      throw new Error(\"OpenWork server unavailable. Connect to remove skills.\");\n    }\n\n    if (!isDesktopRuntime()) {\n      throw new Error(t(\"skills.desktop_required\"));\n    }\n\n    if (!isLocalWorkspace || !root) {\n      throw new Error(t(\"skills.pick_workspace_first\"));\n    }\n\n    const result = (await uninstallSkillCommand(root, name)) as { ok: boolean; stderr?: string; stdout?: string };\n    if (!result.ok) {\n      throw new Error(result.stderr || result.stdout || t(\"skills.uninstall_failed\"));\n    }","sourceCodeStart":678,"sourceCodeEnd":714,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/settings/state/extensions-store.ts#L678-L714","documentation":"When removing a skill, the store deletes it through the OpenWork server if the workspace has an OpenWork target (server enabled + client + workspace id available). If a target exists but this code path cannot use it (missing openworkClient/openworkWorkspaceId, or the target workspace isn't server-managed), it throws this error instead of attempting a local delete that would not actually remove a server-backed skill.","triggerScenarios":"Deleting a skill from a workspace whose config declares an OpenWork server target while openworkClient/openworkWorkspaceId are not resolvable, or when canUseOpenworkServer is false despite hasOpenworkTarget being true.","commonSituations":"Workspace config lists cloud imports/skills but the app never established the server session; workspace id changed on the server; stale client after sign-out; org-managed workspace where the local user cannot delete.","solutions":["Connect/sign in to the OpenWork server so openworkClient and openworkWorkspaceId resolve, then retry the delete.","Verify the workspace id is still valid on the server; re-sync workspace state.","If the skill is server-managed by policy, remove it via the Den/server admin surface instead.","Restart the app to rebuild the client/session if state appears stale."],"exampleFix":"// before\nif (hasOpenworkTarget) {\n  throw new Error(\"OpenWork server cannot remove skills for this workspace.\");\n}\n// after\nif (hasOpenworkTarget) {\n  const connected = await ensureServerConnected();\n  if (connected && openworkWorkspaceId) {\n    await openworkClient.deleteSkill(openworkWorkspaceId, name);\n    return;\n  }\n  throw new Error(\"OpenWork server cannot remove skills for this workspace.\");\n}","handlingStrategy":"validation","validationCode":"if (hasOpenworkTarget && !(canUseOpenworkServer && openworkClient && openworkWorkspaceId)) {\n  // reconnect/refresh server session before offering skill delete\n}","typeGuard":"function canDeleteOnServer(s: { openworkClient?: unknown; openworkWorkspaceId?: string }): s is { openworkClient: NonNullable<unknown>; openworkWorkspaceId: string } {\n  return s.openworkClient != null && typeof s.openworkWorkspaceId === \"string\" && s.openworkWorkspaceId.length > 0;\n}","tryCatchPattern":"try {\n  await removeSkill(name);\n} catch (err) {\n  if (err.message.includes(\"cannot remove skills\")) await reconnectServerAndRetry(() => removeSkill(name));\n  else throw err;\n}","preventionTips":["Refresh server session/workspace id whenever the workspace config changes","Hide skill-delete actions for server-managed workspaces the user cannot modify","Rebuild the openwork client after sign-out/sign-in instead of reusing a stale one"],"tags":["skills","server-connection","delete","workspace"],"backgroundTag":"server-unavailable","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}