{"record":{"id":"023acb740989ba03","repo":"stablyai/orca","slug":"linear-body-too-large","errorCode":"linear_body_too_large","errorMessage":"Linear body must be at most ${LINEAR_WRITE_BODY_CAP} characters","messagePattern":"Linear body must be at most (.+?) characters","errorType":"validation","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/linear-request-builders.ts","lineNumber":255,"sourceCode":"  cwd: string,\n  options: { required: boolean }\n): Promise<string | undefined> {\n  const hasBody = flags.has('body')\n  const hasBodyFile = flags.has('body-file')\n  if (hasBody && hasBodyFile) {\n    throw new RuntimeClientError('invalid_argument', 'Use either --body or --body-file, not both')\n  }\n  if (!hasBody && !hasBodyFile) {\n    if (options.required) {\n      throw new RuntimeClientError('invalid_argument', 'Missing --body or --body-file')\n    }\n    return undefined\n  }\n  const body = hasBody\n    ? getRequiredStringFlagAllowingEmpty(flags, 'body')\n    : await readLinearBodyFile(getRequiredStringFlag(flags, 'body-file'), cwd)\n  if (body.length > LINEAR_WRITE_BODY_CAP) {\n    throw new RuntimeClientError(\n      'linear_body_too_large',\n      `Linear body must be at most ${LINEAR_WRITE_BODY_CAP} characters`\n    )\n  }\n  return body\n}\n\nasync function readLinearBodyFile(path: string, cwd: string): Promise<string> {\n  if (path !== '-') {\n    return await readFile(isAbsolute(path) ? path : join(cwd, path), 'utf8')\n  }\n  if (process.stdin.isTTY) {\n    throw new RuntimeClientError('invalid_argument', 'stdin body requested but stdin is a TTY')\n  }\n  const chunks: Buffer[] = []\n  for await (const chunk of process.stdin) {\n    chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)))\n  }","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/linear-request-builders.ts#L237-L273","documentation":"Thrown by readLinearBody when the resolved body content (inline or from file/stdin) exceeds LINEAR_WRITE_BODY_CAP (65000 characters). Linear's API enforces a body length limit; this guard rejects oversize content client-side with a clear message and the stable `linear_body_too_large` code rather than letting the API return an opaque rejection.","triggerScenarios":"Passing a long `--body` string, a large `--body-file`, or piping a big document via `--body-file -` such that the final body.length > 65000.","commonSituations":"Attaching a full README, log dump, or generated report as a Linear comment/description. Concatenating multiple files into one body. Piping unbounded command output into the CLI.","solutions":["Trim or summarize the content to under 65,000 characters before sending.","Move large content into an attachment or linked document and reference it in the body.","If reading from a file, preprocess it: `head -c 65000 ./big.md > ./truncated.md` then `--body-file ./truncated.md`."],"exampleFix":"// before\nlinear comment LIN-123 --body-file ./huge-report.md\n// after\nlinear comment LIN-123 --body \"See attached report\"  # and attach the file separately","handlingStrategy":"validation","validationCode":"const LINEAR_WRITE_BODY_CAP = 65_000\nif (body.length > LINEAR_WRITE_BODY_CAP) {\n  throw new Error(`Body ${body.length} chars exceeds cap ${LINEAR_WRITE_BODY_CAP}`)\n}","typeGuard":"function withinLinearBodyCap(body: string, cap = 65_000): boolean {\n  return body.length <= cap\n}","tryCatchPattern":null,"preventionTips":["Truncate or summarize large content before sending it as a Linear body.","Use attachments or linked documents for oversized reports."],"tags":["linear","cli","validation","size-limit","body"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}