mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 22:04:30 +00:00
Tests/Typing: stabilize subagent completion routing changes
This commit is contained in:
committed by
Peter Steinberger
parent
8796c78b3d
commit
420d8c663c
@@ -245,7 +245,7 @@ describe("openclaw-tools: subagents (sessions_spawn lifecycle)", () => {
|
|||||||
}
|
}
|
||||||
| undefined;
|
| undefined;
|
||||||
expect(second?.sessionKey).toBe("agent:main:discord:group:req");
|
expect(second?.sessionKey).toBe("agent:main:discord:group:req");
|
||||||
expect(second?.deliver).toBe(true);
|
expect(second?.deliver).toBe(false);
|
||||||
expect(second?.message).toContain("subagent task");
|
expect(second?.message).toContain("subagent task");
|
||||||
|
|
||||||
const sendCalls = ctx.calls.filter((c) => c.method === "send");
|
const sendCalls = ctx.calls.filter((c) => c.method === "send");
|
||||||
@@ -297,7 +297,7 @@ describe("openclaw-tools: subagents (sessions_spawn lifecycle)", () => {
|
|||||||
// Second call: main agent trigger
|
// Second call: main agent trigger
|
||||||
const second = agentCalls[1]?.params as { sessionKey?: string; deliver?: boolean } | undefined;
|
const second = agentCalls[1]?.params as { sessionKey?: string; deliver?: boolean } | undefined;
|
||||||
expect(second?.sessionKey).toBe("agent:main:discord:group:req");
|
expect(second?.sessionKey).toBe("agent:main:discord:group:req");
|
||||||
expect(second?.deliver).toBe(true);
|
expect(second?.deliver).toBe(false);
|
||||||
|
|
||||||
// No direct send to external channel (main agent handles delivery)
|
// No direct send to external channel (main agent handles delivery)
|
||||||
const sendCalls = ctx.calls.filter((c) => c.method === "send");
|
const sendCalls = ctx.calls.filter((c) => c.method === "send");
|
||||||
@@ -365,8 +365,8 @@ describe("openclaw-tools: subagents (sessions_spawn lifecycle)", () => {
|
|||||||
const announceParams = agentCalls[1]?.params as
|
const announceParams = agentCalls[1]?.params as
|
||||||
| { accountId?: string; channel?: string; deliver?: boolean }
|
| { accountId?: string; channel?: string; deliver?: boolean }
|
||||||
| undefined;
|
| undefined;
|
||||||
expect(announceParams?.deliver).toBe(true);
|
expect(announceParams?.deliver).toBe(false);
|
||||||
expect(announceParams?.channel).toBe("whatsapp");
|
expect(announceParams?.channel).toBeUndefined();
|
||||||
expect(announceParams?.accountId).toBe("kev");
|
expect(announceParams?.accountId).toBeUndefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user