From e22774127a08f3f6ca3da0ef0b8fb3784751ca63 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 20 Aug 2026 18:34:15 -0700 Subject: [PATCH] test: remove core test scaffolding (#126926) --- packages/acp-core/src/runtime/types.test.ts | 7 +++---- .../src/schema/sessions-delete.test.ts | 15 ++------------- scripts/lib/worker-deploy-build-plugin.mts | 7 ------- .../tools/github-identity-status-tool.test.ts | 3 +-- test/scripts/worker-deploy-build-plugin.test.ts | 1 - 5 files changed, 6 insertions(+), 27 deletions(-) diff --git a/packages/acp-core/src/runtime/types.test.ts b/packages/acp-core/src/runtime/types.test.ts index 2a681dbe9e61..c07daa3ca3bc 100644 --- a/packages/acp-core/src/runtime/types.test.ts +++ b/packages/acp-core/src/runtime/types.test.ts @@ -1,14 +1,13 @@ -import { expect, expectTypeOf, it } from "vitest"; +import { expectTypeOf, it } from "vitest"; import type { AcpElicitationRequest, AcpElicitationResponse } from "./types.js"; it("keeps elicitation requests extensible and response actions closed", () => { - const customRequest = { + void ({ mode: "vendor/future", message: "Choose a value", requestId: 7, vendorData: { bounded: true }, - } satisfies AcpElicitationRequest; + } satisfies AcpElicitationRequest); - expect(customRequest.mode).toBe("vendor/future"); expectTypeOf().toEqualTypeOf<"accept" | "decline" | "cancel">(); }); diff --git a/packages/gateway-protocol/src/schema/sessions-delete.test.ts b/packages/gateway-protocol/src/schema/sessions-delete.test.ts index e9d97b960921..29eb2e5e4a04 100644 --- a/packages/gateway-protocol/src/schema/sessions-delete.test.ts +++ b/packages/gateway-protocol/src/schema/sessions-delete.test.ts @@ -1,25 +1,14 @@ import { Value } from "typebox/value"; import { describe, expect, it } from "vitest"; -import { SessionsDeleteResultSchema, WORKTREE_PRESERVATION_REASONS } from "./sessions-delete.js"; +import { SessionsDeleteResultSchema } from "./sessions-delete.js"; describe("SessionsDeleteResultSchema", () => { - it("bounds preserved worktree cleanup reasons", () => { + it("rejects unknown and missing worktree preservation reasons", () => { const preserved = { id: "wt-1", branch: "openclaw/task-one", path: "/worktree/task-one", }; - for (const reason of WORKTREE_PRESERVATION_REASONS) { - expect( - Value.Check(SessionsDeleteResultSchema, { - ok: true, - key: "agent:main:dashboard:task-one", - deleted: true, - archived: [], - worktreePreserved: { ...preserved, reason }, - }), - ).toBe(true); - } expect( Value.Check(SessionsDeleteResultSchema, { ok: true, diff --git a/scripts/lib/worker-deploy-build-plugin.mts b/scripts/lib/worker-deploy-build-plugin.mts index d1ec6485344e..a4026c31fc78 100644 --- a/scripts/lib/worker-deploy-build-plugin.mts +++ b/scripts/lib/worker-deploy-build-plugin.mts @@ -56,13 +56,6 @@ export function createWorkerDeployBuildPlugin(rootDir = process.cwd()) { return WORKER_BROWSER_RUNTIME_COMPOSITION; } if (resolvedId === undiciDispatcherOptionsPath) { - if ( - code.includes(WORKER_UNDICI_IMPORT) && - code.includes("return bundledUndici;") && - UNDICI_REQUIRE_BOOTSTRAP.every((fragment) => !code.includes(fragment)) - ) { - return code; - } if (UNDICI_REQUIRE_BOOTSTRAP.some((fragment) => !code.includes(fragment))) { this.error("undici dispatcher bootstrap changed; update the worker deploy transform"); } diff --git a/src/agents/tools/github-identity-status-tool.test.ts b/src/agents/tools/github-identity-status-tool.test.ts index d9792b969c4d..dc76458a575f 100644 --- a/src/agents/tools/github-identity-status-tool.test.ts +++ b/src/agents/tools/github-identity-status-tool.test.ts @@ -4,7 +4,7 @@ import { createGitHubIdentityStatusTool } from "./github-identity-status-tool.js import type { InProcessGatewayCaller } from "./in-process-gateway.js"; describe("github_identity_status tool", () => { - it("returns bounded secret-free status and an operator next action", async () => { + it("returns status and an operator next action", async () => { const callGatewayMock = vi.fn(async () => ({ agentId: "main", selectedScope: "agent" as const, @@ -36,6 +36,5 @@ describe("github_identity_status tool", () => { selectedScope: "agent", }); expect(JSON.stringify(result)).toContain("Ask the operator"); - expect(JSON.stringify(result)).not.toMatch(/accessToken|refreshToken|deviceCode/u); }); }); diff --git a/test/scripts/worker-deploy-build-plugin.test.ts b/test/scripts/worker-deploy-build-plugin.test.ts index 358b3133155c..753403d0f37a 100644 --- a/test/scripts/worker-deploy-build-plugin.test.ts +++ b/test/scripts/worker-deploy-build-plugin.test.ts @@ -48,7 +48,6 @@ describe("worker deploy build plugin", () => { expect(transformed).not.toContain('import { createRequire } from "node:module";'); expect(transformed).not.toContain("const requireUndici = createRequire(import.meta.url);"); expect(transformed).not.toContain('requireUndici("undici")'); - expect(plugin.transform.call({ error: fail }, transformed!, dispatcherPath)).toBe(transformed); }); it("fails closed when the undici dispatcher bootstrap shape changes", () => {