Skip to content

Commit 9d0d94c

Browse files
Shawclaude
andcommitted
fix(app-core): defer android auto-pick effect + restore TS6 ignoreDeprecations
The Android runtime auto-pick useEffect in RuntimeGate was placed before showLocalOption and finishAsLocal were declared, tripping TS2448/TS2454 ("variable used before declaration"). Move the effect to after the relevant useCallback/useState declarations and replace the eslint-disable with a proper dependency array. Also bump app-core/tsconfig.json + ui/tsconfig.json ignoreDeprecations back to "6.0" — a recent WIP commit regressed it to "5.0", which fails typecheck under TS 6.x with TS5101 on the still-required baseUrl option. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 39be1ec commit 9d0d94c

3 files changed

Lines changed: 17 additions & 19 deletions

File tree

packages/app-core/src/components/shell/RuntimeGate.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -263,25 +263,9 @@ export function RuntimeGate() {
263263
};
264264
}, [isDesktop, isDev, synchronousLocal]);
265265

266-
// Auto-pick the on-device agent on Android when (a) the probe shows the
267-
// agent is up and (b) the user hasn't already chosen a runtime. The
268-
// RuntimeGate then never renders — the user lands directly in chat. If
269-
// they later want a different agent (cloud / remote), the Settings ▸
270-
// Runtime view re-opens this picker. The auto-pick is intentionally one
271-
// shot: once the mode is persisted any subsequent launch reads it
272-
// directly from storage and skips this path.
273-
useEffect(() => {
274-
if (!isAndroid) return;
275-
if (!showLocalOption) return;
276-
if (readPersistedMobileRuntimeMode() != null) return;
277-
finishAsLocal();
278-
// intentionally only triggers once — finishAsLocal persists the mode
279-
// and dispatches SPLASH_CONTINUE; a second invocation is a no-op.
280-
// eslint-disable-next-line react-hooks/exhaustive-deps
281-
}, [showLocalOption]);
282-
283266
const showLocalOption = localProbeResult === true;
284267
const localProbePending = localProbeResult === null;
268+
285269
const runtimeChoices = useMemo(
286270
() =>
287271
resolveRuntimeChoices({
@@ -400,6 +384,20 @@ export function RuntimeGate() {
400384
completeOnboarding();
401385
}, [completeOnboarding, setState, startupCoordinator]);
402386

387+
// Auto-pick the on-device agent on Android when (a) the probe shows the
388+
// agent is up and (b) the user hasn't already chosen a runtime. The
389+
// RuntimeGate then never renders — the user lands directly in chat. If
390+
// they later want a different agent (cloud / remote), the Settings ▸
391+
// Runtime view re-opens this picker. The auto-pick is intentionally one
392+
// shot: once the mode is persisted any subsequent launch reads it
393+
// directly from storage and skips this path.
394+
useEffect(() => {
395+
if (!isAndroid) return;
396+
if (!showLocalOption) return;
397+
if (readPersistedMobileRuntimeMode() != null) return;
398+
finishAsLocal();
399+
}, [finishAsLocal, showLocalOption]);
400+
403401
const finishAsRemoteGateway = useCallback(
404402
(gateway: GatewayDiscoveryEndpoint) => {
405403
const apiBase = gatewayEndpointToApiBase(gateway);

packages/app-core/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"declaration": false,
2121
"noEmit": true,
2222
"baseUrl": "../../",
23-
"ignoreDeprecations": "5.0",
23+
"ignoreDeprecations": "6.0",
2424
"paths": {
2525
"@elizaos/app-lifeops": ["./apps/app-lifeops/src/index.ts"],
2626
"@elizaos/app-lifeops/*": ["./apps/app-lifeops/src/*"],

packages/ui/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"declaration": false,
1212
"noEmit": true,
1313
"baseUrl": "../../",
14-
"ignoreDeprecations": "5.0",
14+
"ignoreDeprecations": "6.0",
1515
"paths": {
1616
"@elizaos/app-lifeops": ["./apps/app-lifeops/src/index.ts"],
1717
"@elizaos/app-lifeops/*": ["./apps/app-lifeops/src/*"],

0 commit comments

Comments
 (0)