The best way to control Claude Code, Codex and more from any computer or phone
perf(web): the primary session state hook compiles without manual memoization (#20581)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 22:04 UTC
6f68d6d7d50054530819b2b84323d75faf6bc9f2
1 file changed
+1
-5
apps/web/src/environments/primary/sessionState.ts
+1
-5
@@ -3,7 +3,6 @@ import * as Cause from "effect/Cause";
3
import * as Effect from "effect/Effect";
4
import * as Option from "effect/Option";
5
import { AsyncResult, Atom } from "effect/reactivity";
6
-import { useCallback } from "react";
6
7
import { isLocalEnvironmentDisabled } from "../../localEnvironment";
8
import { appAtomRegistry } from "../../rpc/atomRegistry";
@@ -25,9 +24,6 @@ function refreshPrimarySessionState(): void {
24
25
export function usePrimarySessionState() {
26
const result = useAtomValue(primarySessionStateAtom);
28
- const refresh = useCallback(() => {
29
- refreshPrimarySessionState();
30
- }, []);
27
let error: string | null = null;
28
if (result._tag === "Failure") {
29
const cause = Cause.squash(result.cause);
@@ -37,6 +33,6 @@ export function usePrimarySessionState() {
33
data: Option.getOrNull(AsyncResult.value(result)),
34
error,
35
isPending: result.waiting,
40
- refresh,
36
+ refresh: refreshPrimarySessionState,
37
};
38
}