fix: hivectl choom passes the harness --settings/--mcp-config/--system-prompt-file so claude gets settings + tools + persona

This commit is contained in:
damocles 2026-06-05 22:16:00 +02:00 committed by mara
commit 07e8f442cb
3 changed files with 64 additions and 28 deletions

View file

@ -124,10 +124,19 @@ Without `--fresh`, `--continue` is passed so the operator joins the
agent's live context window. With `--fresh` a clean session starts.
The container must be running.
The session is entered **as the agent user**, not root: `machinectl
shell` defaults to root in the container, which would make claude read
`/root/.claude` (empty) instead of the agent's `/home/<name>/.claude`
where its OAuth credentials + settings live. choom prefixes the
machine with `<name>@` (the meta-flake sets the agent's unix user name
to its label) and `cd`s into `/agents/<name>/state` first so
`--continue` resolves the same per-project session the harness runs.
choom reproduces the harness's own claude invocation so the operator
lands in a faithful copy of the agent's environment:
- **as the agent user**, not root: `machinectl shell` defaults to root,
which would make claude read `/root/.claude` (empty) instead of the
agent's `/home/<name>/.claude` where its OAuth credentials live. choom
prefixes the machine with `<name>@` (the meta-flake sets the agent's
unix user name to its label).
- **from `/agents/<name>/state`**: `--continue` resolves the session for
that project dir and `CLAUDE.md` (the persona) loads from the cwd.
- **with the harness flags**: `--settings`, `--mcp-config`, and
`--system-prompt-file` from `/run/hive-config/` — the same files the
harness writes each turn — so the operator gets the agent's settings,
the hyperhive/matrix MCP tools (which `--continue` needs to replay a
tool-using history), and the role prompt. Each flag is included only
when its file exists.