mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:30:44 +00:00
test: use synthetic agent channel fixtures
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
};
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user