Skip to content

The agent that grows with you

fix: address community review — system default, clearable schema flag, UTC fallback

David Metcalfec8a4b18d348a
diff --git a/apps/desktop/src/app/settings/config-field.tsx b/apps/desktop/src/app/settings/config-field.tsx
index 7e5418b3070..7461b4b0c08 100644
--- a/apps/desktop/src/app/settings/config-field.tsx
+++ b/apps/desktop/src/app/settings/config-field.tsx
@@ -101,6 +101,7 @@ export function ConfigField({
if (selectOptions && schema.searchable) {
return row(
<SearchableSelect
+ clearLabel={schema.clearable ? c.systemDefault : undefined}
emptyMessage={c.noResults}
onChange={next => onChange(next)}
options={selectOptions.filter(o => o !== '')}
diff --git a/apps/desktop/src/app/settings/searchable-select.tsx b/apps/desktop/src/app/settings/searchable-select.tsx
index 855b2c4d568..260d905b985 100644
--- a/apps/desktop/src/app/settings/searchable-select.tsx
+++ b/apps/desktop/src/app/settings/searchable-select.tsx
@@ -21,13 +21,17 @@ export function SearchableSelect({
onChange,
options,
placeholder = 'Search…',
- emptyMessage = 'No results found.'
+ emptyMessage = 'No results found.',
+ clearLabel
}: {
value: string
onChange: (value: string) => void
options: string[]
placeholder?: string
emptyMessage?: string
+ /** When set, prepends a "clear" item that sets the value to ''.
+ * Matches the existing <Select> pattern of EMPTY_SELECT_VALUE + "(none)". */
+ clearLabel?: string
}) {
const [open, setOpen] = useState(false)
const triggerRef = useRef<HTMLButtonElement>(null)
@@ -85,6 +89,18 @@ export function SearchableSelect({
<CommandList>
<CommandEmpty>{emptyMessage}</CommandEmpty>
<CommandGroup>
+ {clearLabel && (
+ <CommandItem
+ onSelect={() => handleSelect('')}
+ value={clearLabel}
+ >
+ <Codicon
+ className={cn('mr-2 size-4', value === '' ? 'opacity-100' : 'opacity-0')}
+ name="check"
+ />
+ {clearLabel}
+ </CommandItem>
+ )}
{options.map(option => (
<CommandItem
key={option}
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 9c49faeec2a..c1f2f832cf1 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -540,6 +540,7 @@ export const en: Translations = {
commaSeparated: 'comma-separated values',
searchPlaceholder: 'Search…',
noResults: 'No results found',
+ systemDefault: 'System default',
loading: 'Loading Hermes configuration...',
emptyTitle: 'Nothing to configure',
emptyDesc: 'This section has no adjustable settings.',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 574f2a37654..b3f2a84ef08 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -447,6 +447,7 @@ export interface Translations {
commaSeparated: string
searchPlaceholder: string
noResults: string
+ systemDefault: string
loading: string
emptyTitle: string
emptyDesc: string
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 5e61888b4c5..cbb6bd72fb1 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -750,6 +750,7 @@ export const zh: Translations = {
commaSeparated: '逗号分隔的值',
searchPlaceholder: '搜索…',
noResults: '未找到结果',
+ systemDefault: '系统默认',
loading: '正在加载 Hermes 配置...',
emptyTitle: '无可配置项',
emptyDesc: '此分区没有可调整的设置。',
diff --git a/apps/desktop/src/types/hermes.ts b/apps/desktop/src/types/hermes.ts
index da0160f2e70..bba14f145d7 100644
--- a/apps/desktop/src/types/hermes.ts
+++ b/apps/desktop/src/types/hermes.ts
@@ -5,6 +5,9 @@ export interface ConfigFieldSchema {
/** When true, renders a SearchableSelect (Popover + cmdk) instead of the
* closed `<Select>` dropdown. For large option lists like IANA timezones. */
searchable?: boolean
+ /** When true, a searchable select prepends a "clear" item that resets the
+ * value to ''. Matches the existing <Select> EMPTY_SELECT_VALUE pattern. */
+ clearable?: boolean
type?: 'boolean' | 'list' | 'number' | 'select' | 'string' | 'text'
}
diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py
index 5c1de9df75a..8925827637e 100644
--- a/hermes_cli/web_server.py
+++ b/hermes_cli/web_server.py
@@ -803,7 +803,7 @@ def _timezone_options() -> List[str]:
"""Return sorted IANA timezone identifiers, cached at import time."""
try:
import zoneinfo
- return sorted(zoneinfo.available_timezones())
+ return sorted(zoneinfo.available_timezones()) or ["UTC"]
except Exception: # pragma: no cover
return ["UTC"]
@@ -814,6 +814,7 @@ _SCHEMA_OVERRIDES: Dict[str, Dict[str, Any]] = {
"description": "IANA timezone (e.g. America/New_York). Blank uses the system timezone.",
"options": _timezone_options(),
"searchable": True,
+ "clearable": True,
},
"memory.provider": {
"type": "select",