fix(core): don't override source in custom provider loaders
This commit is contained in:
parent
c323d96deb
commit
5993a098b4
2 changed files with 15 additions and 15 deletions
|
|
@ -46,9 +46,10 @@ test("provider loaded from env variable", async () => {
|
|||
fn: async () => {
|
||||
const providers = await Provider.list()
|
||||
expect(providers["anthropic"]).toBeDefined()
|
||||
// Note: source becomes "custom" because CUSTOM_LOADERS run after env loading
|
||||
// and anthropic has a custom loader that merges additional options
|
||||
expect(providers["anthropic"].source).toBe("custom")
|
||||
// Provider should retain its connection source even if custom loaders
|
||||
// merge additional options.
|
||||
expect(providers["anthropic"].source).toBe("env")
|
||||
expect(providers["anthropic"].options.headers["anthropic-beta"]).toBeDefined()
|
||||
},
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue