Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/shared-adapter/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ function createGlobMatcher(pattern: string): (text: string) => boolean {
return (text: string) => text.includes(pattern)
}

const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$')
const source = pattern
.replace(/[.+?^${}()|[\]\\]/g, '\\$&')
.replace(/\*/g, '.*')
const regex = new RegExp(`(^|[:/_-])${source}($|[:/_-])`)
return (text: string) => regex.test(text)
}

Expand Down Expand Up @@ -182,9 +185,10 @@ const imageModelMatchers: ((text: string) => boolean)[] = [
'gpt-4.1',
'gpt-5',
'glm-*v',
'kimi-k2.5',
'kimi-k2.*',
'step3',
'grok-4'
'grok-4',
'ocr'
].map(createGlobMatcher)

// mimo-v2.5 supports image/audio; mimo-v2.5-pro does NOT (text only).
Expand Down
Loading