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 @@
11 {
22 "name": "executor",
3− "version": "1.1.1",
3+ "version": "1.1.3",
44 "description": "Local AI executor with a CLI, local API server, and web UI.",
55 "keywords": [
66 "executor",
apps/executor/src/server/server.test.ts+17−19
@@ -9,14 +9,13 @@ import { · 8 unmodified lines
99 OpenApi,
1010 } from "@effect/platform";
1111 import { describe, expect, it } from "@effect/vitest";
12−import { assertInstanceOf, assertTrue } from "@effect/vitest/utils";
12+import { assertTrue } from "@effect/vitest/utils";
1313 import * as Effect from "effect/Effect";
1414 import * as Schema from "effect/Schema";
1515
1616 import { startMcpElicitationDemoServer } from "@executor-v3/mcp-elicitation-demo";
1717 import { makeToolInvokerFromTools, toTool } from "@executor-v3/codemode-core";
1818 import {
19− ControlPlaneStorageError,
2019 createControlPlaneClient,
2120 type ControlPlaneClient,
2221 type ResolveExecutionEnvironment,
@@ -898,7 +897,7 @@ describe("local-executor-server", () => { · 875 unmodified lines
898897 15_000,
899898 );
900899
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", () =>
902901 Effect.gen(function* () {
903902 const demoServer = yield* Effect.acquireRelease(
904903 Effect.promise(() => startMcpElicitationDemoServer()),
@@ -926,7 +925,7 @@ describe("local-executor-server", () => { · 21 unmodified lines
926925 payload: {
927926 name: "Demo",
928927 kind: "mcp",
929− endpoint: "http://127.0.0.1:58005/mcp",
928+ endpoint: demoServer.endpoint,
930929 status: "connected",
931930 enabled: true,
932931 namespace: "demo",
@@ -945,7 +944,7 @@ describe("local-executor-server", () => { · 12 unmodified lines
945944 namespace: "demo",
946945 });
947946
948− expect(seeded.action).toBe("updated");
947+ expect(seeded.action).toBe("noop");
949948 expect(seeded.sourceId).toBe(existing.id);
950949
951950 const sources = yield* client.sources.list({
@@ -957,6 +956,7 @@ describe("local-executor-server", () => { · 5 unmodified lines
957956 expect(sources).toHaveLength(1);
958957 expect(sources[0]?.endpoint).toBe(demoServer.endpoint);
959958 }),
959+ 15_000,
960960 );
961961
962962 it.scoped("loads OpenAPI sources from control-plane state and calls them", () =>
@@ -1286,7 +1286,7 @@ describe("local-executor-server", () => { · 323 unmodified lines
12861286 }),
12871287 );
12881288
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", () =>
12901290 Effect.gen(function* () {
12911291 const server = yield* createLocalExecutorServer({
12921292 port: 0,
@@ -1363,20 +1363,18 @@ describe("local-executor-server", () => { · 70 unmodified lines
13631363 }],
13641364 });
13651365
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+ });
13761374
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");
13801378 }),
13811379 );
13821380 });
apps/web/src/views/add-source.tsx+2−1
@@ -576,7 +576,7 @@ export function AddSourcePage() { · 575 unmodified lines
576576
577577 const applyTemplate = async (template: SourceTemplate) => {
578578 const discoveryUrl = "specUrl" in template ? template.specUrl : template.endpoint;
579− setUrl(discoveryUrl);
579+ setUrl(template.endpoint);
580580 setStatusBanner(null);
581581 setPhase("discovering");
582582
@@ -587,6 +587,7 @@ export function AddSourcePage() { · 4 unmodified lines
587587 // Prefer the template's own values over whatever discover returned
588588 form.name = template.name;
589589 form.endpoint = template.endpoint;
590+ form.namespace = namespaceFromUrl(template.endpoint);
590591 if ("specUrl" in template) {
591592 form.specUrl = template.specUrl;
592593 }