test: use synthetic agent channel fixtures

This commit is contained in:
Peter Steinberger
2026-04-21 01:14:52 +01:00
parent 3f274006cd
commit e8898bb6c1
7 changed files with 9 additions and 9 deletions

View File

@@ -78,7 +78,7 @@ describe("startAcpSpawnParentStreamRelay", () => {
it("relays assistant progress and completion to the parent session", () => {
const deliveryContext = {
channel: "telegram",
channel: "forum",
to: "-1001234567890",
accountId: "default",
threadId: 1122,

View File

@@ -36,7 +36,7 @@ function createTestRunRecord(overrides: Partial<SubagentRunRecord> = {}): Subage
return {
runId: "run-1",
childSessionKey: "agent:main:subagent:test-session-1",
requesterSessionKey: "agent:main:signal:direct:+1234567890",
requesterSessionKey: "agent:main:quietchat:direct:+1234567890",
requesterDisplayKey: "main",
task: "Test task: implement feature X",
cleanup: "delete",

View File

@@ -104,7 +104,7 @@ describe("spawnSubagentDirect filename validation", () => {
const ctx = {
agentSessionKey: "agent:main:main",
agentChannel: "telegram" as const,
agentChannel: "forum" as const,
agentAccountId: "123",
agentTo: "456",
};

View File

@@ -186,15 +186,15 @@ describe("spawnSubagentDirect thread binding delivery", () => {
{
status: "active",
conversation: {
channel: "feishu",
channel: "collabchat",
accountId: "work",
conversationId: "oc_dm_chat_1",
conversationId: "collab_dm_1",
},
},
],
};
currentDeliveryTargetResolver = () => ({
to: "channel:oc_dm_chat_1",
to: "channel:collab_dm_1",
});
const result = await spawnSubagentDirect(

View File

@@ -55,7 +55,7 @@ describe("tool mutation helpers", () => {
it("exposes mutation state for downstream payload rendering", () => {
expect(
buildToolMutationState("message", { action: "send", to: "telegram:1" }).mutatingAction,
buildToolMutationState("message", { action: "send", to: "forum:1" }).mutatingAction,
).toBe(true);
expect(buildToolMutationState("browser", { action: "list" }).mutatingAction).toBe(false);
expect(

View File

@@ -166,7 +166,7 @@ describe("createSessionVisibilityGuard", () => {
});
expect(guard.check("agent:main:main")).toEqual({ allowed: true });
expect(guard.check("agent:main:telegram:group:1")).toEqual({
expect(guard.check("agent:main:forum:group:1")).toEqual({
allowed: false,
status: "forbidden",
error:

View File

@@ -119,7 +119,7 @@ describe("session reference shape detection", () => {
expect(looksLikeSessionKey("agent:main:main")).toBe(true);
expect(looksLikeSessionKey("cron:daily-report")).toBe(true);
expect(looksLikeSessionKey("node:macbook")).toBe(true);
expect(looksLikeSessionKey("telegram:group:123")).toBe(true);
expect(looksLikeSessionKey("forum:group:123")).toBe(true);
expect(looksLikeSessionKey("random-slug")).toBe(false);
});