jackwener/OpenCLI · error · ArgumentError

openreview reviews max-length must be an integer >= 200

Error message

openreview reviews max-length must be an integer >= 200

What it means

The openreview reviews command truncates review text to --max-length characters, which must be an integer of at least 200 to keep output meaningful. If the user passes a non-integer or a value below 200, coerceInt fails or the bound check fails and ArgumentError is thrown before any API call.

Source

Thrown at clis/openreview/reviews.js:102

cli({
    site: 'openreview',
    name: 'reviews',
    access: 'read',
    description: 'Show full review thread (paper + reviews + decisions) for an OpenReview forum',
    domain: 'openreview.net',
    strategy: Strategy.PUBLIC,
    browser: false,
    args: [
        { name: 'forum', positional: true, required: true, help: 'OpenReview forum id (same as paper id)' },
        { name: 'max-length', type: 'int', default: 4000, help: 'Per-row text truncation (min 200)' },
    ],
    columns: ['type', 'author', 'rating', 'confidence', 'text'],
    func: async (args) => {
        const forum = requireForumId(args.forum, 'forum');
        const rawMax = args['max-length'] ?? args.maxLength ?? 4000;
        const maxLength = coerceInt(rawMax);
        if (!Number.isInteger(maxLength) || maxLength < 200) {
            throw new ArgumentError('openreview reviews max-length must be an integer >= 200');
        }
        const rootJson = await openreviewFetch(`/notes?id=${encodeURIComponent(forum)}`, `openreview paper ${forum}`);
        const rootNotes = Array.isArray(rootJson?.notes) ? rootJson.notes : [];
        const root = rootNotes[0];
        if (!root) {
            throw new EmptyResultError('openreview', `No forum found with id "${forum}". Confirm the forum id from openreview.net.`);
        }
        const repliesJson = await openreviewFetch(`/notes?forum=${encodeURIComponent(forum)}&details=replies&limit=1000`, `openreview reviews ${forum}`);
        const replies = Array.isArray(repliesJson?.notes) ? repliesJson.notes.filter(note => note?.id !== forum) : [];
        // Sort by cdate (creation time) so ordering is deterministic regardless of API order.
        const sorted = [...replies].sort((a, b) => (a?.cdate ?? 0) - (b?.cdate ?? 0));
        const ordered = [root, ...sorted];
        return ordered.map((note) => {
            const isRoot = note?.id === forum;
            const type = classifyNote(note, isRoot);
            const author = authorFromSignatures(note?.signatures);
            const rating = readContent(note?.content, 'rating');
            const confidence = readContent(note?.content, 'confidence');

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Pass an integer >= 200, e.g. --max-length 4000
  2. Omit the flag entirely to use the default of 4000
  3. Check for typos or stray characters in the flag value
  4. Quote the value in the shell if it contains characters that might be mangled

Example fix

// before
openreview reviews --forum abc... --max-length 100
// after
openreview reviews --forum abc... --max-length 2000
Defensive patterns

Strategy: validation

Validate before calling

const maxLength = coerceInt(rawMaxLength);
if (!Number.isInteger(maxLength) || maxLength < 200) {
    throw new Error('--max-length must be an integer >= 200');
}

Prevention

When it happens

Trigger: args['max-length'] (or args.maxLength) coerces to a non-integer (e.g. 'abc', 12.5) or an integer < 200 (e.g. 100) when running the reviews command.

Common situations: Passing --max-length 0 expecting unlimited output; typo like --max-length=1O0 (letter O); shell flag parsing yielding a string that coerceInt rejects; copying a default of 4000 but truncating to 40 or 4.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/f6603bca360797eb. Report an issue: GitHub.