Files
ansible/roles/mac/tasks/hermes-settings.yml
T
PhilandClaude Opus 5.5 20258e04f8 Mac: Hermes sandbox sees only ~/hermes; Cua skills via external_dirs
terminal.cwd "." resolved against each process's working directory, so
the dashboard's sandbox mounted / (the whole disk, writable) and the
gateway's mounted ~/.hermes (including .env). Point it at ~/hermes.

The cua-driver symlink in ~/.hermes/skills made Hermes give each sandbox
a temp copy of the skills and delete the previous copy, emptying running
sandboxes' skills (hermes-agent #53630). Read Cua's pack through
skills.external_dirs and remove the symlink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:12:16 -07:00

72 lines
2.9 KiB
YAML

# terminal.cwd: the folder the sandbox gets at /workspace. The Hermex Bot
# Chat session's saved folder points here too (set once with Hermes's
# update_session_cwd, since Hermes has no command for it).
- name: Hermes workspace folder
ansible.builtin.file:
path: "{{ hermes_workspace }}"
state: directory
mode: "0755"
# Replaced by skills.external_dirs (see group_vars). Only a symlink is
# removed; a real folder of that name is left alone.
- name: Look for the cua-driver skills symlink
ansible.builtin.stat:
path: "{{ ansible_user_dir }}/.hermes/skills/cua-driver"
register: hermes_cua_skills_link
- name: Remove the cua-driver skills symlink
ansible.builtin.file:
path: "{{ ansible_user_dir }}/.hermes/skills/cua-driver"
state: absent
when: hermes_cua_skills_link.stat.islnk | default(false)
notify: [Restart Hermes gateway, Restart Hermes dashboard]
# Secrets go in first, so servers and settings that reference them
# (${VAR}) find them when the gateway restarts.
- name: Secrets in Hermes's .env
ansible.builtin.lineinfile:
path: "{{ hermes_env }}"
regexp: "^{{ item.key }}="
line: "{{ item.key }}='{{ item.value }}'"
mode: "0600"
loop: "{{ hermes_env_secrets | default({}) | dict2items }}"
no_log: true
diff: false
notify: [Restart Hermes gateway, Restart Hermes dashboard]
# Compared against ~/.hermes/config.yaml itself: `hermes config get` prints
# defaults for unset keys, exits 1 for keys without a default, and fills in
# and masks ${VAR} references, so it can't tell what's actually set.
- name: Read Hermes's config.yaml
ansible.builtin.slurp:
src: "{{ ansible_user_dir }}/.hermes/config.yaml"
register: hermes_config_file
- name: Note the current value of each setting
ansible.builtin.set_fact:
hermes_settings_current: >-
{%- set config = hermes_config_file.content | b64decode | from_yaml -%}
{%- set current = {} -%}
{%- for key in hermes_settings -%}
{%- set node = namespace(value=config) -%}
{%- for part in key.split('.') -%}
{%- set node.value = node.value[part] if (node.value is mapping and part in node.value) else none -%}
{%- endfor -%}
{%- set _ = current.update({key: node.value}) -%}
{%- endfor -%}
{{ current }}
# `hermes config set` takes JSON for lists, mappings and booleans.
- name: Set Hermes settings
ansible.builtin.command:
argv: >-
{{ [hermes_cli, 'config', 'set']
+ (['--force'] if item.key in hermes_settings_force | default([]) else [])
+ [item.key, item.value if item.value is string else item.value | to_json] }}
loop: "{{ hermes_settings | dict2items }}"
loop_control:
label: "{{ item.key }} = {{ item.value | to_json }}"
when: hermes_settings_current[item.key] != item.value
# The dashboard is a separate process with its own copy of the settings.
notify: [Restart Hermes gateway, Restart Hermes dashboard]