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
53 changes: 13 additions & 40 deletions apps/server/integration/OrchestrationEngineHarness.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as NodeServices from "@effect/platform-node/NodeServices";
import {
ApprovalRequestId,
CodexSettings,
CursorSettings,
ProviderDriverKind,
type OrchestrationEvent,
type OrchestrationThread,
Expand Down Expand Up @@ -40,7 +39,6 @@ import { ProviderSessionDirectoryLive } from "../src/provider/Layers/ProviderSes
import { ServerSettingsService } from "../src/serverSettings.ts";
import { makeProviderServiceLive } from "../src/provider/Layers/ProviderService.ts";
import { makeCodexAdapter } from "../src/provider/Layers/CodexAdapter.ts";
import { makeCursorAdapter } from "../src/provider/Layers/CursorAdapter.ts";
import {
NoOpProviderEventLoggers,
ProviderEventLoggers,
Expand Down Expand Up @@ -82,7 +80,6 @@ import * as VcsProcess from "../src/vcs/VcsProcess.ts";
import * as AgentAwarenessRelay from "../src/relay/AgentAwarenessRelay.ts";

const decodeCodexSettings = Schema.decodeEffect(CodexSettings);
const decodeCursorSettings = Schema.decodeEffect(CursorSettings);

function runGit(cwd: string, args: ReadonlyArray<string>) {
return NodeChildProcess.execFileSync("git", args, {
Expand Down Expand Up @@ -226,7 +223,6 @@ export interface OrchestrationIntegrationHarness {
interface MakeOrchestrationIntegrationHarnessOptions {
readonly provider?: ProviderDriverKind;
readonly realCodex?: boolean;
readonly realCursor?: boolean;
}

export const makeOrchestrationIntegrationHarness = (
Expand All @@ -238,14 +234,7 @@ export const makeOrchestrationIntegrationHarness = (

const provider = options?.provider ?? ProviderDriverKind.make("codex");
const useRealCodex = options?.realCodex === true;
const useRealCursor = options?.realCursor === true;
if (useRealCodex && useRealCursor) {
return yield* Effect.die(
"makeOrchestrationIntegrationHarness: realCodex and realCursor are mutually exclusive",
);
}
const useRealAdapter = useRealCodex || useRealCursor;
const adapterHarness = useRealAdapter
const adapterHarness = useRealCodex
? null
: yield* makeTestProviderAdapterHarness({
provider,
Expand Down Expand Up @@ -276,41 +265,25 @@ export const makeOrchestrationIntegrationHarness = (
const providerSessionDirectoryLayer = ProviderSessionDirectoryLive.pipe(
Layer.provide(ProviderSessionRuntimeRepositoryLive),
);
const realAdapterRegistryLayer = useRealCodex
? Layer.effect(
ProviderAdapterRegistry,
Effect.gen(function* () {
const codexSettings = yield* decodeCodexSettings({});
const codexAdapter = yield* makeCodexAdapter(codexSettings);
return makeAdapterRegistryMock({
[ProviderDriverKind.make("codex")]: codexAdapter,
});
}),
)
: useRealCursor
? Layer.effect(
ProviderAdapterRegistry,
Effect.gen(function* () {
const cursorSettings = yield* decodeCursorSettings({
binaryPath: process.env.CURSOR_AGENT_BIN ?? "agent",
});
const cursorAdapter = yield* makeCursorAdapter(cursorSettings);
return makeAdapterRegistryMock({
[ProviderDriverKind.make("cursor")]: cursorAdapter,
});
}),
)
: null;
const realAdapterRegistry = realAdapterRegistryLayer?.pipe(
const realCodexRegistry = Layer.effect(
ProviderAdapterRegistry,
Effect.gen(function* () {
const codexSettings = yield* decodeCodexSettings({});
const codexAdapter = yield* makeCodexAdapter(codexSettings);
return makeAdapterRegistryMock({
[ProviderDriverKind.make("codex")]: codexAdapter,
});
}),
).pipe(
Layer.provideMerge(ServerConfig.layerTest(workspaceDir, rootDir)),
Layer.provideMerge(NodeServices.layer),
Layer.provideMerge(providerSessionDirectoryLayer),
);
const providerEventLoggersLayer = Layer.succeed(ProviderEventLoggers, NoOpProviderEventLoggers);
const providerLayer = useRealAdapter
const providerLayer = useRealCodex
? makeProviderServiceLive().pipe(
Layer.provide(providerSessionDirectoryLayer),
Layer.provide(realAdapterRegistry!),
Layer.provide(realCodexRegistry),
Layer.provide(AnalyticsService.layerTest),
Layer.provide(providerEventLoggersLayer),
)
Expand Down
218 changes: 0 additions & 218 deletions apps/server/integration/cursorResume.integration.test.ts

This file was deleted.

Loading