earendil-works/pi · error · Error

Device flow timed out

Error message

Device flow timed out

What it means

The device-code polling loop exited because the deadline (expires_in from the device authorization) passed without the flow completing; thrown after the loop breaks so the caller sees an explicit timeout rather than an undefined result.

Solutions

  1. Restart the device flow and authorize before the device code expires.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/ai/src/auth/oauth/device-code.ts:97 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/299e12c420813c57. Report an issue: GitHub.

Appendix: source

Thrown at packages/ai/src/auth/oauth/device-code.ts:97

			// in `interval`); trusting only a client-tracked value risks polling early forever under
			// WSL/VM clock drift. Otherwise apply RFC 8628 section 3.5: increase by 5 seconds.
			intervalMs =
				typeof result.intervalSeconds === "number" &&
				Number.isFinite(result.intervalSeconds) &&
				result.intervalSeconds > 0
					? Math.max(MINIMUM_INTERVAL_MS, Math.floor(result.intervalSeconds * 1000))
					: Math.max(MINIMUM_INTERVAL_MS, intervalMs + SLOW_DOWN_INTERVAL_INCREMENT_MS);
		}

		const remainingMs = deadline - Date.now();
		if (remainingMs <= 0) {
			break;
		}

		await abortableSleep(Math.min(intervalMs, remainingMs), options.signal, CANCEL_MESSAGE);
	}

	throw new Error(slowDownResponses > 0 ? SLOW_DOWN_TIMEOUT_MESSAGE : TIMEOUT_MESSAGE);
}

View on GitHub (pinned to 4af9d21d3b)