{"record":{"id":"f6603bca360797eb","repo":"jackwener/OpenCLI","slug":"openreview-reviews-max-length-must-be-an-integer","errorCode":null,"errorMessage":"openreview reviews max-length must be an integer >= 200","messagePattern":"openreview reviews max-length must be an integer >= 200","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/openreview/reviews.js","lineNumber":102,"sourceCode":"cli({\n    site: 'openreview',\n    name: 'reviews',\n    access: 'read',\n    description: 'Show full review thread (paper + reviews + decisions) for an OpenReview forum',\n    domain: 'openreview.net',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'forum', positional: true, required: true, help: 'OpenReview forum id (same as paper id)' },\n        { name: 'max-length', type: 'int', default: 4000, help: 'Per-row text truncation (min 200)' },\n    ],\n    columns: ['type', 'author', 'rating', 'confidence', 'text'],\n    func: async (args) => {\n        const forum = requireForumId(args.forum, 'forum');\n        const rawMax = args['max-length'] ?? args.maxLength ?? 4000;\n        const maxLength = coerceInt(rawMax);\n        if (!Number.isInteger(maxLength) || maxLength < 200) {\n            throw new ArgumentError('openreview reviews max-length must be an integer >= 200');\n        }\n        const rootJson = await openreviewFetch(`/notes?id=${encodeURIComponent(forum)}`, `openreview paper ${forum}`);\n        const rootNotes = Array.isArray(rootJson?.notes) ? rootJson.notes : [];\n        const root = rootNotes[0];\n        if (!root) {\n            throw new EmptyResultError('openreview', `No forum found with id \"${forum}\". Confirm the forum id from openreview.net.`);\n        }\n        const repliesJson = await openreviewFetch(`/notes?forum=${encodeURIComponent(forum)}&details=replies&limit=1000`, `openreview reviews ${forum}`);\n        const replies = Array.isArray(repliesJson?.notes) ? repliesJson.notes.filter(note => note?.id !== forum) : [];\n        // Sort by cdate (creation time) so ordering is deterministic regardless of API order.\n        const sorted = [...replies].sort((a, b) => (a?.cdate ?? 0) - (b?.cdate ?? 0));\n        const ordered = [root, ...sorted];\n        return ordered.map((note) => {\n            const isRoot = note?.id === forum;\n            const type = classifyNote(note, isRoot);\n            const author = authorFromSignatures(note?.signatures);\n            const rating = readContent(note?.content, 'rating');\n            const confidence = readContent(note?.content, 'confidence');","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/openreview/reviews.js#L84-L120","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass an integer >= 200, e.g. --max-length 4000","Omit the flag entirely to use the default of 4000","Check for typos or stray characters in the flag value","Quote the value in the shell if it contains characters that might be mangled"],"exampleFix":"// before\nopenreview reviews --forum abc... --max-length 100\n// after\nopenreview reviews --forum abc... --max-length 2000","handlingStrategy":"validation","validationCode":"const maxLength = coerceInt(rawMaxLength);\nif (!Number.isInteger(maxLength) || maxLength < 200) {\n    throw new Error('--max-length must be an integer >= 200');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the default (4000) unless truncation matters","Validate the flag value in wrapper scripts before invoking the CLI","Avoid shell quirks: quote values, watch for letter/number confusions (O vs 0)","Enforce a minimum of 200 in any UI wrapping this command"],"tags":["argument-validation","cli","input-validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}