From 66665eea6dcbded5e222a2d89b2058df8d0d4f84 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 01:40:29 +0100 Subject: [PATCH] test: use synthetic status session fixtures --- src/cli/cron-cli/shared.test.ts | 4 ++-- src/commands/agent.delivery.test.ts | 6 +++--- src/commands/agents.delete.test.ts | 14 +++++++------- src/commands/sessions.test.ts | 8 ++++---- src/commands/status.command-report-data.test.ts | 2 +- src/commands/status.command-sections.test.ts | 16 ++++++++-------- src/commands/status.scan-overview.test.ts | 4 ++-- src/commands/status.scan.config-shared.test.ts | 8 ++++---- src/commands/status.test-support.ts | 8 ++++---- src/gateway/server-chat.agent-events.test.ts | 2 +- src/memory-host-sdk/host/session-files.test.ts | 2 +- ui/src/ui/chat/message-normalizer.test.ts | 2 +- .../ui/chat/slash-command-executor.node.test.ts | 2 +- 13 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/cli/cron-cli/shared.test.ts b/src/cli/cron-cli/shared.test.ts index 6394fc1767e..d33fae5745f 100644 --- a/src/cli/cron-cli/shared.test.ts +++ b/src/cli/cron-cli/shared.test.ts @@ -188,8 +188,8 @@ describe("getCronChannelOptions", () => { }); it("lists discovered channel plugin ids when plugins are available", () => { - hoisted.listChannelPluginsMock.mockReturnValue([{ id: "telegram" }, { id: "signal" }]); - expect(getCronChannelOptions()).toBe("last|telegram|signal"); + hoisted.listChannelPluginsMock.mockReturnValue([{ id: "quietchat" }, { id: "forum" }]); + expect(getCronChannelOptions()).toBe("last|quietchat|forum"); }); }); diff --git a/src/commands/agent.delivery.test.ts b/src/commands/agent.delivery.test.ts index 2cfa3f5a82d..5772a91b4a7 100644 --- a/src/commands/agent.delivery.test.ts +++ b/src/commands/agent.delivery.test.ts @@ -300,8 +300,8 @@ describe("deliverAgentCommandResult", () => { opts: { message: "hello", deliver: false, - lane: "nested:agent:ebao-next:discord:channel:1", - sessionKey: "agent:ebao-next:discord:channel:1", + lane: "nested:agent:ebao-next:quietchat:channel:1", + sessionKey: "agent:ebao-next:quietchat:channel:1", runId: "run-announce", messageChannel: "webchat", }, @@ -311,7 +311,7 @@ describe("deliverAgentCommandResult", () => { expect(runtime.log).toHaveBeenCalledTimes(1); const line = String((runtime.log as ReturnType).mock.calls[0]?.[0]); expect(line).toContain("[agent:nested]"); - expect(line).toContain("session=agent:ebao-next:discord:channel:1"); + expect(line).toContain("session=agent:ebao-next:quietchat:channel:1"); expect(line).toContain("ANNOUNCE_SKIP"); }); diff --git a/src/commands/agents.delete.test.ts b/src/commands/agents.delete.test.ts index 1a4fc8c3254..03e95ca0d3d 100644 --- a/src/commands/agents.delete.test.ts +++ b/src/commands/agents.delete.test.ts @@ -86,7 +86,7 @@ describe("agents delete command", () => { cfg, sessions: { "agent:ops:main": { sessionId: "sess-ops-main", updatedAt: 1 }, - "agent:ops:discord:direct:u1": { sessionId: "sess-ops-direct", updatedAt: 2 }, + "agent:ops:quietchat:direct:u1": { sessionId: "sess-ops-direct", updatedAt: 2 }, "agent:main:main": { sessionId: "sess-main", updatedAt: 3 }, }, }); @@ -119,8 +119,8 @@ describe("agents delete command", () => { cfg, sessions: { "agent:main:main": { sessionId: "sess-default-alias", updatedAt: 1 }, - "agent:ops:discord:direct:u1": { sessionId: "sess-ops-direct", updatedAt: 2 }, - "agent:main:discord:direct:u2": { sessionId: "sess-stale-main", updatedAt: 3 }, + "agent:ops:quietchat:direct:u1": { sessionId: "sess-ops-direct", updatedAt: 2 }, + "agent:main:quietchat:direct:u2": { sessionId: "sess-stale-main", updatedAt: 3 }, global: { sessionId: "sess-global", updatedAt: 4 }, }, }); @@ -129,7 +129,7 @@ describe("agents delete command", () => { expect(runtime.exit).not.toHaveBeenCalled(); expectSessionStore(storePath, { - "agent:main:discord:direct:u2": { sessionId: "sess-stale-main", updatedAt: 3 }, + "agent:main:quietchat:direct:u2": { sessionId: "sess-stale-main", updatedAt: 3 }, global: { sessionId: "sess-global", updatedAt: 4 }, }); }); @@ -151,9 +151,9 @@ describe("agents delete command", () => { cfg, sessions: { main: { sessionId: "sess-main", updatedAt: 1 }, - "discord:direct:u1": { sessionId: "sess-main-direct", updatedAt: 2 }, + "quietchat:direct:u1": { sessionId: "sess-main-direct", updatedAt: 2 }, "agent:ops:main": { sessionId: "sess-ops-main", updatedAt: 3 }, - "agent:ops:discord:direct:u2": { sessionId: "sess-ops-direct", updatedAt: 4 }, + "agent:ops:quietchat:direct:u2": { sessionId: "sess-ops-direct", updatedAt: 4 }, }, }); @@ -162,7 +162,7 @@ describe("agents delete command", () => { expect(runtime.exit).not.toHaveBeenCalled(); expectSessionStore(storePath, { main: { sessionId: "sess-main", updatedAt: 1 }, - "discord:direct:u1": { sessionId: "sess-main-direct", updatedAt: 2 }, + "quietchat:direct:u1": { sessionId: "sess-main-direct", updatedAt: 2 }, }); }); }); diff --git a/src/commands/sessions.test.ts b/src/commands/sessions.test.ts index 3a1571bb91a..881e4c06283 100644 --- a/src/commands/sessions.test.ts +++ b/src/commands/sessions.test.ts @@ -53,7 +53,7 @@ describe("sessionsCommand", () => { it("shows placeholder rows when tokens are missing", async () => { const store = writeStore({ - "discord:group:demo": { + "quietchat:group:demo": { sessionId: "xyz", updatedAt: Date.now() - 5 * 60_000, thinkingLevel: "high", @@ -65,7 +65,7 @@ describe("sessionsCommand", () => { fs.rmSync(store); - const row = logs.find((line) => line.includes("discord:group:demo")) ?? ""; + const row = logs.find((line) => line.includes("quietchat:group:demo")) ?? ""; expect(row).toContain("unknown/32k (?%)"); expect(row).toContain("think:high"); expect(row).toContain("5m ago"); @@ -82,7 +82,7 @@ describe("sessionsCommand", () => { totalTokensFresh: true, model: "pi:opus", }, - "discord:group:demo": { + "quietchat:group:demo": { sessionId: "xyz", updatedAt: Date.now() - 5 * 60_000, inputTokens: 20, @@ -99,7 +99,7 @@ describe("sessionsCommand", () => { }>; }>(sessionsCommand, store); const main = payload.sessions?.find((row) => row.key === "main"); - const group = payload.sessions?.find((row) => row.key === "discord:group:demo"); + const group = payload.sessions?.find((row) => row.key === "quietchat:group:demo"); expect(main?.totalTokens).toBe(2000); expect(main?.totalTokensFresh).toBe(true); expect(group?.totalTokens).toBeNull(); diff --git a/src/commands/status.command-report-data.test.ts b/src/commands/status.command-report-data.test.ts index afb4d724a81..53234de9f59 100644 --- a/src/commands/status.command-report-data.test.ts +++ b/src/commands/status.command-report-data.test.ts @@ -39,7 +39,7 @@ describe("buildStatusCommandReportData", () => { ); expect(result.pluginCompatibilityLines).toEqual([" warn(WARN) legacy"]); expect(result.pairingRecoveryLines[0]).toBe("warn(Gateway pairing approval required.)"); - expect(result.channelsRows[0]?.Channel).toBe("Discord"); + expect(result.channelsRows[0]?.Channel).toBe("QuietChat"); expect(result.sessionsRows[0]?.Cache).toBe("cache ok"); expect(result.healthRows?.[0]).toEqual({ Item: "Gateway", diff --git a/src/commands/status.command-sections.test.ts b/src/commands/status.command-sections.test.ts index 89b102344f4..84da78a74f3 100644 --- a/src/commands/status.command-sections.test.ts +++ b/src/commands/status.command-sections.test.ts @@ -116,11 +116,11 @@ describe("status.command-sections", () => { const rows = buildStatusHealthRows({ health: { durationMs: 42 } as HealthSummary, formatHealthChannelLines: () => [ - "Telegram: OK · ready", - "Slack: failed · auth", - "Discord: not configured", + "QuietChat: OK · ready", + "WorkChat: failed · auth", + "Forum: not configured", "Matrix: linked", - "Signal: not linked", + "Pager: not linked", ], ok: (value) => `ok(${value})`, warn: (value) => `warn(${value})`, @@ -129,11 +129,11 @@ describe("status.command-sections", () => { expect(rows).toEqual([ { Item: "Gateway", Status: "ok(reachable)", Detail: "42ms" }, - { Item: "Telegram", Status: "ok(OK)", Detail: "OK · ready" }, - { Item: "Slack", Status: "warn(WARN)", Detail: "failed · auth" }, - { Item: "Discord", Status: "muted(OFF)", Detail: "not configured" }, + { Item: "QuietChat", Status: "ok(OK)", Detail: "OK · ready" }, + { Item: "WorkChat", Status: "warn(WARN)", Detail: "failed · auth" }, + { Item: "Forum", Status: "muted(OFF)", Detail: "not configured" }, { Item: "Matrix", Status: "ok(LINKED)", Detail: "linked" }, - { Item: "Signal", Status: "warn(UNLINKED)", Detail: "not linked" }, + { Item: "Pager", Status: "warn(UNLINKED)", Detail: "not linked" }, ]); }); diff --git a/src/commands/status.scan-overview.test.ts b/src/commands/status.scan-overview.test.ts index 21376a83485..d44f3508514 100644 --- a/src/commands/status.scan-overview.test.ts +++ b/src/commands/status.scan-overview.test.ts @@ -91,7 +91,7 @@ describe("collectStatusScanOverview", () => { skipColdStartNetworkChecks: false, }); mocks.callGateway.mockResolvedValue({ channelAccounts: {} }); - mocks.collectChannelStatusIssues.mockReturnValue([{ channel: "signal", message: "boom" }]); + mocks.collectChannelStatusIssues.mockReturnValue([{ channel: "quietchat", message: "boom" }]); mocks.buildChannelsTable.mockResolvedValue({ rows: [], details: [] }); }); @@ -117,7 +117,7 @@ describe("collectStatusScanOverview", () => { sourceConfig: { session: {} }, }), ); - expect(result.channelIssues).toEqual([{ channel: "signal", message: "boom" }]); + expect(result.channelIssues).toEqual([{ channel: "quietchat", message: "boom" }]); }); it("skips channels.status when the gateway is unreachable", async () => { diff --git a/src/commands/status.scan.config-shared.test.ts b/src/commands/status.scan.config-shared.test.ts index 45924659bc1..00ecc2696b7 100644 --- a/src/commands/status.scan.config-shared.test.ts +++ b/src/commands/status.scan.config-shared.test.ts @@ -36,9 +36,9 @@ describe("status.scan.config-shared", () => { }); it("skips read/resolve on fast-json cold-start outside tests", async () => { - const readBestEffortConfig = vi.fn(async () => ({ channels: { telegram: {} } })); + const readBestEffortConfig = vi.fn(async () => ({ channels: { quietchat: {} } })); const resolveConfig = vi.fn(async () => ({ - resolvedConfig: { channels: { telegram: {} } }, + resolvedConfig: { channels: { quietchat: {} } }, diagnostics: ["resolved"], })); @@ -61,8 +61,8 @@ describe("status.scan.config-shared", () => { }); it("still reads and resolves during tests even when the config path is missing", async () => { - const sourceConfig = { channels: { telegram: {} } }; - const resolvedConfig = { channels: { telegram: {} } }; + const sourceConfig = { channels: { quietchat: {} } }; + const resolvedConfig = { channels: { quietchat: {} } }; const readBestEffortConfig = vi.fn(async () => sourceConfig); const resolveConfig = vi.fn(async () => ({ resolvedConfig, diff --git a/src/commands/status.test-support.ts b/src/commands/status.test-support.ts index cab3743492c..4e72f261fde 100644 --- a/src/commands/status.test-support.ts +++ b/src/commands/status.test-support.ts @@ -141,7 +141,7 @@ export function createStatusLastHeartbeat(): HeartbeatEventPayload { return { ts: Date.now() - 30_000, status: "ok-token", - channel: "discord", + channel: "quietchat", accountId: "acct", }; } @@ -179,7 +179,7 @@ export const statusTestFormatting = { formatKTokens: (value: number) => `${Math.round(value / 1000)}k`, formatTokensCompact: () => "12k", formatPromptCacheCompact: () => "cache ok", - formatHealthChannelLines: () => ["Discord: OK · ready"], + formatHealthChannelLines: () => ["QuietChat: OK · ready"], formatPluginCompatibilityNotice: (notice: { message?: unknown }) => String(notice.message), formatUpdateAvailableHint: () => "update available", }; @@ -244,9 +244,9 @@ export function createStatusCommandReportDataParams( lastHeartbeat: createStatusLastHeartbeat(), agentStatus: baseStatusAgentStatus, channels: { - rows: [{ id: "discord", label: "Discord", enabled: true, state: "ok", detail: "ready" }], + rows: [{ id: "quietchat", label: "QuietChat", enabled: true, state: "ok", detail: "ready" }], }, - channelIssues: [{ channel: "discord", message: "warn msg" }], + channelIssues: [{ channel: "quietchat", message: "warn msg" }], memory: baseStatusMemory, memoryPlugin: baseStatusMemoryPlugin, pluginCompatibility: baseStatusPluginCompatibility, diff --git a/src/gateway/server-chat.agent-events.test.ts b/src/gateway/server-chat.agent-events.test.ts index 99fc9b1737f..0e5886aca49 100644 --- a/src/gateway/server-chat.agent-events.test.ts +++ b/src/gateway/server-chat.agent-events.test.ts @@ -1341,7 +1341,7 @@ describe("agent event handler", () => { seq: 1, stream: "assistant", ts: Date.now(), - data: { text: "Reply from imessage" }, + data: { text: "Reply from quietchat" }, }); emitLifecycleEnd(handler, "run-hidden", 2); diff --git a/src/memory-host-sdk/host/session-files.test.ts b/src/memory-host-sdk/host/session-files.test.ts index 670e039be93..1e506067997 100644 --- a/src/memory-host-sdk/host/session-files.test.ts +++ b/src/memory-host-sdk/host/session-files.test.ts @@ -162,7 +162,7 @@ describe("buildSessionEntry", () => { }); it("strips inbound metadata envelope from user messages before normalization", async () => { - // Real Telegram inbound envelope: Conversation info + Sender blocks prepended + // Representative inbound envelope: Conversation info + Sender blocks prepended // to the actual user text. Without stripping, the JSON envelope dominates // the corpus entry and the user's real words get truncated by the // SESSION_INGESTION_MAX_SNIPPET_CHARS cap downstream. diff --git a/ui/src/ui/chat/message-normalizer.test.ts b/ui/src/ui/chat/message-normalizer.test.ts index c3ae43684fe..1b37981d1d4 100644 --- a/ui/src/ui/chat/message-normalizer.test.ts +++ b/ui/src/ui/chat/message-normalizer.test.ts @@ -383,7 +383,7 @@ describe("message-normalizer", () => { it("preserves top-level sender labels", () => { const result = normalizeMessage({ role: "user", - content: "Hello from Telegram", + content: "Hello from QuietChat", senderLabel: "Iris", }); diff --git a/ui/src/ui/chat/slash-command-executor.node.test.ts b/ui/src/ui/chat/slash-command-executor.node.test.ts index 85c846596c3..a16d83c6adc 100644 --- a/ui/src/ui/chat/slash-command-executor.node.test.ts +++ b/ui/src/ui/chat/slash-command-executor.node.test.ts @@ -207,7 +207,7 @@ describe("executeSlashCommand /kill", () => { spawnedBy: "agent:main:subagent:mine", }), row("agent:main:subagent:other-root", { - spawnedBy: "agent:main:discord:dm:alice", + spawnedBy: "agent:main:quietchat:dm:alice", }), ], };