Skip to content

The agent that grows with you

docs(multiplexing): record the config escape hatch and the .env-over-frozen-env precedence

teknium1bfcd20990647
diff --git a/website/docs/developer-guide/multiplexing-gateway.md b/website/docs/developer-guide/multiplexing-gateway.md
index ad9f7bd63d2..ac9e205e80b 100644
--- a/website/docs/developer-guide/multiplexing-gateway.md
+++ b/website/docs/developer-guide/multiplexing-gateway.md
@@ -57,15 +57,30 @@ is documented as a known limitation at the end of this document.
- The dashboard/Desktop backend (`hermes serve`) has no such flag, so
`hermes_cli/web_server.py::start_server` calls
`tui_gateway.launch_profile_policy.activate_multi_profile_hosting_eagerly()`
- at boot: the host arms the guard when the machine has more than one servable
- profile home, instead of waiting for the first `?profile=<other>` request.
- Activation is one-way, and anything the backend had already done by then
- (idle-reaper transcript flushes, hosted rooms, cron) was never re-scoped. A
- genuinely single-profile host still never activates.
+ as its LAST boot step: the host arms the guard when the machine has more than
+ one servable profile home, instead of waiting for the first
+ `?profile=<other>` request. Activation is one-way, and anything the backend
+ had already done by then (idle-reaper transcript flushes, hosted rooms, cron)
+ was never re-scoped. It runs last because activation also freezes
+ `os.environ` as the launch profile's credentials, and that snapshot is the
+ only source for launch keys with no `.env` to rebuild from (systemd
+ `Environment=`, `op run`, Compose) — a key injected or rotated after the
+ freeze is invisible for the process lifetime. A genuinely single-profile
+ host never activates, and neither does one that pinned
+ `gateway.multiplex_profiles: false`; an unreadable `profiles/` directory
+ fails closed (it activates) and logs a WARNING.
- With the guard armed the **launch profile is a tenant too**: a body with no
- routed profile binds `launch_profile_scope_if_multiplexed()` (its `.env` over
- the env frozen at activation) rather than running unscoped on ambient
- `os.environ`.
+ routed profile binds `launch_profile_scope_if_multiplexed()` rather than
+ running unscoped on ambient `os.environ`. Note the precedence inside that
+ scope: the launch home's **`.env` wins over the frozen env**, so activation is
+ not purely stricter for the launch tenant — for a key set in BOTH
+ `os.environ` and `<launch home>/.env`, an unscoped read returned the ambient
+ value before activation and returns the `.env` value after. Env-only keys are
+ unaffected.
+- A body whose routed profile name no longer resolves (deleted or renamed
+ mid-run) binds **nothing**: its credential reads raise `UnscopedSecretError`
+ instead of falling back to the launch profile's. "Whose is this?" with no
+ answer is a fail-closed condition, never a borrow.
## Scope composition