@devries-cameron20 / t3code-1 / commits / 9ae08d550e
Fork 0

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

chore(lint): enforce catchToOrElseSucceed (#25084)

Julius Marminge committed Oct 25, 2026 at 18:18 UTC 9ae08d550ebc0ff789091fea6f529b006272da19
7 files changed +14 -13
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
+1 -1
@@ -2985,7 +2985,7 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
2985 }
2986 : null,
2987 ),
2988 - Effect.catch(() => Effect.succeed(null)),
2988 + Effect.orElseSucceed(() => null),
2989 Effect.flatMap((response) =>
2990 response === null
2991 ? client.raw
apps/server/src/preview/ServerBrowserStream.ts
+1 -1
@@ -206,7 +206,7 @@ const makeHandler = Effect.fnUntraced(function* (browser: ServerBrowser.ServerBr
206 Effect.as(HttpServerResponse.text("Service Unavailable", { status: 503 })),
207 ),
208 }),
209 - Effect.catch(() => Effect.succeed(HttpServerResponse.empty())),
209 + Effect.orElseSucceed(() => HttpServerResponse.empty()),
210 );
211 });
212
apps/server/src/workspace/WorkspaceFileSystem.ts
+1 -2
@@ -167,8 +167,7 @@ export const make = Effect.gen(function* () {
167 }
168 },
169 catch: () => undefined,
170 - // @effect-diagnostics-next-line effectSucceedWithVoid:off - This optional result requires undefined, not the wider void type.
171 - }).pipe(Effect.catch(() => Effect.succeed(undefined)));
170 + }).pipe(Effect.orElseSucceed(() => undefined));
171 }
172 return {
173 kind: "file",
packages/client-runtime/src/state/commandPermissions.ts
+1 -1
@@ -53,7 +53,7 @@ function makeCommandPermissions<R, E>(
53 suspendOnWaiting: false,
54 }).pipe(
55 Effect.timeoutOption(6_000),
56 - Effect.catch(() => Effect.succeed(Option.none<AuthSessionState>())),
56 + Effect.orElseSucceed(() => Option.none<AuthSessionState>()),
57 );
58 const missing = scopes.find(
59 (scope) => Option.isNone(session) || !sessionGrantsScope(session.value, scope),
packages/provider-cursor/src/server/accountUsage.ts
+8 -7
@@ -355,13 +355,14 @@ export const readCursorAccountUsage = Effect.fn("readCursorAccountUsage")(functi
355 duration: Duration.seconds(60),
356 orElse: () => invalid("Account usage read timed out"),
357 }),
358 - Effect.catch(() =>
359 - Effect.succeed({
360 - accountKey,
361 - records: [],
362 - missing: false,
363 - error: "Cursor account usage could not be read.",
364 - } satisfies CursorAccountUsageReadResult),
358 + Effect.orElseSucceed(
359 + () =>
360 + ({
361 + accountKey,
362 + records: [],
363 + missing: false,
364 + error: "Cursor account usage could not be read.",
365 + }) satisfies CursorAccountUsageReadResult,
366 ),
367 );
368 });
scripts/mobile-native-client.ts
+1 -1
@@ -448,7 +448,7 @@ const remoteCache = Effect.fn("nativeClient.remoteCache")(
448 ...login,
449 } satisfies RemoteCache;
450 },
451 - Effect.catch(() => Effect.succeed(null)),
451 + Effect.orElseSucceed(() => null),
452 );
453
454 const authorized = (remote: RemoteCache, request: HttpClientRequest.HttpClientRequest) =>
tsconfig.base.json
+1
@@ -24,6 +24,7 @@
24 "namespaceImportPackages": ["@effect/platform-node", "effect"],
25 "effectFn": ["span", "inferred-span", "suggested-span"],
26 "diagnosticSeverity": {
27 + "catchToOrElseSucceed": "error",
28 "unnecessaryFailYieldableError": "error",
29 "preferSucceedSomeOrNone": "error",
30 "effectSucceedWithVoid": "error",