{"record":{"id":"3b21f0527d011ac3","repo":"sipeed/picoclaw","slug":"session-scope-is-required","errorCode":null,"errorMessage":"Session scope is required.","messagePattern":"Session scope is required\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"web/frontend/src/components/config/config-page.tsx","lineNumber":320,"sourceCode":"          throw new Error(t(\"pages.config.dashboard_password_required\"))\n        }\n        if (password !== confirm) {\n          throw new Error(t(\"pages.config.dashboard_password_mismatch\"))\n        }\n        if (Array.from(password).length < 8) {\n          throw new Error(t(\"pages.config.dashboard_password_min_length\"))\n        }\n      }\n\n      if (configDirty) {\n        const workspace = form.workspace.trim()\n        const dmScope = form.dmScope.trim()\n\n        if (!workspace) {\n          throw new Error(\"Workspace path is required.\")\n        }\n        if (!dmScope) {\n          throw new Error(\"Session scope is required.\")\n        }\n\n        if (\n          form.mcpEnabled &&\n          form.mcpDiscoveryEnabled &&\n          !form.mcpDiscoveryUseBM25 &&\n          !form.mcpDiscoveryUseRegex\n        ) {\n          throw new Error(\n            \"MCP discovery requires at least one search method (BM25 or regex).\",\n          )\n        }\n\n        const maxTokens = parseIntField(form.maxTokens, \"Max tokens\", {\n          min: 1,\n        })\n        const contextWindow = form.contextWindow.trim()\n          ? parseIntField(form.contextWindow, \"Context window\", { min: 1 })","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/web/frontend/src/components/config/config-page.tsx#L302-L338","documentation":"Validation error thrown in handleSave (web/frontend/src/components/config/config-page.tsx:320) when the config section is dirty and the session scope (dmScope) trims to empty. dmScope is a required field of the config patch, so the save aborts client-side. It is checked immediately after the workspace check and behaves identically.","triggerScenarios":"Clearing the 'session scope' input (or entering only whitespace) and saving while configDirty is true.","commonSituations":"User empties the scope thinking it optional; scope value lost when switching config profiles; whitespace-only paste.","solutions":["Enter a session scope value (as required by your deployment, e.g. a project or session identifier)","Check the raw config page for the previously saved dm_scope value and restore it","Ensure the field contains non-whitespace text before saving"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const dmScope = form.dmScope.trim()\nif (configDirty && !dmScope) {\n  setFieldError(\"Session scope is required.\")\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await handleSave()\n} catch (err) {\n  if (err instanceof Error) setError(err.message)\n}","preventionTips":["Mark the session scope input as required","Pre-fill from loaded config; block clearing it in the UI","Document valid scope values near the field to prevent guess-and-clear behavior"],"tags":["validation","frontend","config","session-scope"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}