{"record":{"id":"c2f769b90730b0b5","repo":"eyaltoledano/claude-task-master","slug":"authresult-error-interactive-authentication","errorCode":null,"errorMessage":"${authResult.error || 'Interactive authentication failed'}","messagePattern":"\\$\\{authResult\\.error \\|\\| 'Interactive authentication failed'\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/cli/src/commands/loop.command.ts","lineNumber":168,"sourceCode":"\t\tif (authCheck.error) {\n\t\t\tthrow new Error(authCheck.error);\n\t\t}\n\n\t\tif (authCheck.ready) {\n\t\t\tconsole.log(chalk.green('✓ Sandbox ready'));\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.log(\n\t\t\tchalk.yellow(\n\t\t\t\t'Sandbox needs authentication. Starting interactive session...'\n\t\t\t)\n\t\t);\n\t\tconsole.log(chalk.dim('Please complete auth, then Ctrl+C to continue.\\n'));\n\n\t\tconst authResult = this.tmCore.loop.runInteractiveAuth();\n\t\tif (!authResult.success) {\n\t\t\tthrow new Error(authResult.error || 'Interactive authentication failed');\n\t\t}\n\t\tconsole.log(chalk.green('✓ Auth complete\\n'));\n\t}\n\n\tprivate validateIterations(iterations: string): void {\n\t\tconst parsed = Number(iterations);\n\t\tif (!Number.isInteger(parsed) || parsed < 1) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid iterations: ${iterations}. Must be a positive integer.`\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate createOutputCallbacks(): LoopOutputCallbacks {\n\t\treturn {\n\t\t\tonIterationStart: (iteration: number, total: number) => {\n\t\t\t\tconsole.log();\n\t\t\t\tconsole.log(chalk.cyan(`━━━ Iteration ${iteration} of ${total} ━━━`));","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/apps/cli/src/commands/loop.command.ts#L150-L186","documentation":"updateSingleTaskStatus validates newStatus with isValidTaskStatus against the allowed TASK_STATUS_OPTIONS and throws when the value is not one of them. Statuses are a closed enum, so any unknown string is rejected before touching task data.","triggerScenarios":"Calling updateSingleTaskStatus (via setTaskStatus / `task-master set-status`) with newStatus like 'complete', 'in_progress', 'todo', or any casing variant not in the allowed options list.","commonSituations":"Version drift where scripts use status strings from an older Task Master release; confusing task-master statuses with other trackers' vocabularies ('todo'/'done'); case mismatches like 'InProgress'.","solutions":["Use an exact valid status from TASK_STATUS_OPTIONS (e.g. 'done' instead of 'complete')","Log/print TASK_STATUS_OPTIONS (or run task-master --help) to see allowed values","Normalize input (lowercase, trim) and validate with isValidTaskStatus before calling"],"exampleFix":"// before\nawait setTaskStatus(tasksPath, '5', 'complete');\n// after\nawait setTaskStatus(tasksPath, '5', 'done');","handlingStrategy":"validation","validationCode":"const TASK_STATUS_OPTIONS = ['pending','in-progress','done','deferred','cancelled'];\nconst normalized = String(newStatus || '').toLowerCase().trim();\nif (!TASK_STATUS_OPTIONS.includes(normalized)) {\n  throw new Error(`Invalid status \"${newStatus}\". Use: ${TASK_STATUS_OPTIONS.join(', ')}`);\n}","typeGuard":"type TaskStatus = 'pending'|'in-progress'|'done'|'deferred'|'cancelled';\nconst isTaskStatus = (v: unknown): v is TaskStatus =>\n  typeof v === 'string' && ['pending','in-progress','done','deferred','cancelled'].includes(v);","tryCatchPattern":"try {\n  await setTaskStatus(tasksPath, taskId, newStatus);\n} catch (e) {\n  if (e.message.includes('Invalid status value')) {\n    throw new Error(`Allowed statuses: pending, in-progress, done... (got \"${newStatus}\")`);\n  }\n  throw e;\n}","preventionTips":["Normalize user input (trim + lowercase) before setting status","Centralize status literals in a typed constant/enum","Check the allowed list for your installed Task Master version (statuses have changed across versions)"],"tags":["validation","enum","task-status"],"backgroundTag":"invalid-enum-value","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}