fix: profile creation fallback when hermes_cli unavailable (Docker)

When hermes-agent is not discoverable (common in Docker), create_profile_api()
raised a hard RuntimeError while list and delete already had manual fallbacks.

Changes:
- Add _create_profile_fallback() that bootstraps profile directory structure
  directly (matching upstream hermes_cli.profiles: 8 subdirs + config clone)
- Extract _validate_profile_name() so validation works without hermes_cli
- Add constants _PROFILE_ID_RE, _PROFILE_DIRS, _CLONE_CONFIG_FILES matching
  upstream hermes-agent
- Remove :ro from docker-compose.yml hermes home mount so profiles dir is
  writable inside the container

Closes #44

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nathan Esquenazi
2026-04-03 13:00:28 -07:00
parent b03ddf78c9
commit 16553be59d
2 changed files with 62 additions and 14 deletions

View File

@@ -8,8 +8,8 @@ services:
volumes:
# Persist session data, settings, and projects across restarts
- hermes-data:/data
# Mount hermes-agent for full agent features (optional)
- ${HERMES_HOME:-${HOME}/.hermes}:/root/.hermes:ro
# Mount hermes home for agent features and profile management
- ${HERMES_HOME:-${HOME}/.hermes}:/root/.hermes
environment:
- HERMES_WEBUI_HOST=0.0.0.0
- HERMES_WEBUI_PORT=8787