Skip to content

feat(setup-pstack): map pstack roles to advanced-delegation model routes - #14

Open
sdwilsh wants to merge 1 commit into
Cloeille:mainfrom
sdwilsh:setup-pstack-model-routes
Open

sdwilsh wants to merge 1 commit into
Cloeille:mainfrom
sdwilsh:setup-pstack-model-routes

Conversation

@sdwilsh

@sdwilsh sdwilsh commented Nov 13, 2026 •

Copy link
Copy Markdown

Hermes runs every delegate on one model unless the user installs the official advanced-delegation plugin. Upstream pstack lets each role run on its own model and this change has setup offer to install the plugin. When the user accepts, setup will map pstack roles to named model routes, allowing for a diversity of models that the upstream pstack desires.

What changed

  • Setup offers to enable or install advanced-delegation, based on its state.
  • With routes, setup writes pstack-worker, pstack-strongest, and two or more pstack-panel-* routes into delegation.backends.model_map.options (or none if the plugin isn't installed/enabled). The pstack- prefix keeps these routes apart from the user's routes.
  • When setup turns routes on and no default route is set, it sets the default to pstack-worker. When routes were already on, it leaves the default alone (trying to avoid surprise to the user).
  • Without routes, setup writes one delegate model, as before.

Scope

  • This PR changes setup only. I will have more PRs that make poteto-mode and the panel skills pick these routes (until then, every delegate runs on the default route). Setup fills pstack-worker from the current delegate model, or from the parent model when no delegate model is set. I can include the other changes here if desired.
  • Model detection no longer runs hermes model, an interactive picker that changes the default model. Setup uses the models in config and asks the user for others.

Blast Radius

Setup rewrites the whole route list, but it (should) only change only routes with the prefix pstack-. It is instructed to do this carefully to avoid leaking any sensitive config information to the model.

Verification

All runs used a scratch HERMES_HOME with redaction off, opaque keys in config and .env, and the skill's own code blocks.

  • No output showed a key.
  • First setup set pstack-worker as the default and turned routes on. With routes already on, the script kept a user route and its key, dropped a stale pstack-old route, and did not add a default.
  • An empty default and a user default fast stayed as they were.
  • A user route with api_key: ${MY_ROUTE_KEY} kept the reference.
  • With routes on and the plugin disabled, declining switched the backend to default and kept the user's routes in config.
  • A failed write, an empty route list, or a missing PyYAML stopped the script before it changed the config.
  • python3 scripts/check_refs.py passes.

@sdwilsh
sdwilsh marked this pull request as ready for review November 13, 2026 17:18
@sdwilsh
sdwilsh marked this pull request as draft November 13, 2026 17:20
## Why
Hermes runs every delegate on one model unless the user installs the
official `advanced-delegation` plugin. Upstream pstack lets each role
run on its own model. Setup now offers the plugin. When the user
accepts, setup maps pstack roles to named model routes.

## What changed
- Setup offers to enable or install `advanced-delegation`, based on its
  state. It asks before it enables a plugin the user disabled, and it
  continues with routes only when the plugin reports `enabled`.
- With routes, setup writes `pstack-worker`, `pstack-strongest`, and
  none or two or more `pstack-panel-*` routes. It drops other routes
  whose names start with `pstack-` and leaves every other route as it
  is.
- When setup turns routes on and no default route is set, it sets the
  default to `pstack-worker`. When routes were already on, it leaves
  the default alone.
- When `model_map` or `profile_routes` is on but the plugin is
  disabled or absent, Hermes refuses every subagent. Setup asks whether
  to turn the plugin on. If the user says no, setup switches the backend
  back to `default` and writes one delegate model, as before.
- Without routes, setup writes one delegate model, as before.
- The README and the setup guide describe both modes. The plugin
  version is 0.4.0.

## Scope
- This PR changes setup only. Later PRs make `poteto-mode` and the
  panel skills pick these routes. Until then, a delegate runs on the
  default route.
- With the plugin enabled, setup changes nothing for a user on
  `profile_routes`.
- Model detection no longer runs `hermes model`, an interactive picker
  that changes the default model. Setup uses the models in config and
  asks the user for others.

## Blast Radius
Setup rewrites the whole route list. One script reads the list from
`config.yaml` with PyYAML, merges it in memory, and writes it back. A
merge from `hermes config get` would replace `api_key` values with
masked placeholders, or with `--raw`, write `${VAR}` keys out of `.env`
into `config.yaml`.
Command output goes into the model's context, so no setup command
prints a key, even when `security.redact_secrets` is off.

## Verification
- In a scratch `HERMES_HOME` with redaction off and opaque keys, I ran
  the skill's step 1 commands and step 6 script. No output showed a
  key.
- First setup set `pstack-worker` as the default and turned routes on.
- With routes already on, the script kept a user route and its key,
  dropped a stale `pstack-old` route, and did not add a default.
- An empty default and a user default `fast` stayed as they were.
- An empty route list stopped the script before any write, and so did
  a missing PyYAML.
- A user route with `api_key: ${MY_ROUTE_KEY}` kept the reference.
- With routes on and the plugin declined, setup switched the backend to
  `default` and kept the user's routes in config.
- `python3 scripts/check_refs.py` passes.
@sdwilsh
sdwilsh force-pushed the setup-pstack-model-routes branch from 70d8552 to 0d617b4 Compare November 13, 2026 17:31
@sdwilsh
sdwilsh marked this pull request as ready for review November 13, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant