Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit 3cff061

Browse files
authored
fix: id separator for provider, model muxing rule (#360)
* fix: id format for provider, model muxing rule * refactor: replace separator and logic * fix: gh action cache version
1 parent 454dee9 commit 3cff061

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/actions/setup/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ runs:
1313

1414
- name: Cache dependencies
1515
id: cache
16-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
16+
uses: actions/cache@v4.2.2
1717
with:
1818
path: ./node_modules
1919
key: modules-${{ hashFiles('package-lock.json') }}

src/features/workspace/components/workspace-models-dropdown.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function groupModelsByProviderName(
3737
id: providerName,
3838
textValue: providerName,
3939
items: items.map((item) => ({
40-
id: `${item.provider_id}:${item.name}`,
40+
id: `${item.provider_id}@${item.name}`,
4141
textValue: item.name,
4242
})),
4343
}))
@@ -116,8 +116,10 @@ export function WorkspaceModelsDropdown({
116116
const selectedValue = v.values().next().value
117117
if (!selectedValue && typeof selectedValue !== 'string') return
118118
if (typeof selectedValue === 'string') {
119-
const [provider_id, modelName] = selectedValue.split(':')
120-
if (!provider_id || !modelName) return
119+
const atIndex = selectedValue.indexOf('@')
120+
const provider_id = selectedValue.slice(0, atIndex)
121+
const modelName = selectedValue.slice(atIndex + 1)
122+
if (atIndex === -1 && (!provider_id || !modelName)) return
121123
onChange({
122124
model: modelName,
123125
provider_id,

0 commit comments

Comments
 (0)