{"record":{"id":"362fa7c64c2ee6f4","repo":"Yeachan-Heo/oh-my-codex","slug":"tail-lines-must-be-an-integer-between-100-and-10","errorCode":null,"errorMessage":"--tail-lines must be an integer between 100 and 1000.\n${SPARKSHELL_USAGE}","messagePattern":"--tail-lines must be an integer between 100 and 1000\\.\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/sparkshell.ts","lineNumber":348,"sourceCode":"    if (token === '--tmux-pane') {\n      const next = args[index + 1];\n      if (!next || next.startsWith('-')) throw new Error(`--tmux-pane requires a pane id.\\n${SPARKSHELL_USAGE}`);\n      paneId = next;\n      index += 1;\n      continue;\n    }\n    if (token.startsWith('--tmux-pane=')) {\n      const value = token.slice('--tmux-pane='.length).trim();\n      if (!value) throw new Error(`--tmux-pane requires a pane id.\\n${SPARKSHELL_USAGE}`);\n      paneId = value;\n      continue;\n    }\n    if (token === '--tail-lines') {\n      const next = args[index + 1];\n      if (!next || next.startsWith('-')) throw new Error(`--tail-lines requires a numeric value.\\n${SPARKSHELL_USAGE}`);\n      const parsed = Number.parseInt(next, 10);\n      if (!Number.isFinite(parsed) || parsed < 100 || parsed > 1000) {\n        throw new Error(`--tail-lines must be an integer between 100 and 1000.\\n${SPARKSHELL_USAGE}`);\n      }\n      tailLines = parsed;\n      sawTailLines = true;\n      index += 1;\n      continue;\n    }\n    if (token.startsWith('--tail-lines=')) {\n      const parsed = Number.parseInt(token.slice('--tail-lines='.length), 10);\n      if (!Number.isFinite(parsed) || parsed < 100 || parsed > 1000) {\n        throw new Error(`--tail-lines must be an integer between 100 and 1000.\\n${SPARKSHELL_USAGE}`);\n      }\n      tailLines = parsed;\n      sawTailLines = true;\n      continue;\n    }\n    throw new Error(`tmux pane mode does not accept an additional command.\\n${SPARKSHELL_USAGE}`);\n  }\n","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/sparkshell.ts#L330-L366","documentation":"The value given to --tail-lines (space-separated form) failed range validation: parseInt did not yield a finite integer or the integer is outside the 100-1000 window enforced by the CLI.","triggerScenarios":"`sparkshell --tmux-pane 0 --tail-lines 50`, `--tail-lines 5000`, or `--tail-lines 12.5` (parseInt truncates but then range checks apply).","commonSituations":"Users assuming any positive number is accepted; copying a large tail size from another tool's config; defaults drift after the allowed range changed.","solutions":["Pick an integer within 100-1000, e.g. `--tail-lines 200`","Omit the flag entirely to accept the default of 200 lines"],"exampleFix":"# before\nsparkshell --tmux-pane 0 --tail-lines 50\n# after\nsparkshell --tmux-pane 0 --tail-lines 200","handlingStrategy":"validation","validationCode":"function toTailLines(v: string): number {\n  const n = Number.parseInt(v, 10);\n  if (!Number.isInteger(n) || n < 100 || n > 1000) throw new RangeError(`--tail-lines must be 100-1000, got ${v}`);\n  return n;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp UI/script inputs to 100-1000 before passing","Remember the default is 200 — usually you can omit the flag"],"tags":["cli","tmux","range-validation"],"backgroundTag":"value-out-of-range","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}