[verified] fix: scope model changes to the active profile

This commit is contained in:
2026-09-09 18:03:32 +00:00
parent 1d85d7af6b
commit aa705f7dd0
3 changed files with 184 additions and 12 deletions
+6
View File
@@ -29,6 +29,7 @@ from gateway.platforms.base import (
BasePlatformAdapter,
SendResult,
)
from hermes_constants import get_hermes_home
from . import protocol as proto
from . import hermes_bridge
@@ -59,6 +60,11 @@ class PhebyAdapter(BasePlatformAdapter):
platform._value_ = "pheby"
platform._name_ = "PHEBY"
super().__init__(config=config, platform=platform)
# WebSocket control requests run outside normal gateway turns. Capture
# the profile root while the adapter is constructed under its routed
# profile context so model changes can install the matching credential
# scope later instead of reading another profile's environment.
self.hermes_home = get_hermes_home()
self._pcfg: PhebyConfig = load_config(config.extra or {})
self._server: Any = None
self._loop: Optional[asyncio.AbstractEventLoop] = None