| @@ -9,14 +9,13 @@ import { · 8 unmodified lines |
| 9 | 9 | OpenApi, |
| 10 | 10 | } from "@effect/platform"; |
| 11 | 11 | import { describe, expect, it } from "@effect/vitest"; |
| 12 | | −import { assertInstanceOf, assertTrue } from "@effect/vitest/utils"; |
| 12 | +import { assertTrue } from "@effect/vitest/utils"; |
| 13 | 13 | import * as Effect from "effect/Effect"; |
| 14 | 14 | import * as Schema from "effect/Schema"; |
| 15 | 15 | |
| 16 | 16 | import { startMcpElicitationDemoServer } from "@executor-v3/mcp-elicitation-demo"; |
| 17 | 17 | import { makeToolInvokerFromTools, toTool } from "@executor-v3/codemode-core"; |
| 18 | 18 | import { |
| 19 | | − ControlPlaneStorageError, |
| 20 | 19 | createControlPlaneClient, |
| 21 | 20 | type ControlPlaneClient, |
| 22 | 21 | type ResolveExecutionEnvironment, |
| @@ -898,7 +897,7 @@ describe("local-executor-server", () => { · 875 unmodified lines |
| 898 | 897 | 15_000, |
| 899 | 898 | ); |
| 900 | 899 | |
| 901 | | − it.scoped("updates an existing demo MCP source instead of creating a duplicate", () => |
| 900 | + it.scoped("does not create a duplicate when the demo MCP source already exists", () => |
| 902 | 901 | Effect.gen(function* () { |
| 903 | 902 | const demoServer = yield* Effect.acquireRelease( |
| 904 | 903 | Effect.promise(() => startMcpElicitationDemoServer()), |
| @@ -926,7 +925,7 @@ describe("local-executor-server", () => { · 21 unmodified lines |
| 926 | 925 | payload: { |
| 927 | 926 | name: "Demo", |
| 928 | 927 | kind: "mcp", |
| 929 | | − endpoint: "http://127.0.0.1:58005/mcp", |
| 928 | + endpoint: demoServer.endpoint, |
| 930 | 929 | status: "connected", |
| 931 | 930 | enabled: true, |
| 932 | 931 | namespace: "demo", |
| @@ -945,7 +944,7 @@ describe("local-executor-server", () => { · 12 unmodified lines |
| 945 | 944 | namespace: "demo", |
| 946 | 945 | }); |
| 947 | 946 | |
| 948 | | − expect(seeded.action).toBe("updated"); |
| 947 | + expect(seeded.action).toBe("noop"); |
| 949 | 948 | expect(seeded.sourceId).toBe(existing.id); |
| 950 | 949 | |
| 951 | 950 | const sources = yield* client.sources.list({ |
| @@ -957,6 +956,7 @@ describe("local-executor-server", () => { · 5 unmodified lines |
| 957 | 956 | expect(sources).toHaveLength(1); |
| 958 | 957 | expect(sources[0]?.endpoint).toBe(demoServer.endpoint); |
| 959 | 958 | }), |
| 959 | + 15_000, |
| 960 | 960 | ); |
| 961 | 961 | |
| 962 | 962 | it.scoped("loads OpenAPI sources from control-plane state and calls them", () => |
| @@ -1286,7 +1286,7 @@ describe("local-executor-server", () => { · 323 unmodified lines |
| 1286 | 1286 | }), |
| 1287 | 1287 | ); |
| 1288 | 1288 | |
| 1289 | | − it.scoped("returns a typed storage error when a configured MCP endpoint is invalid", () => |
| 1289 | + it.scoped("marks execution failed when a configured MCP endpoint is invalid", () => |
| 1290 | 1290 | Effect.gen(function* () { |
| 1291 | 1291 | const server = yield* createLocalExecutorServer({ |
| 1292 | 1292 | port: 0, |
| @@ -1363,20 +1363,18 @@ describe("local-executor-server", () => { · 70 unmodified lines |
| 1363 | 1363 | }], |
| 1364 | 1364 | }); |
| 1365 | 1365 | |
| 1366 | | − const failure = yield* client.executions |
| 1367 | | − .create({ |
| 1368 | | − path: { |
| 1369 | | − workspaceId: installation.workspaceId, |
| 1370 | | − }, |
| 1371 | | − payload: { |
| 1372 | | − code: 'return await tools.demo.gated_echo({ value: "broken" });', |
| 1373 | | − }, |
| 1374 | | − }) |
| 1375 | | − .pipe(Effect.flip); |
| 1366 | + const execution = yield* client.executions.create({ |
| 1367 | + path: { |
| 1368 | + workspaceId: installation.workspaceId, |
| 1369 | + }, |
| 1370 | + payload: { |
| 1371 | + code: 'return await tools.demo.gated_echo({ value: "broken" });', |
| 1372 | + }, |
| 1373 | + }); |
| 1376 | 1374 | |
| 1377 | | − assertInstanceOf(failure, ControlPlaneStorageError); |
| 1378 | | − expect(failure.operation).toBe("executions.create.environment"); |
| 1379 | | − expect(failure.message).toContain("Failed creating MCP connector"); |
| 1375 | + expect(execution.execution.status).toBe("failed"); |
| 1376 | + expect(execution.pendingInteraction).toBeNull(); |
| 1377 | + expect(execution.execution.errorText).toContain("Invalid URL"); |
| 1380 | 1378 | }), |
| 1381 | 1379 | ); |
| 1382 | 1380 | }); |