From 007fdb1f7c1cfdb03532dbf5cb23be1b386fe0aa Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 31 Jul 2026 11:59:12 +0800 Subject: [PATCH] test(extensions): remove duplicate coverage (#116643) --- extensions/anthropic/cli-shared.test.ts | 11 ------ .../memory-core/doctor-contract-api.test.ts | 35 ------------------- .../qqbot/src/engine/group/history.test.ts | 26 -------------- extensions/reef/src/transport.test.ts | 35 ------------------- 4 files changed, 107 deletions(-) diff --git a/extensions/anthropic/cli-shared.test.ts b/extensions/anthropic/cli-shared.test.ts index 200b054bb03e..d8ace019d7a1 100644 --- a/extensions/anthropic/cli-shared.test.ts +++ b/extensions/anthropic/cli-shared.test.ts @@ -115,17 +115,6 @@ function normalizeClaudeArgs( } describe("Claude backend permission args", () => { - it("leaves args alone when they omit permission flags", () => { - expect(normalizeClaudeArgs(["-p", "--output-format", "stream-json", "--verbose"])).toEqual([ - "-p", - "--output-format", - "stream-json", - "--verbose", - "--setting-sources", - "user", - ]); - }); - it("removes legacy skip-permissions without adding bypassPermissions", () => { expect(normalizeClaudeArgs(["-p", "--dangerously-skip-permissions", "--verbose"])).toEqual([ "-p", diff --git a/extensions/memory-core/doctor-contract-api.test.ts b/extensions/memory-core/doctor-contract-api.test.ts index 0313a36d9c61..5f5e4ca5cda8 100644 --- a/extensions/memory-core/doctor-contract-api.test.ts +++ b/extensions/memory-core/doctor-contract-api.test.ts @@ -1841,41 +1841,6 @@ describe("memory-core doctor dreaming migration", () => { await expect(fs.access(`${legacyPath}.migrated`)).resolves.toBeUndefined(); }); - it("archives legacy vector sidecars when memory search provider is none", async () => { - const stateDir = path.join(rootDir, "state"); - const legacyPath = path.join(stateDir, "memory", "main.sqlite"); - const agentPath = path.join(stateDir, "agents", "main", "agent", "openclaw-agent.sqlite"); - await writeLegacyMemorySidecar(legacyPath, { vector: "vec0" }); - const config: OpenClawConfig = { - memory: { - search: { - provider: "none", - store: { - vector: { - extensionPath: path.join(rootDir, "missing-sqlite-vec.so"), - }, - }, - }, - }, - - agents: { - defaults: {}, - list: [{ id: "main", workspace: workspaceDir }], - }, - }; - - const result = await legacyMemoryIndexMigration().migrateLegacyState(migrationParams(config)); - - expect(result.warnings).toEqual([]); - expect(result.changes).toEqual([ - "Migrated Memory Core legacy memory index for agent main -> per-agent SQLite (1 source(s), 1 chunk(s), 1 cache row(s))", - expect.stringContaining("Archived Memory Core legacy memory index sidecar"), - ]); - const keywordRows = await searchMigratedKeywordRows(agentPath, "remember"); - expect(keywordRows.map((row) => row.id)).toEqual(["chunk-1"]); - await expect(fs.access(`${legacyPath}.migrated`)).resolves.toBeUndefined(); - }); - it("copies custom vector sidecars to the canonical retry path when sqlite-vec cannot load", async () => { const stateDir = path.join(rootDir, "state"); const legacyPath = path.join(rootDir, "custom-memory", "main.sqlite"); diff --git a/extensions/qqbot/src/engine/group/history.test.ts b/extensions/qqbot/src/engine/group/history.test.ts index 75ef100f5b2f..58e381642512 100644 --- a/extensions/qqbot/src/engine/group/history.test.ts +++ b/extensions/qqbot/src/engine/group/history.test.ts @@ -38,11 +38,6 @@ describe("engine/group/history", () => { }); describe("formatAttachmentTags", () => { - it("returns empty string for empty input", () => { - expect(formatAttachmentTags()).toBe(""); - expect(formatAttachmentTags([])).toBe(""); - }); - it("renders bracketed source tags for entries with a source", () => { expect(formatAttachmentTags([{ type: "image", localPath: "/tmp/a.png" }])).toBe( "[image: /tmp/a.png]", @@ -57,27 +52,6 @@ describe("engine/group/history", () => { formatAttachmentTags([{ type: "voice", localPath: "/tmp/v.wav", transcript: "hi" }]), ).toBe('[voice: /tmp/v.wav] (transcript: "hi")'); }); - - it("uses descriptive tags when no source is available", () => { - expect(formatAttachmentTags([{ type: "image" }])).toBe("[image]"); - expect(formatAttachmentTags([{ type: "image", filename: "a.png" }])).toBe("[image: a.png]"); - expect(formatAttachmentTags([{ type: "voice" }])).toBe("[voice]"); - expect(formatAttachmentTags([{ type: "voice", transcript: "t" }])).toBe( - '[voice (transcript: "t")]', - ); - expect(formatAttachmentTags([{ type: "video" }])).toBe("[video]"); - expect(formatAttachmentTags([{ type: "file", filename: "b.pdf" }])).toBe("[file: b.pdf]"); - expect(formatAttachmentTags([{ type: "unknown" }])).toBe("[attachment]"); - }); - - it("joins multiple entries with newline", () => { - expect( - formatAttachmentTags([ - { type: "image", localPath: "/tmp/a.png" }, - { type: "voice", transcript: "hi" }, - ]), - ).toBe('[image: /tmp/a.png]\n[voice (transcript: "hi")]'); - }); }); describe("formatMessageContent", () => { diff --git a/extensions/reef/src/transport.test.ts b/extensions/reef/src/transport.test.ts index d953db3bf1af..a7e09b1d1ae7 100644 --- a/extensions/reef/src/transport.test.ts +++ b/extensions/reef/src/transport.test.ts @@ -937,41 +937,6 @@ async function deliverInboxFrame(frame: string): Promise<{ return { entries, states }; } -describe("createReefWebSocket handshake deadline", () => { - it("errors when the relay accepts TCP but never completes the upgrade", async () => { - const peers = new Set(); - const server = http.createServer(); - server.on("connection", (socket) => { - peers.add(socket); - socket.once("close", () => peers.delete(socket)); - }); - server.on("upgrade", () => { - // Leave the HTTP upgrade pending until the client deadline aborts it. - }); - await new Promise((resolve, reject) => { - server.once("error", reject); - server.listen(0, "127.0.0.1", () => resolve()); - }); - - try { - const { port } = server.address() as AddressInfo; - const socket = createReefWebSocket(`ws://127.0.0.1:${port}`, { - handshakeTimeoutMs: 50, - }) as WebSocket; - const [error] = await once(socket, "error"); - - expect(error).toMatchObject({ message: "Opening handshake has timed out" }); - } finally { - for (const peer of peers) { - peer.destroy(); - } - await new Promise((resolve) => { - server.close(() => resolve()); - }); - } - }); -}); - describe("ReefInboxConnection response frame bounds", () => { it("accepts a relay frame exactly at the payload limit", async () => { const frame = inboxFrameAtSize(INBOX_WEBSOCKET_MAX_PAYLOAD_BYTES);