fix(m3-hermes): seed ai-memory hook credential for Hermes

The native hook command reads <data_dir>/auth-token, not the config's
bearer_token_file; without it every Hermes event was spooled with a 401.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
m3tam3reandClaude Fable 5.1 committed 2026-10-25 14:02:31 +01:00
1 parent c2601d5e70
commit a45e3e184b
1 file changed
+6 -3
+6 -3
View File
@@ -15,9 +15,11 @@
yamlPython = pkgs.python3.withPackages (ps: [ps.pyyaml]);
# ── ai-memory client (server: ./ai-memory.nix, same host) ─────────────
# Hooks and the MCP bridge read the bearer from [auth].bearer_token_file
# in the data dir's config.toml, so neither config.yaml nor the process
# environment ever carries the token.
# The MCP bridge reads the bearer from [auth].bearer_token_file in the
# data dir's config.toml; the native `hook` command only looks at
# <data_dir>/auth-token (what `install-hooks --apply` would seed), so that
# file is a symlink to the same secret. Neither config.yaml nor the
# process environment ever carries the token.
aiMemory = "${config.services.ai-memory.package}/bin/ai-memory";
aiMemoryUrl = "http://127.0.0.1:${toString (config.m3ta.ports.get "ai-memory")}";
aiMemoryDataDir = "/var/lib/hermes/.local/share/ai-memory";
@@ -42,6 +44,7 @@ in {
[auth]
bearer_token_file = "${config.age.secrets."ai-memory-hermes-token".path}"
''}"
"L+ ${aiMemoryDataDir}/auth-token - - - - ${config.age.secrets."ai-memory-hermes-token".path}"
# Scope marker: Hermes reports its process directory as cwd, so every
# assistant session lands in one project of the `home` workspace
# (coding checkouts below $HOME with their own marker still win).