stablyai/orca · error · RuntimeClientError
linear_body_too_large
linear_body_too_large
Error message
Linear body must be at most ${LINEAR_WRITE_BODY_CAP} characters What it means
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.
Source
Thrown at src/cli/linear-request-builders.ts:255
cwd: string,
options: { required: boolean }
): Promise<string | undefined> {
const hasBody = flags.has('body')
const hasBodyFile = flags.has('body-file')
if (hasBody && hasBodyFile) {
throw new RuntimeClientError('invalid_argument', 'Use either --body or --body-file, not both')
}
if (!hasBody && !hasBodyFile) {
if (options.required) {
throw new RuntimeClientError('invalid_argument', 'Missing --body or --body-file')
}
return undefined
}
const body = hasBody
? getRequiredStringFlagAllowingEmpty(flags, 'body')
: await readLinearBodyFile(getRequiredStringFlag(flags, 'body-file'), cwd)
if (body.length > LINEAR_WRITE_BODY_CAP) {
throw new RuntimeClientError(
'linear_body_too_large',
`Linear body must be at most ${LINEAR_WRITE_BODY_CAP} characters`
)
}
return body
}
async function readLinearBodyFile(path: string, cwd: string): Promise<string> {
if (path !== '-') {
return await readFile(isAbsolute(path) ? path : join(cwd, path), 'utf8')
}
if (process.stdin.isTTY) {
throw new RuntimeClientError('invalid_argument', 'stdin body requested but stdin is a TTY')
}
const chunks: Buffer[] = []
for await (const chunk of process.stdin) {
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)))
}View on GitHub (pinned to 1136503c6a)
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`.
Example fix
// before linear comment LIN-123 --body-file ./huge-report.md // after linear comment LIN-123 --body "See attached report" # and attach the file separately
Defensive patterns
Strategy: validation
Validate before calling
const LINEAR_WRITE_BODY_CAP = 65_000
if (body.length > LINEAR_WRITE_BODY_CAP) {
throw new Error(`Body ${body.length} chars exceeds cap ${LINEAR_WRITE_BODY_CAP}`)
} Type guard
function withinLinearBodyCap(body: string, cap = 65_000): boolean {
return body.length <= cap
} Prevention
- Truncate or summarize large content before sending it as a Linear body.
- Use attachments or linked documents for oversized reports.
When it happens
Trigger: Passing a long `--body` string, a large `--body-file`, or piping a big document via `--body-file -` such that the final body.length > 65000.
Common situations: 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.
Related errors
- linear_invalid_url
- --higher-is-better requires a metric key
- Usage: node config/scripts/compare-benchmark-artifacts.mjs -
- Missing value for ${arg}
- Unknown argument: ${arg}
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/023acb740989ba03.
Report an issue: GitHub.