@devries-cameron20 / t3code Mirror · read-only / commits / 6bcbb9519b
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 23:15 UTC

fix(desktop): stop blocking the renderer during topology polling (#19300)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Daniyal committed Oct 20, 2026 at 00:02 UTC 6bcbb9519ba02258342e8d0ffa98a53cf446033c
10 files changed +244 -83
apps/desktop/src/ipc/DesktopIpcHandlers.ts
+2
@@ -40,6 +40,7 @@ import {
40 import {
41 getAppBranding,
42 getLocalEnvironmentBootstraps,
43 + readLocalEnvironmentBootstraps,
44 getLocalEnvironmentBearerToken,
45 getRelayTelemetryEnabled,
46 getSystemLocale,
@@ -100,6 +101,7 @@ export const installDesktopIpcHandlers = Effect.fn("desktop.ipc.installHandlers"
101 yield* ipc.handleSync(getSystemLocale);
102 yield* ipc.handleSync(getWindowFullscreenState);
103 yield* ipc.handleSync(getLocalEnvironmentBootstraps);
104 + yield* ipc.handle(readLocalEnvironmentBootstraps);
105 yield* ipc.handleSync(getLocalEnvironmentEnabled);
106 yield* ipc.handle(setLocalEnvironmentEnabled);
107 yield* ipc.handle(getLocalEnvironmentBearerToken);
apps/desktop/src/ipc/methods/window.ts
+58 -47
@@ -99,57 +99,68 @@ export const getWindowFullscreenState = DesktopIpc.makeSyncIpcMethod({
99 }),
100 });
101
102 -export const getLocalEnvironmentBootstraps = DesktopIpc.makeSyncIpcMethod({
103 - channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAPS_CHANNEL,
104 - result: Schema.Array(DesktopEnvironmentBootstrapSchema),
105 - handler: Effect.fn("desktop.ipc.window.getLocalEnvironmentBootstraps")(function* () {
106 - const pool = yield* DesktopBackendPool.DesktopBackendPool;
107 - const configuration = yield* DesktopBackendConfiguration.DesktopBackendConfiguration;
108 - const instances = yield* pool.list;
109 - const bootstraps: DesktopEnvironmentBootstrap[] = [];
110 - for (const instance of instances) {
111 - const isPrimary = instance.id === PRIMARY_LOCAL_ENVIRONMENT_ID;
112 - const config = yield* instance.currentConfig;
113 - const snapshot = yield* instance.snapshot;
114 - if (Option.isNone(config) || Option.isSome(config.value.preflightFailure)) {
115 - const fatalPreflight =
116 - Option.isSome(config) &&
117 - Option.isSome(config.value.preflightFailure) &&
118 - config.value.preflightFailure.value.fatal;
119 - const stoppedPreflight =
120 - Option.isSome(config) &&
121 - Option.isSome(config.value.preflightFailure) &&
122 - (!snapshot.desiredRunning || !snapshot.restartScheduled);
123 - if (isPrimary || fatalPreflight || stoppedPreflight) continue;
124 - bootstraps.push({
125 - id: instance.id,
126 - label: yield* instance.label,
127 - runningDistro: null,
128 - httpBaseUrl: null,
129 - wsBaseUrl: null,
130 - });
131 - continue;
132 - }
133 - const { bootstrap, httpBaseUrl } = config.value;
134 - const runningDistro = config.value.runningDistro ?? null;
102 +const readLocalEnvironmentBootstrapSnapshot = Effect.fn(
103 + "desktop.ipc.window.getLocalEnvironmentBootstraps",
104 +)(function* () {
105 + const pool = yield* DesktopBackendPool.DesktopBackendPool;
106 + const configuration = yield* DesktopBackendConfiguration.DesktopBackendConfiguration;
107 + const instances = yield* pool.list;
108 + const bootstraps: DesktopEnvironmentBootstrap[] = [];
109 + for (const instance of instances) {
110 + const isPrimary = instance.id === PRIMARY_LOCAL_ENVIRONMENT_ID;
111 + const config = yield* instance.currentConfig;
112 + const snapshot = yield* instance.snapshot;
113 + if (Option.isNone(config) || Option.isSome(config.value.preflightFailure)) {
114 + const fatalPreflight =
115 + Option.isSome(config) &&
116 + Option.isSome(config.value.preflightFailure) &&
117 + config.value.preflightFailure.value.fatal;
118 + const stoppedPreflight =
119 + Option.isSome(config) &&
120 + Option.isSome(config.value.preflightFailure) &&
121 + (!snapshot.desiredRunning || !snapshot.restartScheduled);
122 + if (isPrimary || fatalPreflight || stoppedPreflight) continue;
123 bootstraps.push({
124 id: instance.id,
137 - label: runningDistro === null ? yield* instance.label : `WSL (${runningDistro})`,
138 - runningDistro,
139 - httpBaseUrl: httpBaseUrl.href,
140 - wsBaseUrl: toWebSocketBaseUrl(httpBaseUrl),
141 - // A backend launched with the desktop secret accepts whichever token the secret derives
142 - // for the current window, so hand out that one rather than the token frozen into its
143 - // launch config.
144 - ...(bootstrap.desktopBootstrapSecret
145 - ? { bootstrapToken: yield* configuration.currentBootstrapToken }
146 - : bootstrap.desktopBootstrapToken
147 - ? { bootstrapToken: bootstrap.desktopBootstrapToken }
148 - : {}),
125 + label: yield* instance.label,
126 + runningDistro: null,
127 + httpBaseUrl: null,
128 + wsBaseUrl: null,
129 });
130 + continue;
131 }
151 - return bootstraps;
152 - }),
132 + const { bootstrap, httpBaseUrl } = config.value;
133 + const runningDistro = config.value.runningDistro ?? null;
134 + bootstraps.push({
135 + id: instance.id,
136 + label: runningDistro === null ? yield* instance.label : `WSL (${runningDistro})`,
137 + runningDistro,
138 + httpBaseUrl: httpBaseUrl.href,
139 + wsBaseUrl: toWebSocketBaseUrl(httpBaseUrl),
140 + // A backend launched with the desktop secret accepts whichever token the secret derives
141 + // for the current window, so hand out that one rather than the token frozen into its
142 + // launch config.
143 + ...(bootstrap.desktopBootstrapSecret
144 + ? { bootstrapToken: yield* configuration.currentBootstrapToken }
145 + : bootstrap.desktopBootstrapToken
146 + ? { bootstrapToken: bootstrap.desktopBootstrapToken }
147 + : {}),
148 + });
149 + }
150 + return bootstraps;
151 +});
152 +
153 +export const getLocalEnvironmentBootstraps = DesktopIpc.makeSyncIpcMethod({
154 + channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAPS_CHANNEL,
155 + result: Schema.Array(DesktopEnvironmentBootstrapSchema),
156 + handler: readLocalEnvironmentBootstrapSnapshot,
157 +});
158 +
159 +export const readLocalEnvironmentBootstraps = DesktopIpc.makeIpcMethod({
160 + channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAPS_CHANNEL,
161 + payload: Schema.Void,
162 + result: Schema.Array(DesktopEnvironmentBootstrapSchema),
163 + handler: readLocalEnvironmentBootstrapSnapshot,
164 });
165
166 function extractWslDistroFromEnvironmentId(envId: string): string | null {
apps/desktop/src/preload.ts
+17 -8
@@ -12,6 +12,7 @@ import { contextBridge, ipcRenderer, webFrame, webUtils } from "electron";
12
13 import * as IpcChannels from "./ipc/channels.ts";
14 import { mergeLegacyLocalStorage } from "./legacyLocalStorageMerge.ts";
15 +import { createPreloadSnapshot } from "./preloadSnapshot.ts";
16
17 const SNAP_SHOT_EVENT_TYPES = new Set([
18 "requested",
@@ -74,6 +75,18 @@ function unwrapEnsureSshEnvironmentResult(result: unknown) {
75 return result as Awaited<ReturnType<DesktopBridge["ensureSshEnvironment"]>>;
76 }
77
78 +const readBootstraps = (
79 + result: unknown,
80 +): ReturnType<DesktopBridge["getLocalEnvironmentBootstraps"]> =>
81 + Array.isArray(result) ? result : [];
82 +const localEnvironmentBootstraps = createPreloadSnapshot(
83 + () => readBootstraps(ipcRenderer.sendSync(IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAPS_CHANNEL)),
84 + async () =>
85 + readBootstraps(await ipcRenderer.invoke(IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAPS_CHANNEL)),
86 +);
87 +// Changes take effect on relaunch, so renderer reads can reuse the startup value.
88 +let localEnvironmentEnabled: boolean | undefined;
89 +
90 contextBridge.exposeInMainWorld("desktopBridge", {
91 getAppBranding: () => {
92 const result = ipcRenderer.sendSync(IpcChannels.GET_APP_BRANDING_CHANNEL);
@@ -103,17 +116,13 @@ contextBridge.exposeInMainWorld("desktopBridge", {
116 const result = ipcRenderer.sendSync(IpcChannels.GET_SYSTEM_LOCALE_CHANNEL);
117 return typeof result === "string" ? result : null;
118 },
106 - getLocalEnvironmentBootstraps: () => {
107 - const result = ipcRenderer.sendSync(IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAPS_CHANNEL);
108 - if (!Array.isArray(result)) {
109 - return [];
110 - }
111 - return result as ReturnType<DesktopBridge["getLocalEnvironmentBootstraps"]>;
112 - },
119 + getLocalEnvironmentBootstraps: localEnvironmentBootstraps.read,
120 + readLocalEnvironmentBootstraps: localEnvironmentBootstraps.refresh,
121 getLocalEnvironmentBearerToken: () =>
122 ipcRenderer.invoke(IpcChannels.GET_LOCAL_ENVIRONMENT_BEARER_TOKEN_CHANNEL),
123 getLocalEnvironmentEnabled: () =>
116 - ipcRenderer.sendSync(IpcChannels.GET_LOCAL_ENVIRONMENT_ENABLED_CHANNEL) !== false,
124 + (localEnvironmentEnabled ??=
125 + ipcRenderer.sendSync(IpcChannels.GET_LOCAL_ENVIRONMENT_ENABLED_CHANNEL) !== false),
126 setLocalEnvironmentEnabled: (enabled) =>
127 ipcRenderer.invoke(IpcChannels.SET_LOCAL_ENVIRONMENT_ENABLED_CHANNEL, enabled),
128 getClientSettings: () => ipcRenderer.invoke(IpcChannels.GET_CLIENT_SETTINGS_CHANNEL),
apps/desktop/src/preloadSnapshot.test.ts new
+45
@@ -0,0 +1,45 @@
1 +import { expect, it, vi } from "vite-plus/test";
2 +
3 +import { createPreloadSnapshot } from "./preloadSnapshot.ts";
4 +
5 +it("serves the startup snapshot while a shared asynchronous refresh is pending", async () => {
6 + const initial = ["primary"];
7 + const latest = Promise.withResolvers<string[]>();
8 + const readInitial = vi.fn(() => initial);
9 + const readLatest = vi.fn(() => latest.promise);
10 + const snapshot = createPreloadSnapshot(readInitial, readLatest);
11 +
12 + expect(snapshot.read()).toBe(initial);
13 + const first = snapshot.refresh();
14 + const second = snapshot.refresh();
15 + expect(snapshot.read()).toBe(initial);
16 + expect(snapshot.read()).toBe(initial);
17 + expect(readInitial).toHaveBeenCalledTimes(1);
18 + expect(readLatest).toHaveBeenCalledTimes(1);
19 +
20 + const connected = ["primary", "wsl"];
21 + latest.resolve(connected);
22 + expect(await first).toBe(connected);
23 + expect(await second).toBe(connected);
24 + expect(snapshot.read()).toBe(connected);
25 + expect(readInitial).toHaveBeenCalledTimes(1);
26 +});
27 +
28 +it("retains an async snapshot through failure and replaces it on successful recovery", async () => {
29 + const connected = ["primary", "wsl"];
30 + const readInitial = vi.fn(() => ["stale"]);
31 + const readLatest = vi
32 + .fn<() => Promise<string[]>>()
33 + .mockResolvedValueOnce(connected)
34 + .mockRejectedValueOnce(new Error("IPC unavailable"))
35 + .mockResolvedValueOnce([]);
36 + const snapshot = createPreloadSnapshot(readInitial, readLatest);
37 +
38 + await snapshot.refresh();
39 + expect(snapshot.read()).toBe(connected);
40 + await expect(snapshot.refresh()).rejects.toThrow("IPC unavailable");
41 + expect(snapshot.read()).toBe(connected);
42 + await expect(snapshot.refresh()).resolves.toEqual([]);
43 + expect(snapshot.read()).toEqual([]);
44 + expect(readInitial).not.toHaveBeenCalled();
45 +});
apps/desktop/src/preloadSnapshot.ts new
+23
@@ -0,0 +1,23 @@
1 +export function createPreloadSnapshot<T>(readInitial: () => T, readLatest: () => Promise<T>) {
2 + let snapshot: { readonly value: T } | undefined;
3 + let pending: Promise<T> | undefined;
4 +
5 + return {
6 + read: () => {
7 + snapshot ??= { value: readInitial() };
8 + return snapshot.value;
9 + },
10 + refresh: () => {
11 + if (pending !== undefined) return pending;
12 + pending = readLatest()
13 + .then((value) => {
14 + snapshot = { value };
15 + return value;
16 + })
17 + .finally(() => {
18 + pending = undefined;
19 + });
20 + return pending;
21 + },
22 + };
23 +}
apps/web/src/connection/desktopLocal.test.ts
+52 -2
@@ -7,7 +7,7 @@ import {
7 EnvironmentId,
8 PRIMARY_LOCAL_ENVIRONMENT_ID,
9 } from "@t3tools/contracts";
10 -import { describe, expect, it } from "vite-plus/test";
10 +import { describe, expect, it, vi } from "vite-plus/test";
11
12 import {
13 createDesktopSecondaryBootstrapsReader,
@@ -55,7 +55,52 @@ describe("desktop local connection identity", () => {
55 });
56
57 describe("desktop local topology reads", () => {
58 - it("reuses snapshots when polling returns fresh objects for the same topology", () => {
58 + it("refreshes topology asynchronously, retaining identity through unchanged reads and failures", async () => {
59 + const secondary: DesktopEnvironmentBootstrap = {
60 + id: "wsl:default",
61 + label: "WSL",
62 + runningDistro: "Ubuntu",
63 + httpBaseUrl: "http://127.0.0.1:4000",
64 + wsBaseUrl: "ws://127.0.0.1:4000",
65 + bootstrapToken: "bootstrap-1",
66 + };
67 + let entries = [secondary, { ...secondary, id: PRIMARY_LOCAL_ENVIRONMENT_ID }];
68 + let cached = entries;
69 + const getLocalEnvironmentBootstraps = vi.fn(() => cached);
70 + const readLocalEnvironmentBootstraps = vi.fn(async () => {
71 + cached = entries.map((entry) => ({ ...entry }));
72 + return cached;
73 + });
74 + const reader = createDesktopSecondaryBootstrapsReader(() => ({
75 + getLocalEnvironmentBootstraps,
76 + readLocalEnvironmentBootstraps,
77 + }));
78 +
79 + const connected = await reader.refresh();
80 + expect(connected).toEqual({ _tag: "Success", bootstraps: [secondary] });
81 + expect(getLocalEnvironmentBootstraps).not.toHaveBeenCalled();
82 + if (connected._tag !== "Success") throw new Error("expected connected topology");
83 +
84 + const unchanged = await reader.refresh();
85 + if (unchanged._tag !== "Success") throw new Error("expected unchanged topology");
86 + expect(unchanged.bootstraps).toBe(connected.bootstraps);
87 + expect(getLocalEnvironmentBootstraps).not.toHaveBeenCalled();
88 + expect(reader.readSnapshot()).toBe(connected.bootstraps);
89 +
90 + const cause = new Error("IPC unavailable");
91 + readLocalEnvironmentBootstraps.mockRejectedValueOnce(cause);
92 + expect(await reader.refresh()).toEqual({ _tag: "Failure", cause });
93 + expect(reader.readSnapshot()).toBe(connected.bootstraps);
94 +
95 + entries = [];
96 + const removed = await reader.refresh();
97 + expect(removed).toEqual({ _tag: "Success", bootstraps: [] });
98 + if (removed._tag !== "Success") throw new Error("expected empty topology");
99 + expect(reader.readSnapshot()).toBe(removed.bootstraps);
100 + expect(removed.bootstraps).not.toBe(connected.bootstraps);
101 + });
102 +
103 + it("reuses snapshots when polling returns fresh objects for the same topology", async () => {
104 const secondary: DesktopEnvironmentBootstrap = {
105 id: "wsl:default",
106 label: "WSL",
@@ -70,11 +115,16 @@ describe("desktop local topology reads", () => {
115 }));
116
117 const connected = reader.readSnapshot();
118 + const refreshed = await reader.refresh();
119 + expect(refreshed).toEqual({ _tag: "Success", bootstraps: [secondary] });
120 + if (refreshed._tag !== "Success") throw new Error("expected legacy topology");
121 + expect(refreshed.bootstraps).toBe(connected);
122 expect(reader.readSnapshot()).toBe(connected);
123 expect(reader.readResult()).toEqual({ _tag: "Success", bootstraps: connected });
124 expect(reader.readSnapshot()).toBe(connected);
125
126 entries = [];
127 + expect(await reader.refresh()).toEqual({ _tag: "Success", bootstraps: [] });
128 const empty = reader.readSnapshot();
129 expect(empty).toEqual([]);
130 expect(reader.readSnapshot()).toBe(empty);
apps/web/src/connection/desktopLocal.ts
+40 -24
@@ -47,6 +47,7 @@ export type DesktopSecondaryBootstrapsRead =
47
48 export interface DesktopSecondaryBootstrapsReader {
49 readonly readResult: () => DesktopSecondaryBootstrapsRead;
50 + readonly refresh: () => Promise<DesktopSecondaryBootstrapsRead>;
51 readonly readSnapshot: () => ReadonlyArray<DesktopEnvironmentBootstrap>;
52 }
53
@@ -55,10 +56,36 @@ export interface DesktopSecondaryBootstrapsReader {
56 * consumers cannot temporarily disagree with the platform's retained registrations.
57 */
58 export function createDesktopSecondaryBootstrapsReader(
58 - resolveBridge: () => Pick<DesktopBridge, "getLocalEnvironmentBootstraps"> | undefined,
59 + resolveBridge: () =>
60 + | Pick<DesktopBridge, "getLocalEnvironmentBootstraps" | "readLocalEnvironmentBootstraps">
61 + | undefined,
62 ): DesktopSecondaryBootstrapsReader {
63 let snapshot: ReadonlyArray<DesktopEnvironmentBootstrap> = [];
64
65 + const updateSnapshot = (
66 + entries: ReadonlyArray<DesktopEnvironmentBootstrap>,
67 + ): DesktopSecondaryBootstrapsRead => {
68 + const next = entries.filter((entry) => entry.id !== PRIMARY_LOCAL_ENVIRONMENT_ID);
69 + if (
70 + next.length !== snapshot.length ||
71 + next.some((entry, index) => {
72 + const previous = snapshot[index];
73 + return (
74 + previous === undefined ||
75 + entry.id !== previous.id ||
76 + entry.label !== previous.label ||
77 + entry.runningDistro !== previous.runningDistro ||
78 + entry.httpBaseUrl !== previous.httpBaseUrl ||
79 + entry.wsBaseUrl !== previous.wsBaseUrl ||
80 + entry.bootstrapToken !== previous.bootstrapToken
81 + );
82 + })
83 + ) {
84 + snapshot = next;
85 + }
86 + return { _tag: "Success", bootstraps: snapshot };
87 + };
88 +
89 const readResult = (): DesktopSecondaryBootstrapsRead => {
90 const bridge = resolveBridge();
91 if (bridge === undefined) {
@@ -66,27 +93,7 @@ export function createDesktopSecondaryBootstrapsReader(
93 return { _tag: "Success", bootstraps: snapshot };
94 }
95 try {
69 - const next = bridge
70 - .getLocalEnvironmentBootstraps()
71 - .filter((entry) => entry.id !== PRIMARY_LOCAL_ENVIRONMENT_ID);
72 - if (
73 - next.length !== snapshot.length ||
74 - next.some((entry, index) => {
75 - const previous = snapshot[index];
76 - return (
77 - previous === undefined ||
78 - entry.id !== previous.id ||
79 - entry.label !== previous.label ||
80 - entry.runningDistro !== previous.runningDistro ||
81 - entry.httpBaseUrl !== previous.httpBaseUrl ||
82 - entry.wsBaseUrl !== previous.wsBaseUrl ||
83 - entry.bootstrapToken !== previous.bootstrapToken
84 - );
85 - })
86 - ) {
87 - snapshot = next;
88 - }
89 - return { _tag: "Success", bootstraps: snapshot };
96 + return updateSnapshot(bridge.getLocalEnvironmentBootstraps());
97 } catch (cause) {
98 return { _tag: "Failure", cause };
99 }
@@ -94,6 +101,15 @@ export function createDesktopSecondaryBootstrapsReader(
101
102 return {
103 readResult,
104 + refresh: async () => {
105 + const bridge = resolveBridge();
106 + if (bridge?.readLocalEnvironmentBootstraps === undefined) return readResult();
107 + try {
108 + return updateSnapshot(await bridge.readLocalEnvironmentBootstraps());
109 + } catch (cause) {
110 + return { _tag: "Failure", cause };
111 + }
112 + },
113 readSnapshot: () => {
114 const result = readResult();
115 return result._tag === "Success" ? result.bootstraps : snapshot;
@@ -105,8 +121,8 @@ const desktopSecondaryBootstrapsReader = createDesktopSecondaryBootstrapsReader(
121 () => window.desktopBridge,
122 );
123
108 -export function readDesktopSecondaryBootstrapsResult(): DesktopSecondaryBootstrapsRead {
109 - return desktopSecondaryBootstrapsReader.readResult();
124 +export function readDesktopSecondaryBootstrapsResult(): Promise<DesktopSecondaryBootstrapsRead> {
125 + return desktopSecondaryBootstrapsReader.refresh();
126 }
127
128 export function readDesktopSecondaryBootstraps(): ReadonlyArray<DesktopEnvironmentBootstrap> {
apps/web/src/connection/platform.ts
+1 -1
@@ -640,7 +640,7 @@ const layerPlatformConnectionSource = Layer.effect(
640 }
641 }
642
643 - const topologyRead = readDesktopSecondaryBootstrapsResult();
643 + const topologyRead = yield* Effect.promise(readDesktopSecondaryBootstrapsResult);
644 for (const [id, cached] of secondaryRegistrationsToRetainAfterTopologyRead(
645 previous,
646 topologyRead,
docs/internals/performance-regressions.md
+4 -1
@@ -98,7 +98,10 @@ viewport, including a small overscan region. Cached badges remain available whil
98 released. Local Git status reads skip divergence calculations; callers that need ahead/behind
99 counts keep the full status path. Cached fetch failures share the existing backoff and log only
100 the actual failed attempt. Unchanged desktop environment bootstrap reads retain their array
101 -identity so polling does not invalidate subscribers.
101 +identity so polling does not invalidate subscribers. The desktop preload keeps the synchronous
102 +startup snapshot, while topology polling refreshes it through asynchronous IPC. Recurring
103 +`sendSync` calls block the renderer behind unrelated main-process work, even when the returned
104 +snapshot is unchanged.
105
106 Local trace records and provider event logs use asynchronous, serialized file writes and rotation.
107 Batching synchronous appends still stalls the server event loop on slow storage, especially on
packages/contracts/src/ipc.ts
+2
@@ -1046,6 +1046,8 @@ export interface DesktopBridge {
1046 */
1047 getSystemLocale?: () => string | null;
1048 getLocalEnvironmentBootstraps: () => readonly DesktopEnvironmentBootstrap[];
1049 + /** Refresh the preload snapshot without blocking the renderer on synchronous IPC. */
1050 + readLocalEnvironmentBootstraps?: () => Promise<readonly DesktopEnvironmentBootstrap[]>;
1051 getLocalEnvironmentEnabled?: () => boolean;
1052 setLocalEnvironmentEnabled?: (enabled: boolean) => Promise<void>;
1053 getLocalEnvironmentBearerToken: () => Promise<string>;