History

Update executor version to 1.1.3 and improve test descriptions

- Bump version in package.json - Refactor test descriptions for clarity in server.test.ts - Adjust endpoint handling in add-source.tsx to use template.endpoint directly3

Rhys Sullivan committed 8 months ago

Commit a676a1a1 parent aa596e23 files · +20 −21Browse files

Unified · Split

3 files
  1. apps/executor/package.json +1 −1
  2. apps/executor/src/server/server.test.ts +17 −19
  3. apps/web/src/views/add-source.tsx +2 −1
apps/executor/package.json+1−1
@@ -1,6 +1,6 @@
1{1{
2 "name": "executor",2 "name": "executor",
3 "version": "1.1.1",3 "version": "1.1.3",
4 "description": "Local AI executor with a CLI, local API server, and web UI.",4 "description": "Local AI executor with a CLI, local API server, and web UI.",
5 "keywords": [5 "keywords": [
6 "executor",6 "executor",
apps/executor/src/server/server.test.ts+17−19
@@ -9,14 +9,13 @@ import { · 8 unmodified lines
9 OpenApi,9 OpenApi,
10} from "@effect/platform";10} from "@effect/platform";
11import { describe, expect, it } from "@effect/vitest";11import { describe, expect, it } from "@effect/vitest";
12import { assertInstanceOf, assertTrue } from "@effect/vitest/utils";12import { assertTrue } from "@effect/vitest/utils";
13import * as Effect from "effect/Effect";13import * as Effect from "effect/Effect";
14import * as Schema from "effect/Schema";14import * as Schema from "effect/Schema";
15 15
16import { startMcpElicitationDemoServer } from "@executor-v3/mcp-elicitation-demo";16import { startMcpElicitationDemoServer } from "@executor-v3/mcp-elicitation-demo";
17import { makeToolInvokerFromTools, toTool } from "@executor-v3/codemode-core";17import { makeToolInvokerFromTools, toTool } from "@executor-v3/codemode-core";
18import {18import {
19 ControlPlaneStorageError,
20 createControlPlaneClient,19 createControlPlaneClient,
21 type ControlPlaneClient,20 type ControlPlaneClient,
22 type ResolveExecutionEnvironment,21 type ResolveExecutionEnvironment,
@@ -898,7 +897,7 @@ describe("local-executor-server", () => { · 875 unmodified lines
898 15_000,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 Effect.gen(function* () {901 Effect.gen(function* () {
903 const demoServer = yield* Effect.acquireRelease(902 const demoServer = yield* Effect.acquireRelease(
904 Effect.promise(() => startMcpElicitationDemoServer()),903 Effect.promise(() => startMcpElicitationDemoServer()),
@@ -926,7 +925,7 @@ describe("local-executor-server", () => { · 21 unmodified lines
926 payload: {925 payload: {
927 name: "Demo",926 name: "Demo",
928 kind: "mcp",927 kind: "mcp",
929 endpoint: "http://127.0.0.1:58005/mcp",928 endpoint: demoServer.endpoint,
930 status: "connected",929 status: "connected",
931 enabled: true,930 enabled: true,
932 namespace: "demo",931 namespace: "demo",
@@ -945,7 +944,7 @@ describe("local-executor-server", () => { · 12 unmodified lines
945 namespace: "demo",944 namespace: "demo",
946 });945 });
947 946
948 expect(seeded.action).toBe("updated");947 expect(seeded.action).toBe("noop");
949 expect(seeded.sourceId).toBe(existing.id);948 expect(seeded.sourceId).toBe(existing.id);
950 949
951 const sources = yield* client.sources.list({950 const sources = yield* client.sources.list({
@@ -957,6 +956,7 @@ describe("local-executor-server", () => { · 5 unmodified lines
957 expect(sources).toHaveLength(1);956 expect(sources).toHaveLength(1);
958 expect(sources[0]?.endpoint).toBe(demoServer.endpoint);957 expect(sources[0]?.endpoint).toBe(demoServer.endpoint);
959 }),958 }),
959 15_000,
960 );960 );
961 961
962 it.scoped("loads OpenAPI sources from control-plane state and calls them", () =>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 Effect.gen(function* () {1290 Effect.gen(function* () {
1291 const server = yield* createLocalExecutorServer({1291 const server = yield* createLocalExecutorServer({
1292 port: 0,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.executions1366 const execution = yield* client.executions.create({
1367 .create({1367 path: {
1368 path: {1368 workspaceId: installation.workspaceId,
1369 workspaceId: installation.workspaceId,1369 },
1370 },1370 payload: {
1371 payload: {1371 code: 'return await tools.demo.gated_echo({ value: "broken" });',
1372 code: 'return await tools.demo.gated_echo({ value: "broken" });',1372 },
1373 },1373 });
1374 })
1375 .pipe(Effect.flip);
1376 1374
1377 assertInstanceOf(failure, ControlPlaneStorageError);1375 expect(execution.execution.status).toBe("failed");
1378 expect(failure.operation).toBe("executions.create.environment");1376 expect(execution.pendingInteraction).toBeNull();
1379 expect(failure.message).toContain("Failed creating MCP connector");1377 expect(execution.execution.errorText).toContain("Invalid URL");
1380 }),1378 }),
1381 );1379 );
1382});1380});
apps/web/src/views/add-source.tsx+2−1
@@ -576,7 +576,7 @@ export function AddSourcePage() { · 575 unmodified lines
576 576
577 const applyTemplate = async (template: SourceTemplate) => {577 const applyTemplate = async (template: SourceTemplate) => {
578 const discoveryUrl = "specUrl" in template ? template.specUrl : template.endpoint;578 const discoveryUrl = "specUrl" in template ? template.specUrl : template.endpoint;
579 setUrl(discoveryUrl);579 setUrl(template.endpoint);
580 setStatusBanner(null);580 setStatusBanner(null);
581 setPhase("discovering");581 setPhase("discovering");
582 582
@@ -587,6 +587,7 @@ export function AddSourcePage() { · 4 unmodified lines
587 // Prefer the template's own values over whatever discover returned587 // Prefer the template's own values over whatever discover returned
588 form.name = template.name;588 form.name = template.name;
589 form.endpoint = template.endpoint;589 form.endpoint = template.endpoint;
590 form.namespace = namespaceFromUrl(template.endpoint);
590 if ("specUrl" in template) {591 if ("specUrl" in template) {
591 form.specUrl = template.specUrl;592 form.specUrl = template.specUrl;
592 }593 }