refactor: remove unused runtime and WebUI helpers (#5999)
* refactor: remove unused runtime and WebUI helpers * fix: preserve exported agent helper methods
This commit is contained in:
1 parent
d3d70f2065
commit
6ecb74aea9
17 files changed
+26
-143
No files matched your search
@@ -2,7 +2,7 @@ import { act, renderHook, waitFor } from "@testing-library/react";
|
||||
import type { ReactNode } from "react";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { sessionTitle, useSessionHistory, useSessions } from "@/hooks/useSessions";
|
||||
import { useSessionHistory, useSessions } from "@/hooks/useSessions";
|
||||
import * as api from "@/lib/api";
|
||||
import { webuiThreadCache } from "@/lib/webui-thread-cache";
|
||||
import { activateReloadCache, clearReloadCache, writeReloadCache } from "@/lib/reload-cache";
|
||||
@@ -130,28 +130,6 @@ describe("useSessions", () => {
|
||||
webuiThreadCache.clear();
|
||||
});
|
||||
|
||||
it("does not use low-information greetings as fallback session titles", () => {
|
||||
expect(sessionTitle({
|
||||
key: "websocket:chat-hi",
|
||||
channel: "websocket",
|
||||
chatId: "chat-hi",
|
||||
createdAt: "2026-04-16T10:00:00Z",
|
||||
updatedAt: "2026-04-16T10:00:00Z",
|
||||
title: "",
|
||||
preview: "hi",
|
||||
})).toBe("New topic");
|
||||
|
||||
expect(sessionTitle({
|
||||
key: "websocket:chat-work",
|
||||
channel: "websocket",
|
||||
chatId: "chat-work",
|
||||
createdAt: "2026-04-16T10:00:00Z",
|
||||
updatedAt: "2026-04-16T10:00:00Z",
|
||||
title: "",
|
||||
preview: "帮我优化 WebUI 性能",
|
||||
})).toBe("帮我优化 WebUI 性能");
|
||||
});
|
||||
|
||||
it("removes a session from the local list after delete succeeds", async () => {
|
||||
vi.mocked(api.listSessions).mockResolvedValue([
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user