



























@@ -77,6 +77,8 @@ describe("realtime voice agent consult runtime", () => {
7777expect(runEmbeddedPiAgent).toHaveBeenCalledWith(
7878expect.objectContaining({
7979sessionKey: "voice:15550001234",
80+sandboxSessionKey: "agent:main:voice:15550001234",
81+agentId: "main",
8082messageProvider: "voice",
8183lane: "voice",
8284toolsAllow: ["read"],
@@ -89,6 +91,33 @@ describe("realtime voice agent consult runtime", () => {
8991);
9092});
919394+it("scopes sandbox resolution to the configured consult agent", async () => {
95+const { runtime, runEmbeddedPiAgent } = createAgentRuntime();
96+97+await consultRealtimeVoiceAgent({
98+cfg: {} as never,
99+agentRuntime: runtime as never,
100+logger: { warn: vi.fn() },
101+agentId: "voice",
102+sessionKey: "voice:15550001234",
103+messageProvider: "voice",
104+lane: "voice",
105+runIdPrefix: "voice-realtime-consult:call-1",
106+args: { question: "What should I say?" },
107+transcript: [],
108+surface: "a live phone call",
109+userLabel: "Caller",
110+});
111+112+expect(runEmbeddedPiAgent).toHaveBeenCalledWith(
113+expect.objectContaining({
114+sessionKey: "voice:15550001234",
115+sandboxSessionKey: "agent:voice:voice:15550001234",
116+agentId: "voice",
117+}),
118+);
119+});
120+92121it("returns a speakable fallback when the embedded agent has no visible text", async () => {
93122const warn = vi.fn();
94123const { runtime } = createAgentRuntime([{ text: "hidden", isReasoning: true }]);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。