Two portability bugs, both found by pre-flighting a second machine (kdmirah,
a Debian LXC) rather than by reading the script again.
1. `systemctl` existing does not mean a user bus is reachable. Inside an LXC,
over `su`, or with no logind session, `systemctl --user` fails with
"Failed to connect to user scope bus". The old check asked whether the
binary was on PATH, then ran `systemctl --user daemon-reload` under
`set -euo pipefail` — so the install ABORTED halfway, after the venv and
before the hermes wiring. It now asks the real question,
`systemctl --user show-environment`, and on failure installs no units, says
why (naming XDG_RUNTIME_DIR and the usual causes), prints the three
commands to run by hand, and continues to hermes.
2. The hermes interpreter was hardcoded to this box's layout,
/usr/local/lib/hermes-agent/venv/bin/python. kdmirah installs hermes under
~/.local/bin with its venv at ~/.hermes/hermes-agent/venv. Both are bash
wrappers that exec their python, so the path is now read out of the wrapper
(with a pip console-script shebang as the second shape). Verified against
both machines: each derives its own interpreter and each reports mcp present.
Also: the closing summary no longer prints the dashboard URL and
`journalctl --user -u socialmag-refresh` when no units were installed. Pointing
someone at a journal for a unit that was never created is the same class of lie
as a silent fallback — it reads as working and answers with nothing.
Both branches fired in a sandbox with a fake HOME and two stub systemctls, one
that answers show-environment and one that refuses it. Both exit 0; the
refusing one installs nothing, warns loudly, and still registers hermes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A clone + ./install.sh + ./launch-brave.sh + sign in once. Nothing else.
pyproject.toml declares the one real dependency (websockets) and maps the
repo-root-is-the-package layout, which retires the PYTHONPATH=<parent> line
every unit used to carry.
cli.py backs three console scripts. They exist because `python3 -m socialmag`
run from INSIDE a clone dies at `import asyncio`: the repo root is the package
dir, so it ships selectors.py and queue.py, and python puts the current
directory first on sys.path. `cd socialmag` is the first thing anyone does
after a clone, so the documented workaround failed at exactly the moment it
would be tried. A generated bin/ script never puts cwd on sys.path.
The same trap bit `python3 -m venv` inside install.sh — the installer was
broken by the thing it exists to fix. Every python3 call now runs from /.
deploy/user/*.in replaces root system units with systemd --user templates:
no User=, WantedBy=default.target, venv paths, @REPO@/@VENV@/@CDP_ENDPOINT@
substituted at install time. deploy/home/ is untouched and still live here.
launch-brave.sh carries --disable-background-timer-throttling. That is
load-bearing, not tidiness: five of six platforms are read in a hidden tab, and
a throttled background tab stops running the timers those pages use to fetch
their own data — the reads come back empty with no error.
install.sh checks the mcp package in hermes's own interpreter and refuses to
continue without it. Hermes treats mcp as optional and silently no-ops the
whole subsystem when it is missing, so a server that never loaded looks exactly
like one that loaded and did nothing.
It will not merge into an existing mcp_servers: key — it backs up config.yaml
and appends only when the key is absent, otherwise it prints the block. Blind
YAML merging is how someone's other servers disappear.
Verified end-to-end in a sandbox with a fake HOME and stubbed systemctl:
real MCP initialize handshake from inside the repo dir returns all 7 tools;
hermes's own yaml parser re-reads the written config with every pre-existing
key intact; a second run leaves the mcp_servers key count at 1; launch-brave.sh
exits 1 against a busy port; no unsubstituted @PLACEHOLDER@ in any rendered unit.
Not fixed, pre-existing: server.py reports SERVER_VERSION 0.1.0 while the repo
is at v0.7. The handshake shows 0.1.0.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>