Skip to content
23 changes: 23 additions & 0 deletions apps/server/src/provider/Layers/ProviderService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,29 @@
}),
);

it.effect("routes explicit claudeAgent provider session starts to the claude adapter", () =>
Effect.gen(function* () {
const provider = yield* ProviderService;

const session = yield* provider.startSession(asThreadId("thread-claude"), {
provider: "claudeAgent",
threadId: asThreadId("thread-claude"),
cwd: "/tmp/project-claude",
runtimeMode: "full-access",
});

assert.equal(session.provider, "claudeAgent");
assert.equal(routing.claude.startSession.mock.calls.length, 1);

Check failure on line 599 in apps/server/src/provider/Layers/ProviderService.test.ts

View workflow job for this annotation

GitHub Actions / Format, Lint, Typecheck, Test, Browser Test, Build

src/provider/Layers/ProviderService.test.ts > ProviderServiceLive routing > routes explicit claudeAgent provider session starts to the claude adapter

AssertionError: expected 2 to equal 1 - Expected + Received - 1 + 2 ❯ Array.<anonymous> src/provider/Layers/ProviderService.test.ts:599:14 ❯ next ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/src/internal/effect.ts:1264:25 ❯ Object.~effect/Effect/evaluate ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/src/internal/core.ts:531:30 ❯ FiberImpl.runLoop ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/src/internal/effect.ts:626:39 ❯ runLoop ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/src/internal/effect.ts:587:22 ❯ evaluate ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/src/internal/effect.ts:4980:8 ❯ runFork ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/src/internal/effect.ts:5055:18 ❯ runPromiseExit ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/src/internal/effect.ts:5074:4
const startInput = routing.claude.startSession.mock.calls[0]?.[0];
assert.equal(typeof startInput === "object" && startInput !== null, true);
if (startInput && typeof startInput === "object") {
const startPayload = startInput as { provider?: string; cwd?: string };
assert.equal(startPayload.provider, "claudeAgent");
assert.equal(startPayload.cwd, "/tmp/project-claude");
}
}),
);

it.effect("recovers stale sessions for sendTurn using persisted cwd", () =>
Effect.gen(function* () {
const provider = yield* ProviderService;
Expand Down
Loading