@devries-cameron20 / t3code-1 / commits / f89855713d
Fork 0

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

chore(lint): enforce unnecessaryPipeChain (#25077)

Julius Marminge committed Oct 25, 2026 at 16:48 UTC f89855713db6184f18ada149a4964e7539be1f5d
6 files changed +63 -68
apps/server/scripts/acp-mock-agent.ts
+14 -15
@@ -937,21 +937,20 @@ const program = Effect.gen(function* () {
937 },
938 });
939 });
940 - yield* Effect.sleep("1200 millis")
941 - .pipe(
942 - Effect.andThen(
943 - Effect.sync(() => {
944 - writeJsonRpcNotification("_x.ai/task_completed", {
945 - sessionId: cancelledSessionId,
946 - update: {
947 - sessionUpdate: "task_completed",
948 - task_snapshot: { task_id: "task-bg-1", command: "sleep 30" },
949 - },
950 - });
951 - }),
952 - ),
953 - )
954 - .pipe(Effect.forkDetach);
940 + yield* Effect.sleep("1200 millis").pipe(
941 + Effect.andThen(
942 + Effect.sync(() => {
943 + writeJsonRpcNotification("_x.ai/task_completed", {
944 + sessionId: cancelledSessionId,
945 + update: {
946 + sessionUpdate: "task_completed",
947 + task_snapshot: { task_id: "task-bg-1", command: "sleep 30" },
948 + },
949 + });
950 + }),
951 + ),
952 + Effect.forkDetach,
953 + );
954 }
955 }),
956 );
apps/server/src/mcp/toolkits/pullRequests/handlers.ts
+4 -4
@@ -220,10 +220,10 @@ const make = Effect.gen(function* () {
220 if (threadId === undefined) {
221 return yield* new PullRequestThreadRequiredError();
222 }
223 - const thread = yield* engine
224 - .getThreadShell(threadId)
225 - .pipe(Effect.map(Option.fromNullishOr))
226 - .pipe(Effect.mapError((cause) => new Failure({ cause })));
223 + const thread = yield* engine.getThreadShell(threadId).pipe(
224 + Effect.map(Option.fromNullishOr),
225 + Effect.mapError((cause) => new Failure({ cause })),
226 + );
227 if (Option.isNone(thread) || thread.value.deletedAt !== null) {
228 return yield* new PullRequestThreadNotFoundError({ threadId });
229 }
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+5 -6
@@ -1359,12 +1359,11 @@ describe("ClaudeAdapterV2 resume compaction", () => {
1359 assert.equal(planEvent.value.plan.markdown, longPlan.trim());
1360 }
1361 }
1362 - const requestEvent = yield* runtime.events
1363 - .pipe(
1364 - Stream.filter((event) => event.type === "runtime_request.updated"),
1365 - Stream.runHead,
1366 - )
1367 - .pipe(Effect.forkScoped);
1362 + const requestEvent = yield* runtime.events.pipe(
1363 + Stream.filter((event) => event.type === "runtime_request.updated"),
1364 + Stream.runHead,
1365 + Effect.forkScoped,
1366 + );
1367 const controller = new AbortController();
1368 const dialog = yield* Effect.promise(() =>
1369 callback!(
apps/server/src/orchestration-v2/ThreadManagementService.ts
+21 -22
@@ -724,28 +724,27 @@ const make = Effect.gen(function* () {
724 fields,
725 filter,
726 ) =>
727 - ensureProjectionTranscript(input.threadId)
728 - .pipe(Effect.andThen(orchestrator.getThreadRecords(input.threadId, fields, filter)))
729 - .pipe(
730 - Effect.mapError(
731 - (cause) =>
732 - new ThreadManagementProjectionLoadError({
733 - projectId: input.projectId,
734 - threadId: input.threadId,
735 - cause,
736 - }),
737 - ),
738 - Effect.flatMap((projection) =>
739 - projection.thread.projectId === input.projectId && projection.thread.deletedAt === null
740 - ? Effect.succeed(projection)
741 - : Effect.fail(
742 - new ThreadManagementThreadNotFoundError({
743 - projectId: input.projectId,
744 - threadId: input.threadId,
745 - }),
746 - ),
747 - ),
748 - );
727 + ensureProjectionTranscript(input.threadId).pipe(
728 + Effect.andThen(orchestrator.getThreadRecords(input.threadId, fields, filter)),
729 + Effect.mapError(
730 + (cause) =>
731 + new ThreadManagementProjectionLoadError({
732 + projectId: input.projectId,
733 + threadId: input.threadId,
734 + cause,
735 + }),
736 + ),
737 + Effect.flatMap((projection) =>
738 + projection.thread.projectId === input.projectId && projection.thread.deletedAt === null
739 + ? Effect.succeed(projection)
740 + : Effect.fail(
741 + new ThreadManagementThreadNotFoundError({
742 + projectId: input.projectId,
743 + threadId: input.threadId,
744 + }),
745 + ),
746 + ),
747 + );
748
749 const listProjectThreads: ThreadManagementServiceShape["listProjectThreads"] = (input) =>
750 orchestrator.getShellSnapshot({ projectId: input.projectId, location: "active" }).pipe(
apps/server/src/usage/UsageService.ts
+18 -21
@@ -623,30 +623,27 @@ export const make = Effect.gen(function* () {
623 const scans = Effect.forEach(
624 scanReaders,
625 ({ driver, reader }) =>
626 - usageInstances(driver, settings)
627 - .pipe(
628 - Effect.flatMap((instances) =>
629 - reader.scan({ instances, settings, windowStartMs, retentionCutoffMs, awaitRefresh }),
630 - ),
631 - )
632 - .pipe(
633 - Effect.flatMap((sources) =>
634 - Effect.forEach(sources, ({ volumeId, ...source }) =>
635 - Effect.map(
636 - volumeId === undefined
637 - ? Effect.promise(() => readDirectoryVolumeId(source.dir))
638 - : Effect.succeed(volumeId),
639 - (resolved): ScannedDir => ({
640 - ...source,
641 - files: source.files?.map((file) => ({ ...file, malformedRecords: 0 })) ?? null,
642 - provider: reader.provider,
643 - volumeId: resolved,
644 - }),
645 - ),
626 + usageInstances(driver, settings).pipe(
627 + Effect.flatMap((instances) =>
628 + reader.scan({ instances, settings, windowStartMs, retentionCutoffMs, awaitRefresh }),
629 + ),
630 + Effect.flatMap((sources) =>
631 + Effect.forEach(sources, ({ volumeId, ...source }) =>
632 + Effect.map(
633 + volumeId === undefined
634 + ? Effect.promise(() => readDirectoryVolumeId(source.dir))
635 + : Effect.succeed(volumeId),
636 + (resolved): ScannedDir => ({
637 + ...source,
638 + files: source.files?.map((file) => ({ ...file, malformedRecords: 0 })) ?? null,
639 + provider: reader.provider,
640 + volumeId: resolved,
641 + }),
642 ),
643 ),
648 - Effect.provideContext(readerContext),
644 ),
645 + Effect.provideContext(readerContext),
646 + ),
647 { concurrency: "unbounded" },
648 );
649
tsconfig.base.json
+1
@@ -24,6 +24,7 @@
24 "namespaceImportPackages": ["@effect/platform-node", "effect"],
25 "effectFn": ["span", "inferred-span", "suggested-span"],
26 "diagnosticSeverity": {
27 + "unnecessaryPipeChain": "error",
28 "effectFnOpportunity": "suggestion",
29 "anyUnknownInErrorContext": "error",
30 "unsafeEffectTypeAssertion": "error",