{"record":{"id":"225488806455599e","repo":"jackwener/OpenCLI","slug":"argument-225488","errorCode":"ARGUMENT","errorMessage":"A review token is required.","messagePattern":"A review token is required\\.","errorType":"validation","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/paperreview/feedback.js","lineNumber":24,"sourceCode":"    name: 'feedback',\n    access: 'write',\n    description: 'Submit feedback for a paperreview.ai review token',\n    domain: PAPERREVIEW_DOMAIN,\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'token', positional: true, required: true, help: 'Review token returned by paperreview.ai' },\n        { name: 'helpfulness', required: true, type: 'int', help: 'Helpfulness score from 1 to 5' },\n        { name: 'critical-error', required: true, choices: ['yes', 'no'], help: 'Whether the review contains a critical error' },\n        { name: 'actionable-suggestions', required: true, choices: ['yes', 'no'], help: 'Whether the review contains actionable suggestions' },\n        { name: 'additional-comments', help: 'Optional free-text feedback' },\n        { name: 'timeout', type: 'int', required: false, default: 30, help: 'Max seconds for the overall command (default: 30)' },\n    ],\n    columns: ['status', 'token', 'helpfulness', 'critical_error', 'actionable_suggestions', 'message'],\n    func: async (kwargs) => {\n        const token = String(kwargs.token ?? '').trim();\n        if (!token) {\n            throw new CliError('ARGUMENT', 'A review token is required.');\n        }\n        const helpfulness = validateHelpfulness(kwargs.helpfulness);\n        const criticalError = parseYesNo(kwargs['critical-error'], 'critical-error');\n        const actionableSuggestions = parseYesNo(kwargs['actionable-suggestions'], 'actionable-suggestions');\n        const comments = String(kwargs['additional-comments'] ?? '').trim();\n        const payload = {\n            helpfulness,\n            has_critical_error: criticalError,\n            has_actionable_suggestions: actionableSuggestions,\n        };\n        if (comments) {\n            payload.additional_comments = comments;\n        }\n        const { response, payload: responsePayload } = await requestJson(`/api/feedback/${encodeURIComponent(token)}`, {\n            method: 'POST',\n            headers: { 'Content-Type': 'application/json' },\n            body: JSON.stringify(payload),\n        });","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/paperreview/feedback.js#L6-L42","documentation":"The paperreview `feedback` command requires a review token to identify which review to update. The CLI validates kwargs.token before doing any work and throws CliError with code ARGUMENT when it is missing or blank. This is a deliberate pre-flight argument check, not a server error.","triggerScenarios":"Running the feedback command without --token, or with an empty/whitespace-only value (e.g. --token \"\").","commonSituations":"Copy-pasting a command and losing the token argument; scripting the command with an unset shell variable (e.g. --token \"$REVIEW_TOKEN\" when the var is empty).","solutions":["Re-run the command with --token <your-review-token>.","In scripts, verify the token variable is non-empty before invoking the CLI.","Retrieve the token from the original review request output if lost."],"exampleFix":"// before\ncli feedback --critical-error no\n// after\ncli feedback --token abc123 --critical-error no","handlingStrategy":"validation","validationCode":"const token = process.env.REVIEW_TOKEN;\nif (!token || !token.trim()) {\n  throw new Error('Set --token or REVIEW_TOKEN before running feedback');\n}","typeGuard":"function hasToken(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  await cli.feedback({ token: '' });\n} catch (err) {\n  if (err.code === 'ARGUMENT') console.error('Missing --token; get it from your review request');\n  else throw err;\n}","preventionTips":["Store the token in an env var and assert it is set in scripts.","Keep the token from the review request handy before invoking.","Fail fast in wrappers when required args are empty."],"tags":["cli","validation","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}