From 5c6699ab72c28380e59286fb8a770e0cf2a657cb Mon Sep 17 00:00:00 2001 From: Upstream <128236540+Upstream17@users.noreply.github.com> Date: Wed, 29 Apr 2026 20:54:17 +0800 Subject: [PATCH] fix(profiles): normalize profile names to lowercase before sending to hermes-agent (#302) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Profile name inputs accepted uppercase letters (e.g. 'MyConfig') but hermes-agent's backend validation only allows [a-z0-9_-], causing 'Invalid profile name' errors when creating or renaming profiles. Changes: - ProfileCreateModal: filter and lowercase input on @input - ProfileRenameModal: same fix + change from v-model to :value + @input - en.ts: update placeholder text to clarify 'lowercase letters' - zh.ts: update placeholder text to clarify '小写字母' Before: input 'MyConfig' was sent unchanged → backend error After: input 'MyConfig' is normalized to 'myconfig' → success Co-authored-by: HJW --- .../src/components/hermes/profiles/ProfileCreateModal.vue | 2 +- .../src/components/hermes/profiles/ProfileRenameModal.vue | 3 ++- packages/client/src/i18n/locales/en.ts | 4 ++-- packages/client/src/i18n/locales/zh.ts | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/hermes/profiles/ProfileCreateModal.vue b/packages/client/src/components/hermes/profiles/ProfileCreateModal.vue index 72fd041..6c01bba 100644 --- a/packages/client/src/components/hermes/profiles/ProfileCreateModal.vue +++ b/packages/client/src/components/hermes/profiles/ProfileCreateModal.vue @@ -69,7 +69,7 @@ function handleClose() { diff --git a/packages/client/src/components/hermes/profiles/ProfileRenameModal.vue b/packages/client/src/components/hermes/profiles/ProfileRenameModal.vue index aa09dbb..f66094f 100644 --- a/packages/client/src/components/hermes/profiles/ProfileRenameModal.vue +++ b/packages/client/src/components/hermes/profiles/ProfileRenameModal.vue @@ -56,8 +56,9 @@ function handleClose() { diff --git a/packages/client/src/i18n/locales/en.ts b/packages/client/src/i18n/locales/en.ts index 5bfd001..8b33fdc 100644 --- a/packages/client/src/i18n/locales/en.ts +++ b/packages/client/src/i18n/locales/en.ts @@ -366,9 +366,9 @@ export default { importSelectFile: 'Select archive file', importInvalidFile: 'Please select a valid archive (.tar.gz, .tgz, .gz, .zip)', name: 'Profile Name', - namePlaceholder: 'English letters, numbers, hyphens only', + namePlaceholder: 'Lowercase letters, numbers, hyphens only', newName: 'New Name', - newNamePlaceholder: 'Enter new name', + newNamePlaceholder: 'Lowercase letters, numbers, hyphens', cloneFromCurrent: 'Clone from current profile', cloneCleanupNotice: 'Cloning automatically skips exclusive platform credentials (Weixin / Telegram / Slack, etc.) to avoid conflicts with the source profile', cloneStrippedCredentials: 'Stripped {count} exclusive credential(s): {list}', diff --git a/packages/client/src/i18n/locales/zh.ts b/packages/client/src/i18n/locales/zh.ts index a6b7712..bd497d3 100644 --- a/packages/client/src/i18n/locales/zh.ts +++ b/packages/client/src/i18n/locales/zh.ts @@ -358,9 +358,9 @@ export default { importSelectFile: '选择归档文件', importInvalidFile: '请选择有效的归档文件 (.tar.gz, .tgz, .gz, .zip)', name: '配置名称', - namePlaceholder: '仅限英文、数字、连字符', + namePlaceholder: '仅限小写字母、数字、连字符', newName: '新名称', - newNamePlaceholder: '输入新名称', + newNamePlaceholder: '小写字母、数字、连字符', cloneFromCurrent: '从当前配置克隆', cloneCleanupNotice: '克隆时会自动跳过独占型平台凭据(Weixin / Telegram / Slack 等),避免与源配置冲突', cloneStrippedCredentials: '已清理 {count} 项独占凭据:{list}',