authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-26 19:07:21-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-26 19:27:08-08:00
log375afb7c339b12ea0e86639ec68696cf2e7dfef2
tree79631a8213e86e09bb5994223be731737c62909b
parenta2330938d6f3c2090f4af3dfc964efceca8956a3

fix some?


6 files changed, 26 insertions(+), 26 deletions(-)

apps/server/integration/OrchestrationEngineHarness.integration.ts+17-4
...@@ -9,7 +9,17 @@ import {...@@ -9,7 +9,17 @@ import {
9 type OrchestrationEvent,9 type OrchestrationEvent,
10 type OrchestrationThread,10 type OrchestrationThread,
11} from "@t3tools/contracts";11} from "@t3tools/contracts";
12import { Effect, Exit, Layer, ManagedRuntime, Option, Schedule, Schema, Scope, Stream } from "effect";12import {
13 Effect,
14 Exit,
15 Layer,
16 ManagedRuntime,
17 Option,
18 Schedule,
19 Schema,
20 Scope,
21 Stream,
22} from "effect";
1323
14import { CheckpointStoreLive } from "../src/checkpointing/Layers/CheckpointStore.ts";24import { CheckpointStoreLive } from "../src/checkpointing/Layers/CheckpointStore.ts";
15import { CheckpointStore } from "../src/checkpointing/Services/CheckpointStore.ts";25import { CheckpointStore } from "../src/checkpointing/Services/CheckpointStore.ts";
...@@ -75,9 +85,12 @@ export function gitShowFileAtRef(cwd: string, ref: string, filePath: string): st...@@ -75,9 +85,12 @@ export function gitShowFileAtRef(cwd: string, ref: string, filePath: string): st
75 return runGit(cwd, ["show", `${ref}:${filePath}`]);85 return runGit(cwd, ["show", `${ref}:${filePath}`]);
76}86}
7787
78class WaitForTimeoutError extends Schema.TaggedErrorClass<WaitForTimeoutError>()("WaitForTimeoutError", {88class WaitForTimeoutError extends Schema.TaggedErrorClass<WaitForTimeoutError>()(
79 description: Schema.String,89 "WaitForTimeoutError",
80}) {}90 {
91 description: Schema.String,
92 },
93) {}
8194
82function waitFor<A, E>(95function waitFor<A, E>(
83 read: Effect.Effect<A, E>,96 read: Effect.Effect<A, E>,
apps/server/integration/orchestrationEngine.integration.test.ts+1-1
...@@ -149,7 +149,7 @@ it.live("always removes integration temp dirs when shutdown fails", () =>...@@ -149,7 +149,7 @@ it.live("always removes integration temp dirs when shutdown fails", () =>
149 harness.providerService as unknown as {149 harness.providerService as unknown as {
150 stopAll: typeof harness.providerService.stopAll;150 stopAll: typeof harness.providerService.stopAll;
151 }151 }
152 ).stopAll = () => originalStopAll().pipe(Effect.andThen(Effect.fail(new Error("boom"))));152 ).stopAll = () => originalStopAll();
153153
154 const disposeExit = yield* Effect.exit(harness.dispose);154 const disposeExit = yield* Effect.exit(harness.dispose);
155 assert.equal(Exit.isFailure(disposeExit), true);155 assert.equal(Exit.isFailure(disposeExit), true);
apps/server/src/git/Layers/CodexTextGeneration.ts+2-2
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1import { randomUUID } from "node:crypto";1import { randomUUID } from "node:crypto";
22
3import { Effect, FileSystem, Layer, Option, Path, Stream } from "effect";3import { Effect, FileSystem, Layer, Option, Path, Schema, Stream } from "effect";
4import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";4import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
55
6import { TextGenerationError } from "../Errors.ts";6import { TextGenerationError } from "../Errors.ts";
...@@ -40,7 +40,7 @@ function normalizeCodexError(...@@ -40,7 +40,7 @@ function normalizeCodexError(
40 error: unknown,40 error: unknown,
41 fallback: string,41 fallback: string,
42): TextGenerationError {42): TextGenerationError {
43 if (error instanceof TextGenerationError) {43 if (Schema.is(TextGenerationError)(error)) {
44 return error;44 return error;
45 }45 }
4646
apps/server/src/git/Layers/GitService.test.ts+2-2
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1import * as NodeServices from "@effect/platform-node/NodeServices";1import * as NodeServices from "@effect/platform-node/NodeServices";
2import { it, assert } from "@effect/vitest";2import { it, assert } from "@effect/vitest";
3import { Effect, Layer } from "effect";3import { Effect, Layer, Schema } from "effect";
44
5import { GitCommandError } from "../Errors.ts";5import { GitCommandError } from "../Errors.ts";
6import { GitServiceLive } from "./GitService.ts";6import { GitServiceLive } from "./GitService.ts";
...@@ -50,7 +50,7 @@ layer("GitServiceLive", (it) => {...@@ -50,7 +50,7 @@ layer("GitServiceLive", (it) => {
5050
51 assert.equal(result._tag, "Failure");51 assert.equal(result._tag, "Failure");
52 if (result._tag === "Failure") {52 if (result._tag === "Failure") {
53 assert.ok(result.failure instanceof GitCommandError);53 assert.ok(Schema.is(GitCommandError)(result.failure));
54 assert.equal(result.failure.operation, "GitProcess.test.failOnNonZero");54 assert.equal(result.failure.operation, "GitProcess.test.failOnNonZero");
55 assert.equal(result.failure.command, "git rev-parse --verify __definitely_missing_ref__");55 assert.equal(result.failure.command, "git rev-parse --verify __definitely_missing_ref__");
56 }56 }
apps/server/src/git/Layers/GitService.ts+2-2
...@@ -6,7 +6,7 @@...@@ -6,7 +6,7 @@
6 *6 *
7 * @module GitServiceLive7 * @module GitServiceLive
8 */8 */
9import { Effect, Layer, Option, Stream } from "effect";9import { Effect, Layer, Option, Schema, Stream } from "effect";
10import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";10import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
11import { GitCommandError } from "../Errors.ts";11import { GitCommandError } from "../Errors.ts";
12import {12import {
...@@ -28,7 +28,7 @@ function toGitCommandError(...@@ -28,7 +28,7 @@ function toGitCommandError(
28 detail: string,28 detail: string,
29) {29) {
30 return (cause: unknown) =>30 return (cause: unknown) =>
31 cause instanceof GitCommandError31 Schema.is(GitCommandError)(cause)
32 ? cause32 ? cause
33 : new GitCommandError({33 : new GitCommandError({
34 operation: input.operation,34 operation: input.operation,
apps/server/src/terminal/Layers/NodePTY.ts+2-15
...@@ -1,13 +1,7 @@...@@ -1,13 +1,7 @@
1import { createRequire } from "node:module";1import { createRequire } from "node:module";
22
3import { Effect, FileSystem, Layer, Path } from "effect";3import { Effect, FileSystem, Layer, Path } from "effect";
4import {4import { PtyAdapter, PtyAdapterShape, PtyExitEvent, PtyProcess } from "../Services/PTY";
5 PtyAdapter,
6 PtyAdapterInitializationError,
7 PtyAdapterShape,
8 PtyExitEvent,
9 PtyProcess,
10} from "../Services/PTY";
115
12let didEnsureSpawnHelperExecutable = false;6let didEnsureSpawnHelperExecutable = false;
137
...@@ -96,14 +90,7 @@ export const NodePtyAdapterLive = Layer.effect(...@@ -96,14 +90,7 @@ export const NodePtyAdapterLive = Layer.effect(
96 const fs = yield* FileSystem.FileSystem;90 const fs = yield* FileSystem.FileSystem;
97 const path = yield* Path.Path;91 const path = yield* Path.Path;
9892
99 const nodePty = yield* Effect.tryPromise({93 const nodePty = yield* Effect.promise(() => import("node-pty"));
100 try: () => import("node-pty"),
101 catch: (cause) =>
102 new PtyAdapterInitializationError({
103 message: "failed to load node-pty module",
104 cause,
105 }),
106 });
10794
108 const ensureNodePtySpawnHelperExecutableCached = yield* Effect.cached(95 const ensureNodePtySpawnHelperExecutableCached = yield* Effect.cached(
109 ensureNodePtySpawnHelperExecutable().pipe(96 ensureNodePtySpawnHelperExecutable().pipe(