@devries-cameron20 / t3code Mirror · read-only / commits / 87abc22f39
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 25, 10:00 UTC

unnecessary catch

Julius Marminge committed Feb 27, 2026 at 09:18 UTC 87abc22f39afcae72ab4a16e3b65c2be427ec851
1 file changed +25 -25
apps/server/src/provider/Layers/ClaudeCodeAdapter.ts
+25 -25
@@ -28,10 +28,7 @@ import {
28 type ProviderAdapterError,
29 } from "../Errors.ts";
30 import { type ProviderThreadSnapshot } from "../Services/ProviderAdapter.ts";
31 -import {
32 - ClaudeCodeAdapter,
33 - type ClaudeCodeAdapterShape,
34 -} from "../Services/ClaudeCodeAdapter.ts";
31 +import { ClaudeCodeAdapter, type ClaudeCodeAdapterShape } from "../Services/ClaudeCodeAdapter.ts";
32
33 const PROVIDER = "claudeCode" as const;
34
@@ -188,10 +185,7 @@ const makeClaudeCodeAdapter = (options?: ClaudeCodeAdapterLiveOptions) =>
185 }
186 return makeUnavailableRuntime();
187 }),
191 - (runtime) =>
192 - runtime.stopAll().pipe(
193 - Effect.orElseSucceed(() => undefined),
194 - ),
188 + (runtime) => runtime.stopAll(),
189 );
190
191 const startSession: ClaudeCodeAdapterShape["startSession"] = (input) => {
@@ -219,19 +213,19 @@ const makeClaudeCodeAdapter = (options?: ClaudeCodeAdapterLiveOptions) =>
213 };
214
215 const sendTurn: ClaudeCodeAdapterShape["sendTurn"] = (input) =>
222 - runtime.sendTurn(input).pipe(
223 - Effect.mapError((cause) => toRequestError(input.sessionId, "turn/start", cause)),
224 - );
216 + runtime
217 + .sendTurn(input)
218 + .pipe(Effect.mapError((cause) => toRequestError(input.sessionId, "turn/start", cause)));
219
220 const interruptTurn: ClaudeCodeAdapterShape["interruptTurn"] = (sessionId, turnId) =>
227 - runtime.interruptTurn(sessionId, turnId).pipe(
228 - Effect.mapError((cause) => toRequestError(sessionId, "turn/interrupt", cause)),
229 - );
221 + runtime
222 + .interruptTurn(sessionId, turnId)
223 + .pipe(Effect.mapError((cause) => toRequestError(sessionId, "turn/interrupt", cause)));
224
225 const readThread: ClaudeCodeAdapterShape["readThread"] = (sessionId) =>
232 - runtime.readThread(sessionId).pipe(
233 - Effect.mapError((cause) => toRequestError(sessionId, "thread/read", cause)),
234 - );
226 + runtime
227 + .readThread(sessionId)
228 + .pipe(Effect.mapError((cause) => toRequestError(sessionId, "thread/read", cause)));
229
230 const rollbackThread: ClaudeCodeAdapterShape["rollbackThread"] = (sessionId, numTurns) => {
231 if (!Number.isInteger(numTurns) || numTurns < 1) {
@@ -244,9 +238,9 @@ const makeClaudeCodeAdapter = (options?: ClaudeCodeAdapterLiveOptions) =>
238 );
239 }
240
247 - return runtime.rollbackThread(sessionId, numTurns).pipe(
248 - Effect.mapError((cause) => toRequestError(sessionId, "thread/rollback", cause)),
249 - );
241 + return runtime
242 + .rollbackThread(sessionId, numTurns)
243 + .pipe(Effect.mapError((cause) => toRequestError(sessionId, "thread/rollback", cause)));
244 };
245
246 const respondToRequest: ClaudeCodeAdapterShape["respondToRequest"] = (
@@ -254,15 +248,21 @@ const makeClaudeCodeAdapter = (options?: ClaudeCodeAdapterLiveOptions) =>
248 requestId,
249 decision,
250 ) =>
257 - runtime.respondToRequest(sessionId, requestId, decision).pipe(
258 - Effect.mapError((cause) => toRequestError(sessionId, "item/requestApproval/decision", cause)),
259 - );
251 + runtime
252 + .respondToRequest(sessionId, requestId, decision)
253 + .pipe(
254 + Effect.mapError((cause) =>
255 + toRequestError(sessionId, "item/requestApproval/decision", cause),
256 + ),
257 + );
258
261 - const stopSession: ClaudeCodeAdapterShape["stopSession"] = (sessionId) => runtime.stopSession(sessionId);
259 + const stopSession: ClaudeCodeAdapterShape["stopSession"] = (sessionId) =>
260 + runtime.stopSession(sessionId);
261
262 const listSessions: ClaudeCodeAdapterShape["listSessions"] = () => runtime.listSessions();
263
265 - const hasSession: ClaudeCodeAdapterShape["hasSession"] = (sessionId) => runtime.hasSession(sessionId);
264 + const hasSession: ClaudeCodeAdapterShape["hasSession"] = (sessionId) =>
265 + runtime.hasSession(sessionId);
266
267 const stopAll: ClaudeCodeAdapterShape["stopAll"] = () => runtime.stopAll();
268