{"record":{"id":"e5a3020dce4b4104","repo":"jackwener/OpenCLI","slug":"gmail-operation-capture-included-a-response-wit","errorCode":null,"errorMessage":"Gmail ${operation} capture included a response without a body; refusing possibly partial results","messagePattern":"Gmail (.+?) capture included a response without a body; refusing possibly partial results","errorType":"error_code","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/gmail/utils.js","lineNumber":337,"sourceCode":"    const matches = endpointEntries.filter((entry) => (\n      typeof entry?.responsePreview === 'string' || entry?.responseBodyTruncated === true\n    ));\n    if (matches.length > 0) {\n      await page.sleep(1);\n      const settled = await page.readNetworkCapture();\n      const settledEndpointEntries = (Array.isArray(settled) ? settled : [])\n        .filter((entry) => String(entry?.url || '').includes(`/i/${endpoint}`));\n      if (settledEndpointEntries.some((entry) => (\n        typeof entry?.responsePreview !== 'string'\n        && entry?.responseBodyTruncated !== true\n      ))) {\n        bodylessCaptureObserved = true;\n      }\n      matches.push(...settledEndpointEntries.filter((entry) => (\n        typeof entry?.responsePreview === 'string' || entry?.responseBodyTruncated === true\n      )));\n      if (bodylessCaptureObserved) {\n        throw new CommandExecutionError(\n          `Gmail ${operation} capture included a response without a body; refusing possibly partial results`,\n        );\n      }\n      return matches.map((entry) => parseJsonCapture(entry, operation));\n    }\n    await page.sleep(0.25);\n  }\n  if (bodylessCaptureObserved) {\n    throw new CommandExecutionError(\n      `Gmail ${operation} capture lost a response body; refusing possibly partial results`,\n    );\n  }\n  throw new TimeoutError(`Gmail ${operation} capture`, timeoutSeconds, `No /${endpoint} response was observed after the Gmail action.`);\n}\n\nasync function renderedLabels(page, account) {\n  await page.goto(`${GMAIL_ORIGIN}/mail/u/${account}/#settings/labels`);\n  await page.sleep(2);","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/gmail/utils.js#L319-L355","documentation":"waitGmailCaptures throws this CommandExecutionError as soon as any captured /sync response arrives without a body (bodylessCaptureObserved). Rather than returning possibly partial Gmail results, the library fails fast. A bodyless entry means the response was captured but its content could not be read (e.g. truncated, redirected, or cleared before read).","triggerScenarios":"During queryThreads/fetchThread (via bodies), a settled /sync/i/{endpoint} capture entry has neither a string responsePreview nor responseBodyTruncated === true, i.e. a response arrived but carried no readable body.","commonSituations":"Gmail aborted/redirected a sync request mid-flight; response streaming not captured by the driver version; heavy page activity causing response buffers to be evicted; service-worker-served responses the capture hook cannot read.","solutions":["Retry the command; transient aborted responses usually succeed on a second attempt","Update the browser automation driver so response bodies are captured reliably","Reduce concurrent Gmail page activity that can abort in-flight sync requests","If it persists, reload Gmail and re-run, checking for extensions/service workers interfering with /sync responses"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const threads = await queryThreads(page, 'in:unread');\n} catch (e) {\n  if (/response without a body/.test(e.message)) {\n    // transient aborted sync response — retry once after a pause\n    await page.sleep(2);\n    return queryThreads(page, 'in:unread');\n  }\n  throw e;\n}","preventionTips":["Minimize concurrent Gmail page activity that can abort in-flight /sync requests","Keep the automation driver current so response bodies are captured reliably","Disable extensions/service workers that interfere with Gmail responses","Retry rather than assuming results are complete when this fires"],"tags":["network-capture","gmail","partial-data","browser-automation"],"backgroundTag":"empty-response-body","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}