diegosouzapw/OmniRoute · error
Unhandled CursorRenewalResult status
Error message
Unhandled CursorRenewalResult status: ${JSON.stringify(_exhaustive)} What it means
Exhaustiveness assertion in the Cursor token health check: a switch over CursorRenewalResult.status reached a value outside the known union (renewed/stale/error/…). This is a defensive invariant violation — new status was added to the type without a handler — not an expected runtime condition; the JSON of the unmatched value is embedded for diagnosis.
Solutions
- Update the health check to handle the new CursorRenewalResult status
- Fall back to treating unknown statuses as non-renewal (skip the connection) until patched
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at src/lib/tokenHealthCheckCursor.ts:86 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/bbad8840ae3435fc.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/tokenHealthCheckCursor.ts:86
result.status === "error"
? `Cursor session renewal failed: ${result.error}`
: "Cursor session unchanged — no newer token found on this host.";
await updateProviderConnection(
conn.id,
buildRefreshFailureUpdate(conn, now, {
errorCode: "cursor_session_stale",
lastErrorType: "cursor_session_stale",
lastError: message,
testStatus: "active",
})
);
const logFn = result.status === "error" ? logError : logWarn;
logFn(`${logPrefix} ✗ Cursor session stale for ${getConnectionLogLabel(conn)}: ${message}`);
return;
}
default: {
const _exhaustive: never = result;
throw new Error(`Unhandled CursorRenewalResult status: ${JSON.stringify(_exhaustive)}`);
}
}
});
}
View on GitHub (pinned to a179ffed5b)