Skip to content

Commit 4bcfa84

Browse files
authored
Merge pull request #6008 from menloresearch/hotfix/regression-issue-with-colon-in-model-name
hotfix: regression issue with colon in model name
1 parent 8a7edbf commit 4bcfa84

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

web-app/src/hooks/__tests__/useThreads.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('useThreads', () => {
8888
})
8989

9090
expect(Object.keys(result.current.threads)).toHaveLength(2)
91-
expect(result.current.threads['thread1'].model.id).toEqual('thread1:free')
91+
expect(result.current.threads['thread1'].model.id).toEqual('thread1/free')
9292
expect(result.current.threads['thread1'].model.provider).toEqual('llamacpp')
9393
expect(result.current.threads['thread2'].model.id).toEqual('thread2/test')
9494
expect(result.current.threads['thread2'].model.provider).toEqual('llamacpp')

web-app/src/hooks/useThreads.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ export const useThreads = create<ThreadState>()((set, get) => ({
4444
'llamacpp'
4545
),
4646
// Cortex migration: take first two parts of the ID (the last is file name which is not needed)
47-
id: !thread.model?.id.endsWith(':free')
48-
? thread.model?.id.split(':').slice(0, 2).join(sep())
49-
: thread.model?.id,
47+
id:
48+
thread.model.provider === 'llama.cpp' ||
49+
thread.model.provider === 'llamacpp'
50+
? thread.model?.id.split(':').slice(0, 2).join(sep())
51+
: thread.model?.id,
5052
}
5153
: undefined,
5254
}

0 commit comments

Comments
 (0)