Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopClerk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ it.effect(
}),
} as unknown as ElectronApp.ElectronApp["Service"];
const electronWindow = {
currentMainOrFirst: Effect.succeed(Option.some(window)),
currentMainOrFirst: Effect.succeedSome(window),
reveal: () => Effect.sync(() => revealed.resolve()),
} as unknown as ElectronWindow.ElectronWindow["Service"];
return Effect.gen(function* () {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopWebLinks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const makeWindow = () => {
Layer.succeed(
ElectronWindow.ElectronWindow,
ElectronWindow.ElectronWindow.of({
currentMainOrFirst: Effect.succeed(Option.some(window)),
currentMainOrFirst: Effect.succeedSome(window),
reveal: (target: Electron.BrowserWindow) => Effect.sync(() => void revealed.push(target)),
} as unknown as ElectronWindow.ElectronWindow["Service"]),
),
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/cloud/CloudLink.lifecycle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe("releaseManagedTunnelOnShutdown", () => {
ConnectReachability.ConnectReachability,
ConnectReachability.ConnectReachability.of({
check: Effect.die("unused"),
latest: Effect.succeed(Option.none()),
latest: Effect.succeedNone,
}),
),
Effect.provideService(HttpServer.HttpServer, {
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/cloud/CloudLink.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const withService = <A, E>(
Layer.mock(AgentAwarenessRelay.AgentAwarenessRelay)({ requestCatchUp: () => Effect.void }),
Layer.mock(ManagedEndpointRuntime.CloudManagedEndpointRuntime)({}),
Layer.mock(ConnectReachability.ConnectReachability)({
latest: Effect.succeed(Option.none()),
latest: Effect.succeedNone,
}),
Layer.mock(EnvironmentAuth.EnvironmentAuth)({}),
Layer.mock(CliTokenManager.CloudCliTokenManager)({}),
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/cloud/http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const layerLinkProofRoutes = HttpApiBuilder.layer(LinkProofTestApi).pipe(
Layer.provide(AuthHttp.layerAuthenticatedAuth),
Layer.provide(CloudLink.layer),
Layer.provide(
Layer.mock(ConnectReachability.ConnectReachability)({ latest: Effect.succeed(Option.none()) }),
Layer.mock(ConnectReachability.ConnectReachability)({ latest: Effect.succeedNone }),
),
Layer.provide(EnvironmentAuth.layer),
Layer.provide([
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpDeviceToolkit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const readiness = {
agentDevice: null,
};
const layerProjectsMock = Layer.mock(ProjectService.ProjectService)({
getById: () => Effect.succeed(Option.none()),
getById: () => Effect.succeedNone,
});

const layerDeviceServiceMock = Layer.mock(DeviceService.DeviceService)({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ it.effect.each([
IdAllocator.layer,
Layer.mock(GitWorkflowService.GitWorkflowService)({}),
Layer.mock(ProjectStore.ProjectStoreV2)({
get: () => Effect.succeed(Option.some({ workspaceRoot: parent } as never)),
get: () => Effect.succeedSome({ workspaceRoot: parent } as never),
}),
Layer.mock(ProjectionStoreV2)({
getThread: () => Effect.succeed(projection.thread),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ it.effect.each([
Layer.mock(ProjectStore.ProjectStoreV2)({
get: (id) => {
assert.equal(id, projectId);
return Effect.succeed(Option.some({ workspaceRoot } as never));
return Effect.succeedSome({ workspaceRoot } as never);
},
}),
Layer.mock(GitWorkflow.GitWorkflowService)({
Expand Down
6 changes: 3 additions & 3 deletions apps/server/src/orchestration-v2/CommandReceiptStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ const layerBase: Layer.Layer<
receipts.getByCommandId({ commandId }).pipe(
Effect.flatMap(
Option.match({
onNone: () => Effect.succeed(Option.none()),
onNone: () => Effect.succeedNone,
onSome: (receipt) =>
receipt.aggregateKind !== "thread"
? Effect.succeed(Option.none())
? Effect.succeedNone
: fromApplicationReceipt(receipt).pipe(Effect.asSome),
}),
),
Expand All @@ -180,7 +180,7 @@ const layerBase: Layer.Layer<
receipts.getByCommandId({ commandId }).pipe(
Effect.flatMap((receipt) =>
Option.isNone(receipt) || receipt.value.aggregateKind !== "project"
? Effect.succeed(Option.none())
? Effect.succeedNone
: decodeProjectReceipt({
commandId: receipt.value.commandId,
projectId: receipt.value.aggregateId,
Expand Down
4 changes: 1 addition & 3 deletions apps/server/src/orchestration-v2/EffectOutbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,7 @@ export const layer: Layer.Layer<EffectOutboxV2, never, SqlClient.SqlClient> = La
NodeSqliteClient.readOnly,
Effect.flatMap((rows) => {
const row = rows[0];
return row === undefined
? Effect.succeed(Option.none())
: rowToEffect(row).pipe(Effect.asSome);
return row === undefined ? Effect.succeedNone : rowToEffect(row).pipe(Effect.asSome);
}),
Effect.mapError((cause) => new EffectOutboxError({ operation: "get", effectId, cause })),
),
Expand Down
10 changes: 5 additions & 5 deletions apps/server/src/orchestration-v2/EffectWorker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function layerExecutorFor(input: {
ProviderSessionManager.ProviderSessionManagerV2.of({
shutdown: Effect.void,
open: () => Effect.die("unused open"),
get: () => Effect.succeed(Option.none()),
get: () => Effect.succeedNone,
isLive: () => Effect.succeed(false),
close: () => Effect.void,
closeInstance: () => Effect.void,
Expand Down Expand Up @@ -339,7 +339,7 @@ it.effect("requeues a claim when a pre-execution worker check fails", () =>
>([]);
const executionCount = yield* Ref.make(0);
const layerOutbox = Layer.mock(EffectOutbox.EffectOutboxV2)({
claimNext: () => Effect.succeed(Option.some(claimedEffect)),
claimNext: () => Effect.succeedSome(claimedEffect),
get: () =>
Effect.fail(
new EffectOutbox.EffectOutboxError({
Expand Down Expand Up @@ -406,7 +406,7 @@ it.effect("arms cancellation before the durable pre-execution check", () =>
const executionCount = yield* Ref.make(0);
const settlementCount = yield* Ref.make(0);
const layerOutbox = Layer.mock(EffectOutbox.EffectOutboxV2)({
claimNext: () => Effect.succeed(Option.some(claimedEffect)),
claimNext: () => Effect.succeedSome(claimedEffect),
awaitCancellation: () => {
cancellationArmed = true;
return Deferred.await(signal);
Expand Down Expand Up @@ -473,8 +473,8 @@ it.effect("terminalizes a process-bound claim when success settlement fails", ()
const terminalErrors = yield* Ref.make<ReadonlyArray<string>>([]);
const executionCount = yield* Ref.make(0);
const layerOutbox = Layer.mock(EffectOutbox.EffectOutboxV2)({
claimNext: () => Effect.succeed(Option.some(claimedEffect)),
get: () => Effect.succeed(Option.some(claimedEffect)),
claimNext: () => Effect.succeedSome(claimedEffect),
get: () => Effect.succeedSome(claimedEffect),
awaitCancellation: () => Effect.never,
clearCancellation: () => Effect.void,
succeed: () =>
Expand Down
22 changes: 10 additions & 12 deletions apps/server/src/orchestration-v2/FoundationPersistence.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1960,17 +1960,15 @@ it.layer(layerTest)("orchestration V2 foundation persistence", (it) => {
};
const executionCount = yield* Ref.make(0);
const layerOutbox = Layer.mock(EffectOutbox.EffectOutboxV2)({
claimNext: () => Effect.succeed(Option.some(claimedEffect)),
claimNext: () => Effect.succeedSome(claimedEffect),
get: () =>
Effect.succeed(
Option.some({
...claimedEffect,
status: "cancelled" as const,
leaseOwner: null,
leaseExpiresAt: null,
completedAt: now,
}),
),
Effect.succeedSome({
...claimedEffect,
status: "cancelled" as const,
leaseOwner: null,
leaseExpiresAt: null,
completedAt: now,
}),
clearCancellation: () => Effect.void,
awaitCancellation: () => Effect.never,
});
Expand Down Expand Up @@ -2832,7 +2830,7 @@ it.layer(layerTest)("orchestration V2 foundation persistence", (it) => {
awaitWork: Effect.void,
runRecoveryOnce: Effect.succeed(false),
runOnce: Effect.succeed(false),
nextClaimableAt: Effect.succeed(Option.none()),
nextClaimableAt: Effect.succeedNone,
drain: () => Effect.succeed(0),
}),
),
Expand Down Expand Up @@ -3049,7 +3047,7 @@ it.layer(layerTest)("orchestration V2 foundation persistence", (it) => {
awaitWork: Effect.void,
runRecoveryOnce: Effect.succeed(false),
runOnce: Effect.succeed(false),
nextClaimableAt: Effect.succeed(Option.none()),
nextClaimableAt: Effect.succeedNone,
drain: () => Effect.succeed(0),
}),
),
Expand Down
37 changes: 20 additions & 17 deletions apps/server/src/orchestration-v2/ProjectionControlReads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,23 +276,26 @@ it.effect.each(storageCases)(
const calls: string[] = [];
const layerSessions = Layer.mock(ProviderSessionManager.ProviderSessionManagerV2)({
get: () =>
Effect.succeed(
Option.some({
interruptTurn: () =>
Effect.sync(() => {
calls.push("interrupt");
}),
steerTurn: (input: { message: { text: string }; runId: RunId }) =>
Effect.sync(() => {
assert.equal(input.runId, runId);
calls.push(input.message.text);
}),
respondToRuntimeRequest: () =>
Effect.sync(() => {
calls.push("reply");
}),
} as never),
),
Effect.succeedSome({
interruptTurn: () =>
Effect.sync(() => {
calls.push("interrupt");
}),
steerTurn: (input: {
message: {
text: string;
};
runId: RunId;
}) =>
Effect.sync(() => {
assert.equal(input.runId, runId);
calls.push(input.message.text);
}),
respondToRuntimeRequest: () =>
Effect.sync(() => {
calls.push("reply");
}),
} as never),
});
yield* Effect.gen(function* () {
const control = yield* ProviderTurnControlService.ProviderTurnControlServiceV2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ it.effect(
Effect.flatMap((hold) =>
hold
? Deferred.succeed(projectReadHeld, undefined).pipe(Effect.andThen(Effect.never))
: Effect.succeed(Option.some(makeBrowserAccessProject(requestedProjectId))),
: Effect.succeedSome(makeBrowserAccessProject(requestedProjectId)),
),
),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ function startWithMissingWorktree(
Layer.mock(GitWorkflow.GitWorkflowService)({ pruneWorktrees, createWorktree }),
Layer.mock(ProjectService.ProjectService)({
getById: () =>
Effect.succeed(
Option.some({ workspaceRoot: "/tmp/provider-turn-start-project" } as never),
),
Effect.succeedSome({ workspaceRoot: "/tmp/provider-turn-start-project" } as never),
}),
Layer.mock(ProjectionStore.ProjectionStoreV2)({
getThreadRecords: () => {
Expand Down Expand Up @@ -698,7 +696,7 @@ function makeLocalCommandHarness(input: {
}),
Layer.mock(ProjectService.ProjectService)({
getById: () =>
Effect.succeed(Option.some({ workspaceRoot: "/tmp/native-account-project" } as never)),
Effect.succeedSome({ workspaceRoot: "/tmp/native-account-project" } as never),
}),
Layer.mock(ProjectionStore.ProjectionStoreV2)({
getThreadRecords,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export const layer = Layer.merge(
createWorktree: () => Effect.succeed({} as never),
}),
Layer.mock(ProjectService.ProjectService)({
getById: () => Effect.succeed(Option.none()),
getById: () => Effect.succeedNone,
}),
);
30 changes: 14 additions & 16 deletions apps/server/src/orchestration-v2/RuntimePolicy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,20 @@ const layerTest = RuntimePolicy.layerFromProjectStore.pipe(
Layer.provide(
Layer.mock(ProjectStore.ProjectStoreV2)({
get: () =>
Effect.succeed(
Option.some({
projectId,
title: "Project",
workspaceRoot: "/project-root",
defaultModelSelection: null,
defaultThreadEnvMode: null,
autoPull: false,
faviconPath: null,
projectIcon: null,
scripts: [],
createdAt: "2026-06-21T00:00:00.000Z",
updatedAt: "2026-06-21T00:00:00.000Z",
deletedAt: null,
}),
),
Effect.succeedSome({
projectId,
title: "Project",
workspaceRoot: "/project-root",
defaultModelSelection: null,
defaultThreadEnvMode: null,
autoPull: false,
faviconPath: null,
projectIcon: null,
scripts: [],
createdAt: "2026-06-21T00:00:00.000Z",
updatedAt: "2026-06-21T00:00:00.000Z",
deletedAt: null,
}),
}),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ it.effect.each(["expired", "resolved"] as const)(
(_input: ProviderAdapter.ProviderAdapterV2RuntimeRequestResponseInput) => Effect.void,
);
const getSession = vi.fn(() =>
Effect.succeed(
Option.some({
respondToRuntimeRequest,
} as never),
),
Effect.succeedSome({
respondToRuntimeRequest,
} as never),
);
const projection = {
runtimeRequests: [
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/orchestration-v2/ThreadLaunchService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function makeHarness(options: HarnessOptions = {}) {
? Option.some(otherProject)
: Option.none(),
),
getByWorkspaceRoot: () => Effect.succeed(Option.some(project)),
getByWorkspaceRoot: () => Effect.succeedSome(project),
snapshot: Effect.die("unused"),
getShell: () => Effect.die("unused"),
listShells: () => Effect.die("unused"),
Expand Down Expand Up @@ -217,7 +217,7 @@ function makeHarness(options: HarnessOptions = {}) {
Layer.mock(ManagedProjectFolders.ManagedProjectFolders)({
namedProjectsRoot: "/projects",
isScratchProject: () => Effect.succeed(false),
folderForThread: () => Effect.succeed(Option.none()),
folderForThread: () => Effect.succeedNone,
}),
);
const layerLaunch = ThreadLaunch.layer.pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe("ThreadPullRequestServiceV2 reads", () => {
}),
Layer.mock(ProjectStore.ProjectStoreV2)({
listShells: () => Effect.succeed([project]),
getShell: () => Effect.succeed(Option.some(project)),
getShell: () => Effect.succeedSome(project),
}),
Layer.mock(GitManager.GitManager)({
branchPullRequest: (_input, options) =>
Expand Down Expand Up @@ -234,7 +234,7 @@ describe("ThreadPullRequestServiceV2 reads", () => {
}),
Layer.mock(ProjectStore.ProjectStoreV2)({
listShells: () => Effect.succeed([project]),
getShell: () => Effect.succeed(Option.some(project)),
getShell: () => Effect.succeedSome(project),
}),
Layer.mock(GitManager.GitManager)({
branchPullRequest: () => Effect.succeed(null),
Expand Down
14 changes: 6 additions & 8 deletions apps/server/src/orchestration-v2/runtimeLayer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const layerGitWorkflowTest = Layer.mock(GitWorkflow.GitWorkflowService)({
createWorktree: () => Effect.succeed({} as never),
});
const layerProjectServiceTest = Layer.mock(ProjectService.ProjectService)({
getById: () => Effect.succeed(Option.none()),
getById: () => Effect.succeedNone,
});

const driver = ProviderDriverKind.make("codex");
Expand Down Expand Up @@ -991,13 +991,11 @@ it.layer(layerTest)("OrchestrationV2LayerLive", (it) => {
},
],
});
const sessionSpy = vi
.spyOn(sessions, "get")
.mockReturnValue(
Effect.succeed(
Option.some({ providerSession } as ProviderAdapter.ProviderAdapterV2SessionRuntime),
),
);
const sessionSpy = vi.spyOn(sessions, "get").mockReturnValue(
Effect.succeedSome({
providerSession,
} as ProviderAdapter.ProviderAdapterV2SessionRuntime),
);
yield* Effect.addFinalizer(() => Effect.sync(() => sessionSpy.mockRestore()));

const steerCommandId = CommandId.make("runtime-delivery-intent-auto");
Expand Down
Loading
Loading