File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -1116,11 +1116,24 @@ export const useSendMessage = ({
11161116 ] of spawnAgentsMapRef . current . entries ( ) ) {
11171117 const eventType = event . agentType || ''
11181118 const storedType = info . agentType || ''
1119- // Match if exact match, or if eventType ends with storedType (e.g., 'codebuff/file-picker@0.0.2' matches 'file-picker')
1120- const isMatch =
1121- eventType === storedType ||
1122- ( eventType . includes ( '/' ) &&
1123- eventType . split ( '/' ) [ 1 ] ?. split ( '@' ) [ 0 ] === storedType )
1119+
1120+ // Extract base names without version or scope
1121+ // e.g., 'codebuff/file-picker@0.0.2' -> 'file-picker'
1122+ // 'file-picker' -> 'file-picker'
1123+ const getBaseName = ( type : string ) => {
1124+ if ( type . includes ( '/' ) ) {
1125+ // Handle scoped names like 'codebuff/file-picker@0.0.2'
1126+ return type . split ( '/' ) [ 1 ] ?. split ( '@' ) [ 0 ] || type
1127+ }
1128+ // Handle simple names, possibly with version
1129+ return type . split ( '@' ) [ 0 ]
1130+ }
1131+
1132+ const eventBaseName = getBaseName ( eventType )
1133+ const storedBaseName = getBaseName ( storedType )
1134+
1135+ // Match if base names are the same
1136+ const isMatch = eventBaseName === storedBaseName
11241137 if ( isMatch ) {
11251138 logger . info (
11261139 {
You can’t perform that action at this time.
0 commit comments