{"record":{"id":"17c45f96fa134fbc","repo":"eyaltoledano/claude-task-master","slug":"unknown-flow-status-data-status","errorCode":null,"errorMessage":"Unknown flow status: ${data.status}","messagePattern":"Unknown flow status: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/tm-core/src/modules/auth/services/oauth-service.ts","lineNumber":411,"sourceCode":"\t\t\t\t\t\t\t'OAUTH_FAILED'\n\t\t\t\t\t\t);\n\n\t\t\t\t\tcase 'expired':\n\t\t\t\t\t\tthrow new AuthenticationError(\n\t\t\t\t\t\t\t'Authentication flow expired',\n\t\t\t\t\t\t\t'AUTH_TIMEOUT'\n\t\t\t\t\t\t);\n\n\t\t\t\t\tcase 'pending':\n\t\t\t\t\tcase 'authenticating':\n\t\t\t\t\t\t// Still waiting, continue polling\n\t\t\t\t\t\tthis.logger.debug(\n\t\t\t\t\t\t\t`Flow status: ${data.status}, continuing to poll`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthis.logger.warn(`Unknown flow status: ${data.status}`);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof AuthenticationError) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\t// Log network errors but continue polling\n\t\t\t\tthis.logger.debug('Poll request failed, will retry:', error);\n\t\t\t}\n\n\t\t\t// Wait before next poll\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, pollInterval));\n\t\t}\n\n\t\tthrow new AuthenticationError('Authentication timeout', 'AUTH_TIMEOUT');\n\t}\n\n\t/**","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/auth/services/oauth-service.ts#L393-L429","documentation":"While polling the OAuth device/flow endpoint for completion, the server returned a status string the client's switch statement doesn't recognize (it handles success, pending, expired, error, etc.). The client logs a warning and keeps polling rather than failing, so an unrecognized-but-terminal status could cause indefinite polling.","triggerScenarios":"The flow status endpoint returns a new or localized status value — e.g. after a server API version bump introducing statuses like 'cancelled', 'timeout', or 'rate_limited' the older client doesn't map.","commonSituations":"Server/client version mismatch (updated backend, stale CLI); proxies returning nonstandard status bodies; a buggy server emitting typo'd status values; polling a flow whose authorization URL was generated by a newer client.","solutions":["Update @tm-core / the CLI to the latest version so the poller recognizes current status values.","Log the full polling response and align the client switch statement with the server's documented status enum.","If the unknown status is terminal (e.g. 'cancelled'), abort polling and restart the auth flow instead of looping.","Report the unexpected status value to the maintainers if server and client versions already match."],"exampleFix":"// before\ncase 'expired': ... break;\ndefault: this.logger.warn(`Unknown flow status: ${data.status}`);\n// after\ncase 'expired': ... break;\ncase 'cancelled': case 'timeout': this.stopPolling(new AuthenticationError(`Flow ${data.status}`)); break;\ndefault: this.logger.warn(`Unknown flow status: ${data.status}`);","handlingStrategy":"retry","validationCode":"const KNOWN_STATUSES = ['success', 'pending', 'expired', 'error', 'processing'];\nif (data.status && !KNOWN_STATUSES.includes(data.status)) {\n  console.warn(`Unrecognized flow status '${data.status}'; verify server/client versions match.`);\n}","typeGuard":"function isKnownFlowStatus(s) {\n  return ['success', 'pending', 'expired', 'error', 'processing'].includes(s);\n}","tryCatchPattern":"try {\n  await pollForCompletion(flowId, { timeoutMs: 120_000 });\n} catch (err) {\n  if (err.name === 'PollTimeoutError') {\n    console.warn('Polling did not reach a recognized terminal state; restarting auth flow.');\n    await restartAuthFlow();\n  }\n}","preventionTips":["Keep CLI/tm-core versions in sync with the backend API version.","Always bound polling with a timeout so unknown statuses cannot loop forever.","Log the raw poll response when this warning fires to capture the new status value.","Check server release notes for added flow status enums after upgrades."],"tags":["auth","oauth","polling","api-versioning","unknown-state"],"backgroundTag":"unknown-enum-value","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}