{"record":{"id":"b32e5b3f12823e82","repo":"koala73/worldmonitor","slug":"dashboard-search-result-exceeded-the-safe-output-l","errorCode":null,"errorMessage":"Dashboard search result exceeded the safe output limit.","messagePattern":"Dashboard search result exceeded the safe output limit\\.","errorType":"exception","errorClass":"SafeWebMcpError","httpStatus":null,"severity":"error","filePath":"src/services/webmcp.ts","lineNumber":1156,"sourceCode":"  let truncated = result.truncated === true || results.length < sourceResults.length;\n  const bounded: DashboardSearchResponse = {\n    queryLength: Math.max(0, Math.floor(boundedNumber(result.queryLength))),\n    results,\n    resultCount: results.length,\n    truncated,\n  };\n\n  while (\n    JSON.stringify(bounded).length > DASHBOARD_SEARCH_OUTPUT_TARGET_CHARS\n    && results.length > 0\n  ) {\n    results.pop();\n    truncated = true;\n    bounded.resultCount = results.length;\n    bounded.truncated = truncated;\n  }\n  if (JSON.stringify(bounded).length > MAX_OUTPUT_CHARS) {\n    throw new SafeWebMcpError('Dashboard search result exceeded the safe output limit.');\n  }\n  return bounded;\n}\n\nfunction boundOpenSignInResult(result: OpenSignInResult): OpenSignInResult {\n  if (result?.ok === true && result.status === 'already_open') {\n    return { ok: true, status: 'already_open', reason: 'already_open' };\n  }\n  if (result?.ok === true && result.status === 'opened') {\n    return { ok: true, status: 'opened' };\n  }\n  return { ok: false, status: 'denied', reason: 'clerk_unavailable' };\n}\n\nfunction boundSearchOpenResult(result: DashboardSearchOpenResult): DashboardSearchOpenResult {\n  const opened = result.ok === true && result.status === 'opened';\n  const reason = result.reason && DASHBOARD_SEARCH_OPEN_REASONS.has(result.reason)\n    ? result.reason","sourceCodeStart":1138,"sourceCodeEnd":1174,"githubUrl":"https://github.com/koala73/worldmonitor/blob/9361220cc013571781071f0206e4d80fd14b2f7f/src/services/webmcp.ts#L1138-L1174","documentation":"SafeWebMcpError thrown by the dashboard search tool when, after iteratively popping results down to the output target, the bounded response still exceeds MAX_OUTPUT_CHARS. The graceful shrink loop failed to bring an (extremely large or pathological) result set under the hard cap, so the search refuses to return it.","triggerScenarios":"Thrown at src/services/webmcp.ts:493 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry with a smaller limit parameter or a narrower scope","Make the search result renderer trim per-entry text so shrink iterations converge faster","Investigate entries with abnormally long content that defeat truncation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9361220cc013571781071f0206e4d80fd14b2f7f","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}