



























@@ -537,4 +537,62 @@ describe("createVoiceCallRuntime lifecycle", () => {
537537});
538538expect(runEmbeddedPiAgent).not.toHaveBeenCalled();
539539});
540+541+it("uses the configured realtime consult thinking level when set", async () => {
542+const config = createBaseConfig();
543+config.inboundPolicy = "allowlist";
544+config.realtime.enabled = true;
545+config.realtime.consultThinkingLevel = "low";
546+config.realtime.consultFastMode = true;
547+const sessionStore: Record<string, unknown> = {};
548+const runEmbeddedPiAgent = vi.fn(async () => ({
549+payloads: [{ text: "Done." }],
550+meta: {},
551+}));
552+const agentRuntime = {
553+defaults: { provider: "openai", model: "gpt-5.4" },
554+resolveAgentDir: vi.fn(() => "/tmp/agent"),
555+resolveAgentWorkspaceDir: vi.fn(() => "/tmp/workspace"),
556+resolveAgentIdentity: vi.fn(),
557+resolveThinkingDefault: vi.fn(() => "high"),
558+resolveAgentTimeoutMs: vi.fn(() => 30_000),
559+ensureAgentWorkspace: vi.fn(async () => {}),
560+session: {
561+resolveStorePath: vi.fn(() => "/tmp/sessions.json"),
562+loadSessionStore: vi.fn(() => sessionStore),
563+saveSessionStore: vi.fn(async () => {}),
564+updateSessionStore: vi.fn(async (_storePath, mutator) => mutator(sessionStore)),
565+resolveSessionFilePath: vi.fn(() => "/tmp/session.json"),
566+},
567+ runEmbeddedPiAgent,
568+};
569+mocks.managerGetCall.mockReturnValue({
570+callId: "call-1",
571+direction: "outbound",
572+from: "+15550001234",
573+to: "+15550009999",
574+transcript: [],
575+});
576+577+await createVoiceCallRuntime({
578+ config,
579+coreConfig: {} as CoreConfig,
580+agentRuntime: agentRuntime as never,
581+});
582+583+const handler = mocks.realtimeHandlerRegisterToolHandler.mock.calls[0]?.[1] as
584+| ((args: unknown, callId: string) => Promise<unknown>)
585+| undefined;
586+await expect(handler?.({ question: "Turn on the lights." }, "call-1")).resolves.toEqual({
587+text: "Done.",
588+});
589+590+expect(agentRuntime.resolveThinkingDefault).not.toHaveBeenCalled();
591+expect(runEmbeddedPiAgent).toHaveBeenCalledWith(
592+expect.objectContaining({
593+thinkLevel: "low",
594+fastMode: true,
595+}),
596+);
597+});
540598});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。