From 60a1f01a3ebb810e97b5a3f7066aa7fd750e1670 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 01:46:33 +0100 Subject: [PATCH] test: use synthetic agent infra fixtures --- src/agents/openclaw-tools.session-status.test.ts | 6 +++--- .../openclaw-tools.sessions-visibility.test.ts | 6 +++--- ...-embedded-runner.resolvesessionagentids.test.ts | 6 +++--- src/agents/subagent-registry.test.ts | 6 +++--- src/agents/tools/sessions-spawn-tool.test.ts | 6 +++--- src/infra/agent-events.test.ts | 4 ++-- src/infra/approval-gateway-resolver.test.ts | 4 ++-- src/routing/session-key.continuity.test.ts | 14 +++++++------- src/terminal/links.test.ts | 4 ++-- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/agents/openclaw-tools.session-status.test.ts b/src/agents/openclaw-tools.session-status.test.ts index 83267b8c395..437e230f34d 100644 --- a/src/agents/openclaw-tools.session-status.test.ts +++ b/src/agents/openclaw-tools.session-status.test.ts @@ -896,7 +896,7 @@ describe("session_status tool", () => { main: { sessionId: "status-origin-provider", updatedAt: 10, - origin: { provider: "discord" }, + origin: { provider: "quietchat" }, }, }); @@ -906,9 +906,9 @@ describe("session_status tool", () => { expect(resolveQueueSettingsMock).toHaveBeenCalledWith( expect.objectContaining({ - channel: "discord", + channel: "quietchat", sessionEntry: expect.objectContaining({ - origin: { provider: "discord" }, + origin: { provider: "quietchat" }, }), }), ); diff --git a/src/agents/openclaw-tools.sessions-visibility.test.ts b/src/agents/openclaw-tools.sessions-visibility.test.ts index 9bc5935410b..69c55f8de07 100644 --- a/src/agents/openclaw-tools.sessions-visibility.test.ts +++ b/src/agents/openclaw-tools.sessions-visibility.test.ts @@ -67,7 +67,7 @@ describe("sessions tools visibility", () => { const tool = getSessionsHistoryTool(); const denied = await tool.execute("call1", { - sessionKey: "agent:main:discord:direct:someone-else", + sessionKey: "agent:main:quietchat:direct:someone-else", }); expect(denied.details).toMatchObject({ status: "forbidden" }); @@ -86,10 +86,10 @@ describe("sessions tools visibility", () => { const tool = getSessionsHistoryTool(); const result = await tool.execute("call3", { - sessionKey: "agent:main:discord:direct:someone-else", + sessionKey: "agent:main:quietchat:direct:someone-else", }); expect(result.details).toMatchObject({ - sessionKey: "agent:main:discord:direct:someone-else", + sessionKey: "agent:main:quietchat:direct:someone-else", }); }); diff --git a/src/agents/pi-embedded-runner.resolvesessionagentids.test.ts b/src/agents/pi-embedded-runner.resolvesessionagentids.test.ts index 1bbecd4ce27..b7a51bf395b 100644 --- a/src/agents/pi-embedded-runner.resolvesessionagentids.test.ts +++ b/src/agents/pi-embedded-runner.resolvesessionagentids.test.ts @@ -19,7 +19,7 @@ describe("resolveSessionAgentIds", () => { it("falls back to the configured default when sessionKey is non-agent", () => { const { sessionAgentId } = resolveSessionAgentIds({ - sessionKey: "telegram:slash:123", + sessionKey: "quietchat:slash:123", config: cfg, }); expect(sessionAgentId).toBe("beta"); @@ -35,7 +35,7 @@ describe("resolveSessionAgentIds", () => { it("keeps the agent id for provider-qualified agent sessions", () => { const { sessionAgentId } = resolveSessionAgentIds({ - sessionKey: "agent:beta:slack:channel:c1", + sessionKey: "agent:beta:quietchat:channel:c1", config: cfg, }); expect(sessionAgentId).toBe("beta"); @@ -59,7 +59,7 @@ describe("resolveSessionAgentIds", () => { it("prefers explicit agentId over non-agent session keys", () => { const { sessionAgentId } = resolveSessionAgentIds({ - sessionKey: "telegram:slash:123", + sessionKey: "quietchat:slash:123", agentId: "main", config: cfg, }); diff --git a/src/agents/subagent-registry.test.ts b/src/agents/subagent-registry.test.ts index ba62216c012..38834f1640f 100644 --- a/src/agents/subagent-registry.test.ts +++ b/src/agents/subagent-registry.test.ts @@ -165,7 +165,7 @@ describe("subagent registry seam flow", () => { runId: "run-1", childSessionKey: "agent:main:subagent:child", requesterSessionKey: "agent:main:main", - requesterOrigin: { channel: " discord ", accountId: " acct-1 " }, + requesterOrigin: { channel: " quietchat ", accountId: " acct-1 " }, requesterDisplayKey: "main", task: "finish the task", cleanup: "delete", @@ -187,7 +187,7 @@ describe("subagent registry seam flow", () => { childSessionKey: "agent:main:subagent:child", childRunId: "run-1", requesterSessionKey: "agent:main:main", - requesterOrigin: { channel: "discord", accountId: "acct-1" }, + requesterOrigin: { channel: "quietchat", accountId: "acct-1" }, task: "finish the task", cleanup: "delete", roundOneReply: "final completion reply", @@ -390,7 +390,7 @@ describe("subagent registry seam flow", () => { childSessionKey: "agent:main:subagent:killed", requesterSessionKey: "agent:main:main", requesterDisplayKey: "main", - requesterOrigin: { channel: "discord", accountId: "acct-1" }, + requesterOrigin: { channel: "quietchat", accountId: "acct-1" }, task: "kill after init", cleanup: "keep", workspaceDir: "/tmp/killed-workspace", diff --git a/src/agents/tools/sessions-spawn-tool.test.ts b/src/agents/tools/sessions-spawn-tool.test.ts index e3e3f9c5590..900d1c4bca5 100644 --- a/src/agents/tools/sessions-spawn-tool.test.ts +++ b/src/agents/tools/sessions-spawn-tool.test.ts @@ -51,7 +51,7 @@ describe("sessions_spawn tool", () => { it("uses subagent runtime by default", async () => { const tool = createSessionsSpawnTool({ agentSessionKey: "agent:main:main", - agentChannel: "discord", + agentChannel: "quietchat", agentAccountId: "default", agentTo: "channel:123", agentThreadId: "456", @@ -209,7 +209,7 @@ describe("sessions_spawn tool", () => { it("routes to ACP runtime when runtime=acp", async () => { const tool = createSessionsSpawnTool({ agentSessionKey: "agent:main:main", - agentChannel: "discord", + agentChannel: "quietchat", agentAccountId: "default", agentTo: "channel:123", agentThreadId: "456", @@ -346,7 +346,7 @@ describe("sessions_spawn tool", () => { it("rejects attachments for ACP runtime", async () => { const tool = createSessionsSpawnTool({ agentSessionKey: "agent:main:main", - agentChannel: "discord", + agentChannel: "quietchat", agentAccountId: "default", agentTo: "channel:123", agentThreadId: "456", diff --git a/src/infra/agent-events.test.ts b/src/infra/agent-events.test.ts index 8cf77d7676e..7d4a9ead650 100644 --- a/src/infra/agent-events.test.ts +++ b/src/infra/agent-events.test.ts @@ -78,7 +78,7 @@ describe("agent-events sequencing", () => { test("omits sessionKey for runs hidden from Control UI", async () => { resetAgentRunContextForTest(); registerAgentRunContext("run-hidden", { - sessionKey: "session-imessage", + sessionKey: "session-quietchat", isControlUiVisible: false, }); @@ -90,7 +90,7 @@ describe("agent-events sequencing", () => { runId: "run-hidden", stream: "assistant", data: { text: "hi" }, - sessionKey: "session-imessage", + sessionKey: "session-quietchat", }); stop(); diff --git a/src/infra/approval-gateway-resolver.test.ts b/src/infra/approval-gateway-resolver.test.ts index 90633ed0d31..3e6e1057511 100644 --- a/src/infra/approval-gateway-resolver.test.ts +++ b/src/infra/approval-gateway-resolver.test.ts @@ -24,14 +24,14 @@ describe("resolveApprovalOverGateway", () => { approvalId: "approval-1", decision: "allow-once", gatewayUrl: "ws://gateway.example.test", - clientDisplayName: "Discord approval (default)", + clientDisplayName: "QuietChat approval (default)", }); expect(hoisted.withOperatorApprovalsGatewayClient).toHaveBeenCalledWith( { config: { gateway: { auth: { token: "cfg-token" } } }, gatewayUrl: "ws://gateway.example.test", - clientDisplayName: "Discord approval (default)", + clientDisplayName: "QuietChat approval (default)", }, expect.any(Function), ); diff --git a/src/routing/session-key.continuity.test.ts b/src/routing/session-key.continuity.test.ts index 0acbc1a588f..50e56d69563 100644 --- a/src/routing/session-key.continuity.test.ts +++ b/src/routing/session-key.continuity.test.ts @@ -1,12 +1,12 @@ import { describe, it, expect } from "vitest"; import { buildAgentSessionKey } from "./resolve-route.js"; -describe("Discord Session Key Continuity", () => { +describe("Channel Session Key Continuity", () => { const agentId = "main"; - const channel = "discord"; + const channel = "quietchat"; const accountId = "default"; - function buildDiscordSessionKey(params: { + function buildChannelSessionKey(params: { peer: { kind: "direct" | "channel"; id: string }; dmScope?: "main" | "per-peer"; }) { @@ -23,22 +23,22 @@ describe("Discord Session Key Continuity", () => { dmScope: "main" | "per-peer"; expectedDmKey: string; }) { - const dmKey = buildDiscordSessionKey({ + const dmKey = buildChannelSessionKey({ peer: { kind: "direct", id: "user123" }, dmScope: params.dmScope, }); - const groupKey = buildDiscordSessionKey({ + const groupKey = buildChannelSessionKey({ peer: { kind: "channel", id: "channel456" }, }); expect(dmKey).toBe(params.expectedDmKey); - expect(groupKey).toBe("agent:main:discord:channel:channel456"); + expect(groupKey).toBe("agent:main:quietchat:channel:channel456"); expect(dmKey).not.toBe(groupKey); } function expectUnknownChannelKeyCase(channelId: string) { - const missingIdKey = buildDiscordSessionKey({ + const missingIdKey = buildChannelSessionKey({ peer: { kind: "channel", id: channelId }, }); diff --git a/src/terminal/links.test.ts b/src/terminal/links.test.ts index ab78a2ed365..616f5c88d7e 100644 --- a/src/terminal/links.test.ts +++ b/src/terminal/links.test.ts @@ -3,8 +3,8 @@ import { formatDocsLink } from "./links.js"; describe("formatDocsLink", () => { it("prepends the docs root when given a relative path", () => { - const out = formatDocsLink("/channels/telegram", "telegram"); - expect(out).toContain("https://docs.openclaw.ai/channels/telegram"); + const out = formatDocsLink("/channels/quietchat", "quietchat"); + expect(out).toContain("https://docs.openclaw.ai/channels/quietchat"); }); it("preserves an absolute http url", () => {