Skip to content

Commit cc67ed7

Browse files
committed
Preserve bifrostVirtualKey when re-saving a provider without the form field
The settings form no longer exposes Bifrost, but re-editing a provider must not drop a previously stored virtual-key flag used for x-bf-vk routing.
1 parent b103ff9 commit cc67ed7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/config/providers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ export function buildProviderEntry(
4141
...(apiKey !== undefined && apiKey.length > 0 ? { apiKey } : {}),
4242
models: submission.models,
4343
...(submission.defaultModel !== undefined ? { defaultModel: submission.defaultModel } : {}),
44-
...(submission.bifrostVirtualKey === true ? { bifrostVirtualKey: true } : {}),
44+
// Form no longer exposes Bifrost; keep any previously stored flag on edit so
45+
// re-saving a provider does not silently drop x-bf-vk routing.
46+
...(submission.bifrostVirtualKey === true || existing?.bifrostVirtualKey === true
47+
? { bifrostVirtualKey: true }
48+
: {}),
4549
};
4650
const catalog = currentCatalog
4751
.filter((p) => p.name !== submission.name && p.name !== submission.originalName)

0 commit comments

Comments
 (0)