Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore(session): reorder imports and reformat type annotation

Steven Enamakel54c10f75177f
diff --git a/app/src/services/session/sessionOwner.ts b/app/src/services/session/sessionOwner.ts
index 73c77fab54..df9626f0f8 100644
--- a/app/src/services/session/sessionOwner.ts
+++ b/app/src/services/session/sessionOwner.ts
@@ -17,12 +17,12 @@
* `EXPIRED`, `TRANSIENT`, `CONSUME_FAILED`, `CORE`, …) so callers can classify
* without parsing prose.
*/
+import { getStoredCoreMode } from '../../utils/configPersistence';
+import { isLocalSessionToken } from '../../utils/localSession';
+import { safeInvoke as invoke, isTauri } from '../../utils/tauriCommands/common';
import { getBackendUrl } from '../backendUrl';
import { getClientVersionHeaders } from '../clientVersionHeaders';
import { callCoreRpc } from '../coreRpcClient';
-import { getStoredCoreMode } from '../../utils/configPersistence';
-import { isLocalSessionToken } from '../../utils/localSession';
-import { isTauri, safeInvoke as invoke } from '../../utils/tauriCommands/common';
export interface SessionCurrentUser {
user: object | null;
@@ -229,10 +229,11 @@ export const logoutSession = async (): Promise<void> => {
*/
export const fetchCurrentUser = async (force = false): Promise<SessionCurrentUser> => {
if (useShellSessionOwner()) {
- const cached = await invoke<{ user: object | null; stale: boolean; staleSeconds: number | null }>(
- 'auth_current_user',
- { force }
- );
+ const cached = await invoke<{
+ user: object | null;
+ stale: boolean;
+ staleSeconds: number | null;
+ }>('auth_current_user', { force });
return { user: cached.user, stale: cached.stale, staleSeconds: cached.staleSeconds };
}
return browserCurrentUser();
diff --git a/app/src/utils/desktopDeepLinkListener.ts b/app/src/utils/desktopDeepLinkListener.ts
index 0006aa4682..595632f74d 100644
--- a/app/src/utils/desktopDeepLinkListener.ts
+++ b/app/src/utils/desktopDeepLinkListener.ts
@@ -10,7 +10,6 @@ import {
sessionErrorKind,
storeSessionToken,
} from '../services/session/sessionOwner';
-import { getSessionToken } from './tauriCommands/auth';
import {
beginDeepLinkAuthProcessing,
completeDeepLinkAuthProcessing,
@@ -30,6 +29,7 @@ import {
} from './oauthAppVersionGate';
import { clearOAuthReturnRoute, takeOAuthReturnRoute } from './oauthReturnRoute';
import { openUrl } from './openUrl';
+import { getSessionToken } from './tauriCommands/auth';
import { isTauri as coreIsTauri } from './tauriCommands/common';
const SESSION_TOKEN_UPDATED_EVENT = 'core-state:session-token-updated';
@@ -173,9 +173,7 @@ const AUTH_STORE_SUPPRESS_REAUTH_MS = 40_000;
* Hand a login token or a raw session token to the session owner and, once
* it is installed, surface the stored token to the core-state layer.
*/
-const applySessionToken = async (
- install: () => Promise<void>
-): Promise<void> => {
+const applySessionToken = async (install: () => Promise<void>): Promise<void> => {
// In cloud mode, bust any stale RPC URL/token caches so the credential
// handoff targets the user's configured remote core. See issue #2377.
const currentCoreMode = getStoredCoreMode();