From e0fcc0040bafe0c8a0c7b7ba7c122d29b2cdd164 Mon Sep 17 00:00:00 2001 From: ekko <152005280+EKKOLearnAI@users.noreply.github.com> Date: Wed, 13 May 2026 07:52:34 +0800 Subject: [PATCH] fix: parse `.env` and `SOUL.md` fields from `hermes profile show` output (#669) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The regex `^(\w[\w\s]*?)` could not match keys containing dots (`.env`, `SOUL.md`), so `hasEnv` and `hasSoulMd` were always `undefined` → false. Co-authored-by: Claude Opus 4.7 --- packages/server/src/services/hermes/hermes-cli.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/services/hermes/hermes-cli.ts b/packages/server/src/services/hermes/hermes-cli.ts index 8c9fb78..84298ec 100644 --- a/packages/server/src/services/hermes/hermes-cli.ts +++ b/packages/server/src/services/hermes/hermes-cli.ts @@ -428,7 +428,7 @@ export async function getProfile(name: string): Promise { const result: Record = {} for (const line of stdout.trim().split('\n')) { - const match = line.match(/^(\w[\w\s]*?):\s+(.+)$/) + const match = line.match(/^([^\s:]+):\s+(.+)$/) if (match) { result[match[1].trim().toLowerCase().replace(/\s+/g, '_')] = match[2].trim() } @@ -446,7 +446,7 @@ export async function getProfile(name: string): Promise { gateway: result.gateway || '', skills: parseInt(result.skills || '0', 10), hasEnv: result['.env'] === 'exists', - hasSoulMd: result.soul_md === 'exists', + hasSoulMd: result['soul.md'] === 'exists', } } catch (err: any) { if (err.code === 1 || err.status === 1) {