{"record":{"id":"226425b8e18a2cf7","repo":"can1357/oh-my-pi","slug":"repaint-must-be-a-positive-integer","errorCode":null,"errorMessage":"--repaint must be a positive integer","messagePattern":"--repaint must be a positive integer","errorType":"validation","errorClass":"CliUsageError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/commands/render.ts","lineNumber":37,"sourceCode":"\t\ttiming: Flags.boolean({ char: \"t\", description: \"Print phase timings and emitted byte counts to stderr\" }),\n\t\trepaint: Flags.integer({\n\t\t\tdescription: \"Benchmark N extra full clear-scrollback repaints (the /tree navigation frame)\",\n\t\t}),\n\t\tplain: Flags.boolean({ description: \"Strip ANSI styling from the output\", default: false }),\n\t\tquiet: Flags.boolean({ char: \"q\", description: \"Suppress transcript output (benchmark runs)\", default: false }),\n\t};\n\n\tstatic examples = [\n\t\t\"omp render\",\n\t\t\"omp render 01a0285c --plain\",\n\t\t\"omp render ~/.omp/agent/sessions/--work-pi--/big.jsonl -q -t --repaint 5\",\n\t\t\"omp render -w 200 > thread.ansi\",\n\t];\n\n\tasync run(): Promise<void> {\n\t\tconst { args, flags } = await this.parse(Render);\n\t\tif (flags.repaint !== undefined && flags.repaint <= 0) {\n\t\t\tthrow new CliUsageError(\"--repaint must be a positive integer\");\n\t\t}\n\t\tconst exitCode = await runRenderCommand({\n\t\t\tsession: args.session,\n\t\t\twidth: flags.width,\n\t\t\theight: flags.height,\n\t\t\ttiming: flags.timing,\n\t\t\trepaint: flags.repaint,\n\t\t\tplain: flags.plain,\n\t\t\tquiet: flags.quiet,\n\t\t});\n\t\tawait postmortem.quit(exitCode);\n\t}\n}\n","sourceCodeStart":19,"sourceCodeEnd":51,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/commands/render.ts#L19-L51","documentation":"The --repaint flag on omp render takes a positive integer count of repaint passes. The check is conditional (only when the flag is provided) and rejects zero or negative values with a CliUsageError before rendering begins.","triggerScenarios":"'omp render session.json --repaint 0' or '--repaint -1'; --repaint read from a config/variable that is 0.","commonSituations":"Trying to 'disable' repaint by passing 0 (instead of omitting the flag); computed values defaulting to 0 in render pipelines.","solutions":["Pass a positive integer, e.g. --repaint 2","Omit --repaint entirely if you do not need extra repaint passes","Clamp computed values: Math.max(1, n)"],"exampleFix":"// before\nomp render thread.json --repaint 0\n// after\nomp render thread.json   # omit flag, or --repaint 1","handlingStrategy":"validation","validationCode":"if (rawRepaint !== undefined) {\n  const n = Number(rawRepaint);\n  if (!Number.isInteger(n) || n <= 0) throw new Error(`--repaint must be a positive integer, got: ${rawRepaint}`);\n}","typeGuard":"function isValidRepaint(v) { return v === undefined || (Number.isInteger(v) && v > 0); }","tryCatchPattern":"try {\n  await Render.run(['--repaint', String(repaint)]);\n} catch (err) {\n  if (err instanceof CliUsageError && err.message.includes('--repaint')) {\n    console.error('Omit --repaint or pass an integer >= 1.');\n    process.exitCode = 1;\n  } else throw err;\n}","preventionTips":["Omit the flag instead of passing 0 to disable repaint","Clamp computed counts: Math.max(1, n)","Validate flag values in render pipelines before invoking"],"tags":["cli","usage","validation"],"backgroundTag":"invalid-cli-flag-value","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}