Skip to content

The agent that grows with you

gateway: frame gateway.standalone as a TEMPORARY compatibility shim, not a kept topology

teknium19fe737aef2dd
diff --git a/gateway/run.py b/gateway/run.py
index 088e54d1154..7d1f33e6170 100644
--- a/gateway/run.py
+++ b/gateway/run.py
@@ -5494,11 +5494,12 @@ def _log_standalone_profiles_at_boot(runner) -> None:
if not getattr(runner.config, "multiplex_profiles", False):
return
from hermes_cli.profiles import profiles_to_serve, profile_is_standalone
+ from hermes_cli.gateway_multiplex_mode import STANDALONE_DEPRECATION_NOTICE
served = set(runner.served_profile_names())
for name, home in profiles_to_serve(True, include_standalone=True):
if name != "default" and name not in served and profile_is_standalone(home):
- logger.info("profile '%s' is standalone (gateway.standalone: true); not served by "
- "this gateway", name)
+ logger.warning("profile '%s' is standalone (gateway.standalone: true); not served by "
+ "this gateway. %s", name, STANDALONE_DEPRECATION_NOTICE)
except Exception:
logger.warning("standalone-profile boot notice failed", exc_info=True)
diff --git a/hermes_cli/gateway.py b/hermes_cli/gateway.py
index 5ceee1a3403..b5594027849 100644
--- a/hermes_cli/gateway.py
+++ b/hermes_cli/gateway.py
@@ -3788,9 +3788,11 @@ def _named_profile_refused_under_multiplexer(force: bool = False) -> bool:
print(f" HERMES_HOME outside profiles/) needs --force: hermes -p {suffix} gateway install --force")
print()
from hermes_constants import display_hermes_home
- print(" Or opt this profile out of the host gateway for good: set")
- print(f" gateway.standalone: true in {display_hermes_home(get_hermes_home())}/config.yaml.")
- print(" Wait for the host gateway to rescan (<=30s), or send its rescan-profiles control verb.")
+ from hermes_cli.gateway_multiplex_mode import STANDALONE_DEPRECATION_NOTICE
+ print(" Temporary compatibility path while multiplexing gaps are closed: set")
+ print(f" gateway.standalone: true in {display_hermes_home(get_hermes_home())}/config.yaml,")
+ print(" then wait for the host gateway to rescan (<=30s) or send its rescan-profiles control verb.")
+ print(f" ({STANDALONE_DEPRECATION_NOTICE})")
return True
@@ -5023,7 +5025,9 @@ def _cmd_status(args):
active_standalone = ((get_active_profile_name() or "default") != "default"
and profile_is_standalone(get_hermes_home()))
if active_standalone:
- print("standalone by config (gateway.standalone: true)")
+ from hermes_cli.gateway_multiplex_mode import STANDALONE_DEPRECATION_NOTICE
+ print("standalone by config (gateway.standalone: true) — temporary compatibility shim")
+ print(f" {STANDALONE_DEPRECATION_NOTICE}")
_windows_service_installed = is_windows() and _gw_windows().is_installed()
if not active_standalone and not snapshot.running and named_profile_served_by_running_multiplexer():
# Satellite profile: the default multiplexer is the live inbound process for it.
@@ -5074,7 +5078,7 @@ def _print_standalone_by_config() -> None:
served = {name for name, _home in profiles_to_serve(True)}
names = sorted(roster - served - {"default"})
if names:
- print(f"standalone by config: {', '.join(names)}")
+ print(f"standalone by config (temporary compatibility shim): {', '.join(names)}")
def _cmd_list(args):
diff --git a/hermes_cli/gateway_migrate.py b/hermes_cli/gateway_migrate.py
index 626ee2af038..c36b701a776 100644
--- a/hermes_cli/gateway_migrate.py
+++ b/hermes_cli/gateway_migrate.py
@@ -621,6 +621,8 @@ def format_plan(plan: MigrationPlan, *, dry_run: bool) -> list[str]:
if plan.standalone_by_config:
lines.append(f" Standalone by config (gateway.standalone: true), left alone: "
f"{', '.join(plan.standalone_by_config)}")
+ lines.append(" (temporary compatibility shim; remove the key and re-run once the gaps it "
+ "covers for you are fixed)")
lines.append("")
if plan.already_multiplexed:
lines.append(" ✓ The default gateway is already multiplexing"
diff --git a/hermes_cli/gateway_multiplex_mode.py b/hermes_cli/gateway_multiplex_mode.py
index d975667e6ab..b915645e899 100644
--- a/hermes_cli/gateway_multiplex_mode.py
+++ b/hermes_cli/gateway_multiplex_mode.py
@@ -28,6 +28,16 @@ logger = logging.getLogger(__name__)
SINGLE_PROFILE_REASON = "only one profile exists (nothing to multiplex)"
STANDALONE_PROFILE_REASON = "this profile is standalone (gateway.standalone: true); it serves only itself"
+#: ``gateway.standalone: true`` is a TEMPORARY backwards-compatibility shim, not a supported topology.
+#: It exists so fleets that lost per-profile gateways in the multiplex-only switch keep working while
+#: the remaining multiplexing gaps (per-profile stop/restart, WhatsApp bridge/relay on secondaries,
+#: dashboard scoping) are closed; it is removed once they are. Every surface that names the key
+#: prints this so nobody builds on it.
+STANDALONE_DEPRECATION_NOTICE = (
+ "gateway.standalone is a temporary compatibility shim while multiplexing gaps are fixed; "
+ "it will be removed once they are — plan to fold this profile with `hermes gateway migrate --multiplex`."
+)
+
#: ``gateway.multiplex_profiles: false`` is no longer an opt-out from the one-gateway-per-host
#: topology; it parses, it is reported, and it is ignored.
RETIRED_OPT_OUT_REASON = (
diff --git a/tests/hermes_cli/test_gateway_multiplex_refusal.py b/tests/hermes_cli/test_gateway_multiplex_refusal.py
index 37b895839a7..bc2517d4557 100644
--- a/tests/hermes_cli/test_gateway_multiplex_refusal.py
+++ b/tests/hermes_cli/test_gateway_multiplex_refusal.py
@@ -62,8 +62,9 @@ def test_non_standalone_refusal_names_the_opt_out(standalone_home):
(home / "config.yaml").write_text("{}\n", encoding="utf-8")
refused, out = _refusal(gw)
assert refused is True
- assert "Or opt this profile out of the host gateway for good" in out
+ assert "Temporary compatibility path" in out
assert "gateway.standalone: true" in out
+ assert "temporary compatibility shim" in out # the deprecation notice rides every mention
def test_setup_stale_host_record_names_rescan(standalone_home, monkeypatch, capsys):
diff --git a/tests/hermes_cli/test_gateway_multiplex_status.py b/tests/hermes_cli/test_gateway_multiplex_status.py
index 530a8c4951b..9cdf9d54a62 100644
--- a/tests/hermes_cli/test_gateway_multiplex_status.py
+++ b/tests/hermes_cli/test_gateway_multiplex_status.py
@@ -118,4 +118,4 @@ def test_default_status_lists_standalone_profiles(monkeypatch, tmp_path):
gw._gateway_command_inner(
SimpleNamespace(gateway_command="status", deep=False, full=False, system=False)
)
- assert "standalone by config: beta" in buf.getvalue()
+ assert "standalone by config (temporary compatibility shim): beta" in buf.getvalue()
diff --git a/tests/hermes_cli/test_windows_gateway_cold_start_desktop_lifecycle.py b/tests/hermes_cli/test_windows_gateway_cold_start_desktop_lifecycle.py
index e977b33abc8..191793d02c7 100644
--- a/tests/hermes_cli/test_windows_gateway_cold_start_desktop_lifecycle.py
+++ b/tests/hermes_cli/test_windows_gateway_cold_start_desktop_lifecycle.py
@@ -253,7 +253,7 @@ def _running_beta_pause_fixture(monkeypatch, tmp_path):
monkeypatch.setattr(cli_main, "_venv_launcher_ancestors", lambda pids: [])
monkeypatch.setattr(cli_main, "_wait_for_windows_update_gateway_exit", lambda pids, timeout: set())
monkeypatch.setattr(profiles_mod, "get_active_profile_name", lambda: "default")
- monkeypatch.setattr(profiles_mod, "profiles_to_serve", lambda multiplex: [(n, h) for n, h in homes.items() if n in ("default", "beta")])
+ monkeypatch.setattr(profiles_mod, "profiles_to_serve", lambda multiplex, **_kw: [(n, h) for n, h in homes.items() if n in ("default", "beta")])
monkeypatch.setattr(profiles_mod, "get_profile_dir", lambda name: homes[name])
# Resume side.
monkeypatch.setattr(cli_main, "_refresh_windows_gateway_launchers", lambda: None)
diff --git a/website/docs/user-guide/multi-profile-gateways.md b/website/docs/user-guide/multi-profile-gateways.md
index ff8e68922b4..210b36d4273 100644
--- a/website/docs/user-guide/multi-profile-gateways.md
+++ b/website/docs/user-guide/multi-profile-gateways.md
@@ -108,14 +108,14 @@ profile that opts out with `gateway.standalone: true`:
- `gateway.multiplex_profiles: false` is **retired**. It used to keep
per-profile gateways for good; now it resolves exactly like an unset key and
the gateway logs a warning pointing at `hermes gateway migrate --multiplex`.
- Use `gateway.standalone: true` for a deliberate per-profile gateway, or
- `--force` for the boundary cases below.
+ `--force` remains the path for the boundary cases below; `gateway.standalone:
+ true` is a temporary shim for fleets the switch broke, not a supported topology.
- `GATEWAY_MULTIPLEX_PROFILES` in the process environment overrides the
unset-key decision the same way an explicit `true` does.
- `gateway.standalone: true` in a **named** profile's own `config.yaml`
- (`profiles/<name>/config.yaml`) opts that profile out of the host multiplexer
- entirely: the host gateway does not serve it, and the profile runs its own
- gateway without `--force`. Its gateway serves only itself, even if
+ (`profiles/<name>/config.yaml`) is a **temporary compatibility shim** (see
+ [below](#temporary-gatewaystandalone-true)): the host gateway does not serve
+ that profile, and the profile runs its own gateway without `--force`. Its gateway serves only itself, even if
`multiplex_profiles: true` is also set (see
[No new per-profile gateways](#no-new-per-profile-gateways)). Set on the
default profile it is ignored with a warning — the default profile is the
@@ -136,8 +136,9 @@ only when no gateway runs.
One-process-per-profile is no longer a topology to *choose* implicitly: a named
profile's `gateway install` / `gateway start` refuses without `--force` (see
[No new per-profile gateways](#no-new-per-profile-gateways)). A profile that
-wants its own gateway opts out with `gateway.standalone: true` in its own
-`config.yaml`; where a real boundary blocks the fold — a fleet split across
+still needs its own gateway while a multiplexing gap is open can set the
+temporary `gateway.standalone: true` in its own `config.yaml`; where a real
+boundary blocks the fold — a fleet split across
UNIX users, or a `HERMES_HOME` outside `<default home>/profiles/` — every
profile keeps `--force` as its path.
@@ -196,9 +197,11 @@ a host gateway is running right now:
A separate per-profile gateway (for a fleet split across UNIX users or a
HERMES_HOME outside profiles/) needs --force: hermes -p coder gateway install --force
- Or opt this profile out of the host gateway for good: set
- gateway.standalone: true in profiles/coder/config.yaml.
- Wait for the host gateway to rescan (<=30s), or send its rescan-profiles control verb.
+ Temporary compatibility path while multiplexing gaps are closed: set
+ gateway.standalone: true in profiles/coder/config.yaml,
+ then wait for the host gateway to rescan (<=30s) or send its rescan-profiles control verb.
+ (gateway.standalone is a temporary compatibility shim while multiplexing gaps are fixed;
+ it will be removed once they are — plan to fold this profile with `hermes gateway migrate --multiplex`.)
```
When the host gateway is already running and serves the profile, the first
@@ -206,8 +209,22 @@ line reads `The host gateway already serves profile 'coder'.` with the owner's
PID and served set, and the pointer is `hermes -p default gateway restart`.
The dashboard's **Start** button for a named profile returns the same refusal.
-A profile can also get a gateway of its own by authoring the opt-out. Set
-`gateway.standalone: true` in the profile's own `config.yaml`:
+### Temporary: `gateway.standalone: true`
+
+:::warning Temporary backwards compatibility, not a topology we keep
+Multiplex-only is the direction: one gateway per host serves every profile. The
+switch landed before every gap was closed — per-profile stop/restart, the
+WhatsApp bridge and relay on secondary profiles, and dashboard scoping are the
+open ones — and fleets that relied on per-profile gateways lost them overnight.
+`gateway.standalone: true` exists so those fleets keep working **while those
+gaps are fixed**. It will be removed once they are, with a release-notes notice
+ahead of time; every surface that prints it says so. Do not build new setups on
+it: if you are starting fresh, run the host multiplexer. If a gap blocks you
+today, set the key, and file or upvote the issue for the gap so we can remove
+the shim sooner.
+:::
+
+Set `gateway.standalone: true` in the profile's own `config.yaml`:
```yaml
# profiles/coder/config.yaml
@@ -243,7 +260,7 @@ alone and prints it as `Standalone by config (gateway.standalone: true), left
alone`. The WhatsApp bridge and relay run in the profile's own gateway, as in
any standalone gateway.
-`--force` is not the path for this opt-out; it remains the escape for the two
+`--force` is not the path for this shim; it remains the escape for the two
boundary cases the refusal names (a fleet split across UNIX users, a
`HERMES_HOME` outside `profiles/`): it installs a real per-profile service, and
that service (its `ExecStart` carries no `--force`) keeps starting normally