fix: hivectl choom passes the harness --settings/--mcp-config/--system-prompt-file so claude gets settings + tools + persona
This commit is contained in:
parent
ded7474b2b
commit
07e8f442cb
3 changed files with 64 additions and 28 deletions
|
|
@ -281,7 +281,7 @@ Open an interactive Claude session inside an agent container.
|
|||
|
||||
Replaces the current process with `machinectl shell <name>@h-<name>` running `claude --continue` from the agent's state dir — drops the operator straight into the agent's live Claude session with its full loaded context and persona. Requires root (same as all machinectl shell operations) and the container must be running.
|
||||
|
||||
The session is entered **as the agent user** (not root): claude reads its OAuth credentials + settings from the agent's `/home/<name>/.claude`, and the working directory is set to the agent's state dir (`/agents/<name>/state`) so `--continue` resumes the same per-project session the harness runs. Entering as root (the `machinectl shell` default) is what loses both.
|
||||
To match the harness exactly, choom enters **as the agent user** (not root) so claude reads the OAuth credentials from the agent's `/home/<name>/.claude`; runs from the agent's state dir (`/agents/<name>/state`) so `--continue` resumes the right per-project session and `CLAUDE.md` loads; and passes the same `--settings` / `--mcp-config` / `--system-prompt-file` the harness writes to `/run/hive-config/` (settings, MCP tools, role prompt). Entering as root (the `machinectl shell` default) loses all of it.
|
||||
|
||||
Pass `--fresh` to start a new Claude session instead of continuing the most recent one.
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue