From 2b966cc573250af02fc72826fdf7ec8058ca1fb9 Mon Sep 17 00:00:00 2001 From: paisley <8197966+su8su@users.noreply.github.com> Date: Tue, 3 Mar 2026 17:36:09 +0800 Subject: [PATCH] fix: resolve empty marketplace search results by supporting fallback regex parsing (#273) --- electron/gateway/clawhub.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/electron/gateway/clawhub.ts b/electron/gateway/clawhub.ts index 25cb2686a..e2366349b 100644 --- a/electron/gateway/clawhub.ts +++ b/electron/gateway/clawhub.ts @@ -163,7 +163,7 @@ export class ClawHubService { // Format could be: slug vversion description (score) // Or sometimes: slug vversion description - const match = cleanLine.match(/^(\S+)\s+v?(\d+\.\S+)\s+(.+)$/); + let match = cleanLine.match(/^(\S+)\s+v?(\d+\.\S+)\s+(.+)$/); if (match) { const slug = match[1]; const version = match[2]; @@ -179,6 +179,24 @@ export class ClawHubService { description, }; } + + // Fallback for new clawhub search format without version: + // slug name/description (score) + match = cleanLine.match(/^(\S+)\s+(.+)$/); + if (match) { + const slug = match[1]; + let description = match[2]; + + // Clean up score if present at the end + description = description.replace(/\(\d+\.\d+\)$/, '').trim(); + + return { + slug, + name: slug, + version: 'latest', // Fallback version since it's not provided + description, + }; + } return null; }).filter((s): s is ClawHubSkillResult => s !== null); } catch (error) {