nexu-io/open-design · warning
vela login attempt is no longer active
Error message
vela login attempt is no longer active
What it means
Raised at the top of spawnVelaLoginAttempt() when currentVelaLoginAttempt(deps.attempt) returns null. That helper returns null when the attempt was canceled, superseded by a newer generation, or its authAttemptId/generation no longer matches latestLoginAttempt. It is a cancellation/supersession guard, not a spawn failure.
Source
Thrown at apps/daemon/src/integrations/vela.ts:1165
throw new Error(`vela login failed to start: ${result.error.message}`);
}
const detail = (capture.stderr || capture.stdout).trim();
throw new Error(
detail ||
`vela login exited before device authorization started (code ${result.code ?? 'null'}, signal ${result.signal ?? 'null'})`,
);
}
interface SpawnVelaLoginAttemptDeps extends SpawnVelaLoginDeps {
attempt: VelaLoginAttemptRef;
onLatePreActivationFailure?: () => Promise<void>;
}
async function spawnVelaLoginAttempt(
deps: SpawnVelaLoginAttemptDeps,
): Promise<SpawnedVelaLogin> {
const attemptState = currentVelaLoginAttempt(deps.attempt);
if (!attemptState) throw new Error('vela login attempt is no longer active');
if (hasRunningVelaLoginChild()) throw new Error('vela login already running');
const def = getAgentDef('amr');
if (!def) {
recordVelaAuthStage(
deps.attempt,
{ stage: 'spawn_result', result: 'failed', errorKind: 'internal_error' },
'daemon',
);
throw new Error('AMR runtime def not registered');
}
const baseEnv = deps.baseEnv ?? process.env;
const configuredEnv = withDefaultVelaApiUrl(
deps.configuredEnv ?? {},
baseEnv,
deps.defaultApiUrl,
);
const launch = resolveAgentLaunch(def, configuredEnv);
const bin = launch.selectedPath;View on GitHub (pinned to 5be4028344)
Solutions
- Treat this as 'login canceled' rather than a hard error — surface cancellation to the user and stop the flow.
- Do not reuse an attempt ref across cancel boundaries; call beginVelaLoginAttempt() to get a fresh generation.
- Before spawning, check currentVelaLoginAttempt(attempt) !== null and skip spawn if null.
Example fix
// before
const attemptState = currentVelaLoginAttempt(deps.attempt);
if (!attemptState) throw new Error('vela login attempt is no longer active');
// after
const attemptState = currentVelaLoginAttempt(deps.attempt);
if (!attemptState) {
return { kind: 'canceled' } as const;
} Defensive patterns
Strategy: validation
Validate before calling
import { currentVelaLoginAttempt } from '../integrations/vela.js';
function isAttemptStillActive(ref: VelaLoginAttemptRef): boolean {
return currentVelaLoginAttempt(ref) !== null;
}
// usage right before spawn
if (!isAttemptStillActive(deps.attempt)) {
return { kind: 'canceled' };
} Type guard
function isLoginNoLongerActive(err: unknown): boolean {
return err instanceof Error && err.message === 'vela login attempt is no longer active';
} Try / catch
try {
return await spawnVelaLoginAttempt(deps);
} catch (err) {
if (err instanceof Error && err.message === 'vela login attempt is no longer active') {
return { kind: 'canceled' };
}
throw err;
} Prevention
- Never reuse an attempt ref across cancel boundaries — call beginVelaLoginAttempt() for a fresh generation.
- Treat this throw as 'canceled', not a hard failure.
- Avoid launching the proxy fallback after the direct attempt was canceled.
When it happens
Trigger: Between beginVelaLoginAttempt() and spawnVelaLoginAttempt(), cancelVelaLogin() ran (or a newer attempt bumped loginGeneration), so the spawn refuses to start a now-stale child. Also happens if the attempt ref was constructed manually with a wrong generation.
Common situations: User cancels login while the spawn is being prepared; a new login bumps the generation; proxy fallback tries to spawn after the direct attempt was canceled; test fixture passes a stale attempt ref.
Related errors
- vela login already running
- vela login failed to start: ${result.error.message}
- vela login exited before authentication completed (code ${re
- vela login exited before device authorization started (code
- failed to spawn vela login
AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12).
Data as JSON: /api/errors/9dbd0841b05af57d.
Report an issue: GitHub.