{"record":{"id":"10b143ec101e6fda","repo":"Yeachan-Heo/oh-my-codex","slug":"tail-lines-requires-a-numeric-value-sparkshel","errorCode":null,"errorMessage":"--tail-lines requires a numeric value.\n${SPARKSHELL_USAGE}","messagePattern":"--tail-lines requires a numeric value\\.\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/sparkshell.ts","lineNumber":345,"sourceCode":"\n  for (let index = 0; index < args.length; index += 1) {\n    const token = args[index];\n    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    }","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/sparkshell.ts#L327-L363","documentation":"In tmux-pane mode, --tail-lines was given without a numeric value: it was the last token or the next token started with '-' (which includes negative numbers).","triggerScenarios":"`sparkshell --tmux-pane 0 --tail-lines` (trailing flag) or `--tail-lines --verbose` (next token is an option).","commonSituations":"Truncated command lines from scripts, flag ordering mistakes, attempting a negative value.","solutions":["Add an integer 100-1000 after --tail-lines: `--tail-lines 400`","Use the equals form: `--tail-lines=400`"],"exampleFix":"# before\nsparkshell --tmux-pane 0 --tail-lines\n# after\nsparkshell --tmux-pane 0 --tail-lines 400","handlingStrategy":"validation","validationCode":"const args = ['--tmux-pane', paneId];\nif (tailLines !== undefined) {\n  if (!Number.isInteger(tailLines) || tailLines < 100 || tailLines > 1000) throw new RangeError('tailLines must be 100-1000');\n  args.push('--tail-lines', String(tailLines));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the integer range before building the command","Omit --tail-lines to accept the 200 default"],"tags":["cli","tmux","argument-validation"],"backgroundTag":"missing-cli-argument","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}