feat(gateway): hermes gateway migrate --multiplex / --standalone

Moves a per-profile-gateway install onto one multiplexed default gateway:
table-driven preflight (duplicate credential via the gateway's own
fingerprint; secondary port-binders without a /p/<profile>/ ingress),
--dry-run, apply (stop + uninstall each secondary's service, record it in
<default>/gateway_migration.json, flip gateway.multiplex_profiles through
the config API, restart/install the default on the same service manager,
verify served_profiles), and --standalone rollback from the manifest.
Idempotent; refuses cleanly when already multiplexed or blocked.

`hermes profile create` points at `hermes gateway restart` when a live
multiplexer is detected (the served set is snapshotted at startup).
This commit is contained in:
Teknium
2026-09-12 00:50:51 -07:00
parent bcdb49ac7b
commit e2fc493427
3 changed files with 25 additions and 2 deletions
+6 -1
View File
@@ -208,7 +208,12 @@ def _profile_create(args):
print("\nNext steps:")
print(f" {name} setup Configure API keys and model")
print(f" {name} chat Start chatting")
print(f" {name} gateway start Start the messaging gateway")
from hermes_cli.gateway_multiplex_served import live_default_gateway_pid, recorded_served_profiles
if live_default_gateway_pid() is not None and recorded_served_profiles() is not None:
# The multiplexer snapshots the profile set at startup: a new profile is served only after a restart.
print(" hermes gateway restart Serve this profile from the running multiplexed gateway")
else:
print(f" {name} gateway start Start the messaging gateway")
if clone or clone_all:
print(f"\n Edit {profile_dir_display}/.env for different API keys")
print(f" Edit {profile_dir_display}/SOUL.md for different personality")