e24f07239f
The desktop app always sends profile=default on GET /api/messaging/platforms. _is_current_profile() recognized only None/""/"current" as the dashboard's own profile — NOT the string "default" — so a single-profile install (the standard `hermes gateway setup` flow: token in .env, no platforms: section in config.yaml) entered the profile-scoped branch of _config_profile_scope(). That branch derives platform enablement from config.yaml only and never calls load_gateway_config()'s env-override pass (which enables the platform when the token is in the environment). Result: a platform connected via .env reported enabled=false, state="disabled" while it was actually running. The unscoped GET (no profile param) correctly reported enabled=true, state="connected". Fix: classify by resolved path, not by string. After _is_current_profile() fails, _config_profile_scope() now resolves the requested profile dir and compares it against get_process_hermes_home().resolve() — the same comparison _is_other_profile() already uses. When they match (profile=default on a default-home process), yield None (no override), taking the unscoped path that calls load_gateway_config(). A named-profile process (`-p worker`) has a different HERMES_HOME, so its profile=default resolves to a different directory and still scopes correctly — cross-profile secret isolation is preserved. The scoped branch's config.yaml-only enablement is DELIBERATE: load_gateway_config()'s env pass reads os.environ and would leak the root install's tokens into a genuinely different profile's state. This fix only reclassifies requests that name the process's OWN home; it does not touch the scoped branch or gateway/config_env.py. Refs #104614