Skip to content

Commit bf83be7

Browse files
committed
test(webviewMessageHandler): correct LiteLLM credential priority assertion
The test "prefers config values over message values for LiteLLM" was asserting the old || behavior. The handler now uses ?? so message.values takes precedence over saved config, matching the DeepSeek pattern and allowing unsaved settings UI state to be used during Sync Models.
1 parent c505a6b commit bf83be7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/core/webview/__tests__/webviewMessageHandler.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ describe("webviewMessageHandler - requestRouterModels", () => {
629629
})
630630
})
631631

632-
it("prefers config values over message values for LiteLLM", async () => {
632+
it("prefers message values over config values for LiteLLM", async () => {
633633
const mockModels: ModelRecord = {}
634634
mockGetModels.mockResolvedValue(mockModels)
635635

@@ -641,11 +641,11 @@ describe("webviewMessageHandler - requestRouterModels", () => {
641641
},
642642
})
643643

644-
// Verify config values are used over message values
644+
// Verify message values take precedence over saved config (current unsaved field state wins)
645645
expect(mockGetModels).toHaveBeenCalledWith({
646646
provider: "litellm",
647-
apiKey: "litellm-key", // From config
648-
baseUrl: "http://localhost:4000", // From config
647+
apiKey: "message-key", // From message.values
648+
baseUrl: "http://message-url", // From message.values
649649
})
650650
})
651651
})

0 commit comments

Comments
 (0)