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 23, 06:45 UTC
perf(web): useOrchestrationCommand compiles without manual memoization (#20576)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 22:05 UTC
dd1ab3f059f16cc46b59c5620bd2df706df2e4f8
1 file changed
+13
-17
apps/web/src/state/use-orchestration-command.ts
+13
-17
@@ -10,7 +10,6 @@ import {
10
} from "@t3tools/contracts";
11
import * as Cause from "effect/Cause";
12
import { AsyncResult } from "effect/reactivity";
13
-import { useCallback } from "react";
13
14
import { readEnvironmentScope } from "./session";
15
import { useAtomCommand } from "./use-atom-command";
@@ -23,20 +22,17 @@ export function useOrchestrationCommand<W extends { readonly environmentId: Envi
22
options?: string | AtomCommandOptions,
23
): (value: W) => Promise<AtomCommandResult<A, E | EnvironmentAuthorizationError>> {
24
const run = useAtomCommand(command, options);
26
- return useCallback(
27
- async (value: W): Promise<AtomCommandResult<A, E | EnvironmentAuthorizationError>> => {
28
- if (!readEnvironmentScope(value.environmentId, AuthOrchestrationOperateScope)) {
29
- return AsyncResult.failure(
30
- Cause.fail(
31
- new EnvironmentAuthorizationError({
32
- requiredScope: AuthOrchestrationOperateScope,
33
- message: ORCHESTRATION_OPERATE_DENIED_MESSAGE,
34
- }),
35
- ),
36
- );
37
- }
38
- return run(value);
39
- },
40
- [run],
41
- );
25
+ return async (value: W): Promise<AtomCommandResult<A, E | EnvironmentAuthorizationError>> => {
26
+ if (!readEnvironmentScope(value.environmentId, AuthOrchestrationOperateScope)) {
27
+ return AsyncResult.failure(
28
+ Cause.fail(
29
+ new EnvironmentAuthorizationError({
30
+ requiredScope: AuthOrchestrationOperateScope,
31
+ message: ORCHESTRATION_OPERATE_DENIED_MESSAGE,
32
+ }),
33
+ ),
34
+ );
35
+ }
36
+ return run(value);
37
+ };
38
}