fix(gateway): browser gate reads the registry's multiplexed flag as the review verified

Use the external review's exact predicate for the /browser connect gate:
`getattr(registry, "multiplexed", False) or len(serving) > 1`. A runner
whose registry carries no flag is judged by its served count, as before;
the connect-then-hot-serve test (multiplexed=True, one served authority)
still refuses.

Review #141357 (unsupportedpastels C1).

Refs #134889 (CLI-9)
This commit is contained in:
Teknium
2026-10-18 20:49:16 -07:00
parent ed4cefebb4
commit 386669d219

View File

@@ -65,7 +65,7 @@ _PROCESS_GLOBAL_ACTIONS = {"browser.manage": ({"connect", "disconnect"}, "browse
def _owner_may_multiplex() -> bool:
"""Whether this owner serves, or can hot-serve, more than one profile (the running gateway's
authority registry: multiplex mode, or a second profile ever served); without a registered
runner, whether the process multiplexes at all. Unknown means yes (fail closed)."""
runner, whether the process multiplexes at all (fail closed)."""
from agent.secret_scope import is_multiplex_active
from gateway import run_api
runner = getattr(run_api, "_ACTIVE_RUNNER", None)
@@ -73,7 +73,7 @@ def _owner_may_multiplex() -> bool:
if registry is None:
return is_multiplex_active()
from gateway.session_authorities import serving_authorities
return bool(getattr(registry, "multiplexed", True)) or len(serving_authorities(runner)) > 1
return getattr(registry, "multiplexed", False) or len(serving_authorities(runner)) > 1
def legacy_fallback_allowed(actor: Any, method: str) -> bool: