Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix: remove KV cache from runtimes endpoint for real-time online status

Gener7136fad04a86
diff --git a/src/web/src/app/api/runtimes/route.test.ts b/src/web/src/app/api/runtimes/route.test.ts
index 036206d4d..5573a3d6d 100644
--- a/src/web/src/app/api/runtimes/route.test.ts
+++ b/src/web/src/app/api/runtimes/route.test.ts
@@ -9,13 +9,6 @@ const mockListAgentRuntimes = vi.fn();
vi.mock("@/lib/db", () => ({ getDb: vi.fn(() => ({})) }));
-vi.mock("@/lib/cache", () => ({
- cached: vi.fn((_key: string, _ttl: number, fn: () => any) => fn()),
- cacheKeys: {
- allRuntimes: (ws: string) => `runtimes:${ws}`,
- heartbeat: (ws: string, id: string) => `hb:${ws}:${id}`,
- },
-}));
vi.mock("@alook/shared", () => ({
createDb: vi.fn(() => ({})),
diff --git a/src/web/src/app/api/runtimes/route.ts b/src/web/src/app/api/runtimes/route.ts
index 4a9234631..527814cdb 100644
--- a/src/web/src/app/api/runtimes/route.ts
+++ b/src/web/src/app/api/runtimes/route.ts
@@ -5,7 +5,6 @@ import { withAuth } from "@/lib/middleware/auth";
import { withWorkspaceMember } from "@/lib/middleware/workspace";
import { writeJSON } from "@/lib/middleware/helpers";
import { runtimeToResponse } from "@/lib/api/responses";
-import { cached, cacheKeys } from "@/lib/cache";
export const GET = withAuth(async (req, ctx) => {
const ws = await withWorkspaceMember(req, ctx);
@@ -14,7 +13,7 @@ export const GET = withAuth(async (req, ctx) => {
const { env } = getCloudflareContext()
const db = getDb((env as Env).DB)
- const runtimes = await cached(cacheKeys.allRuntimes(ws.workspaceId), 120, () => queries.runtime.listAgentRuntimes(db, ws.workspaceId));
+ const runtimes = await queries.runtime.listAgentRuntimes(db, ws.workspaceId);
return writeJSON(runtimes.map(runtimeToResponse));
});