paperclipai/paperclip · error · Error
Invalid integer value: ${value}
Error message
Invalid integer value: ${value} What it means
parseOptionalInt (issue.ts) parses a CLI string option as base-10 integer and throws if the result is not finite. Used for numeric flags like --limit on issue commands.
Source
Thrown at cli/src/commands/client/issue.ts:1364
? await ctx.api.post(`${apiPath`/api/issues/${issueId}`}${pathSuffix}`, {})
: await ctx.api.delete(`${apiPath`/api/issues/${issueId}`}${pathSuffix}`);
printOutput(result, { json: ctx.json });
} catch (err) {
handleCommandError(err);
}
}),
);
}
function parseJson(value: string): unknown {
return JSON.parse(value) as unknown;
}
function parseOptionalInt(value: string | undefined): number | undefined {
if (value === undefined) return undefined;
const parsed = Number.parseInt(value, 10);
if (!Number.isFinite(parsed)) {
throw new Error(`Invalid integer value: ${value}`);
}
return parsed;
}
function parseHiddenAt(value: string | undefined): string | null | undefined {
if (value === undefined) return undefined;
if (value.trim().toLowerCase() === "null") return null;
return value;
}
function filterIssueRows(rows: Issue[], match: string | undefined): Issue[] {
if (!match?.trim()) return rows;
const needle = match.trim().toLowerCase();
return rows.filter((row) => {
const text = [row.identifier, row.title, row.description]
.filter((part): part is string => Boolean(part))
.join("\n")
.toLowerCase();View on GitHub (pinned to 67001ec6eb)
Solutions
- Pass a plain integer: `--limit 50`.
- Omit the flag to use the default.
- Sanitize env-derived values before passing them.
Example fix
// before paperclipai issue list --limit abc // after paperclipai issue list --limit 50
Defensive patterns
Strategy: validation
Validate before calling
function parseOptionalInt(value?: string) {
if (value === undefined) return undefined;
const parsed = Number.parseInt(value, 10);
if (!Number.isFinite(parsed)) throw new Error(`Invalid integer value: ${value}`);
return parsed;
} Type guard
const isIntString = (v: string) => /^-?\d+$/.test(v.trim());
Prevention
- Use a CLI parser that casts integer flags before they reach the action.
- Validate env-derived values before passing as --limit.
When it happens
Trigger: Passing a non-numeric value to an integer issue flag, e.g. `--limit abc` or `--limit 1.5`.
Common situations: Typo; passing a float where an int is expected; env-derived value with trailing whitespace/newline.
Related errors
- Invalid integer value: ${value}
- Profile name is required
- Invalid --persona value. Use board or agent.
- Unsupported export format: ${value}
- Refusing to delete without --yes
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/c935cda071ba1185.
Report an issue: GitHub.