{"record":{"id":"66b07241f63706c4","repo":"different-ai/openwork","slug":"select-a-local-workspace-before-starting-the-local","errorCode":null,"errorMessage":"Select a local workspace before starting the local server/engine.","messagePattern":"Select a local workspace before starting the local server/engine\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/settings/state/debug-view-model.ts","lineNumber":711,"sourceCode":"      const target = await pickFile({ title: t(\"settings.custom_binary_label\"), multiple: false });\n      if (typeof target === \"string\" && target.trim()) {\n        setEngineCustomBinPath(target);\n        writeStoredString(ENGINE_CUSTOM_BIN_KEY, target);\n      }\n    } catch (error) {\n      setServiceRestartError(error instanceof Error ? error.message : safeStringify(error));\n    }\n  }, []);\n\n  const onClearEngineCustomBinPath = useCallback(() => {\n    setEngineCustomBinPath(\"\");\n    clearStoredString(ENGINE_CUSTOM_BIN_KEY);\n  }, []);\n\n  const bootFullEngineStack = useCallback(async () => {\n    const workspacePath = optionsRef.current.selectedWorkspaceRoot.trim();\n    if (!workspacePath) {\n      throw new Error(\n        \"Select a local workspace before starting the local server/engine.\",\n      );\n    }\n\n    // Collect ALL local workspace paths so openwork-server is started with\n    // --workspace <path> for every registered local workspace. Mirrors the\n    // Solid reference (context/workspace.ts::resolveWorkspacePaths) so that\n    // `client.listWorkspaces()` later returns the full set, not just the\n    // active one.\n    const workspacePaths = [workspacePath];\n    const workspacePathSet = new Set(workspacePaths);\n    try {\n      const list = (await workspaceBootstrapCmd()) as { workspaces?: Array<{ workspaceType?: string; path?: string }> } | null;\n      for (const entry of list?.workspaces ?? []) {\n        if (entry.workspaceType === \"remote\") continue;\n        const path = entry.path?.trim() ?? \"\";\n        if (path && !workspacePathSet.has(path)) {\n          workspacePaths.push(path);","sourceCodeStart":693,"sourceCodeEnd":729,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/settings/state/debug-view-model.ts#L693-L729","documentation":"bootFullEngineStack in useDebugViewModel refuses to start the local openwork-server/engine when the settings debug view has no local workspace selected. The server must be launched with --workspace <path>, so booting without a workspace would produce a useless or broken engine stack; the view model therefore throws this guard error before spawning anything.","triggerScenarios":"Clicking the debug 'boot full engine stack' action while optionsRef.current.selectedWorkspaceRoot is an empty string (no workspace registered/selected in the debug panel).","commonSituations":"Fresh install or cleared settings where no workspace was ever selected; user cleared the workspace field; running the desktop app in a state where workspace selection was not persisted; opening the debug view before picking a folder.","solutions":["Select a local workspace folder in the settings/debug view before booting the engine stack.","If a workspace should already be selected, check that the selection persisted (stored workspace root key) and re-pick it.","Restart the app after selecting the workspace if the view model still reads an empty root."],"exampleFix":"// before\nconst workspacePath = optionsRef.current.selectedWorkspaceRoot.trim();\nif (!workspacePath) {\n  throw new Error(\"Select a local workspace before starting the local server/engine.\");\n}\n// after\nconst workspacePath = optionsRef.current.selectedWorkspaceRoot.trim();\nif (!workspacePath) {\n  setSelectedWorkspaceRoot(await promptForWorkspaceFolder()); // pick one up front\n  return bootFullEngineStack();\n}","handlingStrategy":"validation","validationCode":"const workspacePath = optionsRef.current.selectedWorkspaceRoot.trim();\nif (!workspacePath) {\n  alert(\"Select a local workspace first.\");\n  return; // don't call bootFullEngineStack\n}","typeGuard":null,"tryCatchPattern":"try {\n  await bootFullEngineStack();\n} catch (err) {\n  if (err.message.includes(\"Select a local workspace\")) openWorkspacePicker();\n  else showBootError(err);\n}","preventionTips":["Disable the boot button until a workspace root is selected","Persist the last selected workspace and restore it on app start","Show inline validation on the workspace field before allowing engine actions"],"tags":["validation","settings","local-server","workspace"],"backgroundTag":"missing-required-setting","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}