



























@@ -37,8 +37,13 @@ describe("buildInlineProviderModels", () => {
37373838const result = buildInlineProviderModels(providers);
393940-expect(result).toHaveLength(1);
41-expect(result[0].baseUrl).toBe("http://localhost:8000");
40+expect(result).toEqual([
41+expect.objectContaining({
42+id: "custom-model",
43+provider: "custom",
44+baseUrl: "http://localhost:8000",
45+}),
46+]);
4247});
43484449it("inherits api from provider when model does not specify it", () => {
@@ -52,8 +57,13 @@ describe("buildInlineProviderModels", () => {
52575358const result = buildInlineProviderModels(providers);
545955-expect(result).toHaveLength(1);
56-expect(result[0].api).toBe("anthropic-messages");
60+expect(result).toEqual([
61+expect.objectContaining({
62+id: "custom-model",
63+provider: "custom",
64+api: "anthropic-messages",
65+}),
66+]);
5767});
58685969it("model-level api takes precedence over provider-level api", () => {
@@ -67,8 +77,13 @@ describe("buildInlineProviderModels", () => {
67776878const result = buildInlineProviderModels(providers);
697970-expect(result).toHaveLength(1);
71-expect(result[0].api).toBe("anthropic-messages");
80+expect(result).toEqual([
81+expect.objectContaining({
82+id: "custom-model",
83+provider: "custom",
84+api: "anthropic-messages",
85+}),
86+]);
7287});
73887489it("inherits both baseUrl and api from provider config", () => {
@@ -118,8 +133,13 @@ describe("buildInlineProviderModels", () => {
118133119134const result = buildInlineProviderModels(providers);
120135121-expect(result).toHaveLength(1);
122-expect(result[0].headers).toEqual({ "User-Agent": "custom-agent/1.0" });
136+expect(result).toEqual([
137+expect.objectContaining({
138+id: "claude-sonnet-4-6",
139+provider: "proxy",
140+headers: { "User-Agent": "custom-agent/1.0" },
141+}),
142+]);
123143});
124144125145it("merges provider request headers into inline models", () => {
@@ -138,8 +158,13 @@ describe("buildInlineProviderModels", () => {
138158139159const result = buildInlineProviderModels(providers);
140160141-expect(result).toHaveLength(1);
142-expect(result[0].headers).toEqual({ "X-Tenant": "acme" });
161+expect(result).toEqual([
162+expect.objectContaining({
163+id: "proxy-model",
164+provider: "proxy",
165+headers: { "X-Tenant": "acme" },
166+}),
167+]);
143168});
144169145170it("keeps inline provider transport overrides once the llm transport adapter is available", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。