


























@@ -1691,6 +1691,45 @@ describe("gateway session utils", () => {
16911691});
1692169216931693test("listAgentsForGateway reports per-agent thinking defaults from the agent model", () => {
1694+const resolveDeepSeekThinkingProfile = vi.fn(() => ({
1695+levels: [
1696+{ id: "off" as const },
1697+{ id: "minimal" as const },
1698+{ id: "low" as const },
1699+{ id: "medium" as const },
1700+{ id: "high" as const },
1701+{ id: "xhigh" as const },
1702+],
1703+defaultLevel: "medium" as const,
1704+}));
1705+const registry = createEmptyPluginRegistry();
1706+registry.providers.push(
1707+{
1708+pluginId: "test-minimax",
1709+source: "test",
1710+provider: {
1711+id: "minimax",
1712+label: "MiniMax",
1713+auth: [],
1714+resolveThinkingProfile: () => ({
1715+levels: [{ id: "off" }],
1716+defaultLevel: "off",
1717+}),
1718+},
1719+},
1720+{
1721+pluginId: "test-deepseek",
1722+source: "test",
1723+provider: {
1724+id: "deepseek",
1725+label: "DeepSeek",
1726+auth: [],
1727+resolveThinkingProfile: resolveDeepSeekThinkingProfile,
1728+},
1729+},
1730+);
1731+setActivePluginRegistry(registry);
1732+16941733const cfg = {
16951734session: { mainKey: "main" },
16961735agents: {
@@ -1713,6 +1752,12 @@ describe("gateway session utils", () => {
17131752const agent = result.agents.find((row) => row.id === "investment-master");
1714175317151754expect(agent?.model).toEqual({ primary: "deepseek/deepseek-v4-flash" });
1755+expect(resolveDeepSeekThinkingProfile).toHaveBeenCalledWith(
1756+expect.objectContaining({
1757+provider: "deepseek",
1758+modelId: "deepseek-v4-flash",
1759+}),
1760+);
17161761expect(agent?.thinkingDefault).toBe("xhigh");
17171762expect(agent?.thinkingLevels?.map((level) => level.id)).toEqual(
17181763expect.arrayContaining(["off", "minimal", "low", "medium", "high", "xhigh"]),
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。