{"record":{"id":"1095054653bbdb2d","repo":"sipeed/picoclaw","slug":"mcp-discovery-requires-at-least-one-search-method","errorCode":null,"errorMessage":"MCP discovery requires at least one search method (BM25 or regex).","messagePattern":"MCP discovery requires at least one search method \\(BM25 or regex\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"web/frontend/src/components/config/config-page.tsx","lineNumber":329,"sourceCode":"\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 })\n          : undefined\n        const maxToolIterations = parseIntField(\n          form.maxToolIterations,\n          \"Max tool iterations\",\n          { min: 1 },\n        )\n        const toolFeedbackMaxArgsLength = parseIntField(\n          form.toolFeedbackMaxArgsLength,\n          \"Tool feedback max args length\",","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/web/frontend/src/components/config/config-page.tsx#L311-L347","documentation":"Validation error thrown in handleSave (web/frontend/src/components/config/config-page.tsx:329) when MCP is enabled, MCP discovery is enabled, but neither BM25 nor regex discovery is selected. Discovery needs at least one search backend to find MCP servers, so the combination is rejected client-side before the config PATCH is built.","triggerScenarios":"Checking both 'MCP enabled' and 'MCP discovery enabled' while unchecking 'Use BM25' and 'Use regex' in the MCP discovery section, then saving.","commonSituations":"User disables regex to avoid heavy scanning, then also unchecks BM25 not realizing it was the last method; toggling options after loading a config where both were already off; misreading BM25 as optional telemetry.","solutions":["Re-check at least one of 'BM25' or 'regex' in the MCP discovery options","If you do not want discovery at all, uncheck 'MCP discovery enabled' instead of unchecking both methods","If you do not want MCP at all, uncheck 'MCP enabled' and both sub-toggles become irrelevant"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (\n  form.mcpEnabled &&\n  form.mcpDiscoveryEnabled &&\n  !form.mcpDiscoveryUseBM25 &&\n  !form.mcpDiscoveryUseRegex\n) {\n  setFieldError(\"MCP discovery requires at least one search method (BM25 or regex).\")\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await handleSave()\n} catch (err) {\n  if (err instanceof Error) setError(err.message)\n}","preventionTips":["Use a checkbox group that prevents unchecking the last selected method","Auto-uncheck 'discovery enabled' when both methods are off, making the state unreachable","Show a hint under the discovery section listing which methods are active"],"tags":["validation","frontend","mcp","discovery","config"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}