Conversation
_parse_session_key() only accepted the agent:main namespace, so under multiplex_profiles named-profile keys (agent:<profile>:...) parsed to None and notification/shutdown routing fell back to the LRU source cache; and _sibling_thread_run_keys() hardcoded agent:main, so a per-user thread /stop never matched a sibling run on a named profile. Accept any valid profile-id namespace slot and report it as profile (main keys keep their exact historical shape), build the sibling prefix from _session_key_namespace(source.profile), and drop the manual agent:main re-wrap in _build_process_event_source().
|
The two
The diff only touches |
|
Update on the CI failure: it is deterministic on the current merge-ref, and a fix is already pending in #105932 ( Timeline: the failing test arrived in main today at 17:05 UTC (4c4845f, "order the system unit after the target user's manager"), and every PR whose merge-ref includes that commit fails |
With _parse_session_key accepting the agent:<profile>: namespace (salvaged from #105942), the rewrite-to-agent:main workaround in _shutdown_notification_target is dead weight: take the profile from the parsed result like _build_process_event_source now does. Co-authored-by: Konstantin Khlopkov <konstantin.khlopkov93@gmail.com>
|
Landed on |
Summary
Two places hardcoded the
agent:mainnamespace, so undermultiplex_profilesnamed-profile session keys (agent:<profile>:...) were not parsed or matched. This PR fixes both and cleans up a hand-rolled workaround that becomes dead code._parse_session_key()(gateway/run.py): now accepts any valid namespace slot —mainor a profile id matching[a-z0-9][a-z0-9_-]{0,63}(profile ids never contain:—hermes_cli.profiles._PROFILE_ID_RE— so the plain:-split stays unambiguous). A named profile is reported asprofilein the result dict;mainkeys keep their exact historical shape (noprofilekey), so existing equality assertions stay byte-identical. Consumers inrun_notifications.py(watch/completion routing) andrun_shutdown.py(shutdown-notice target resolution) no longer degrade to the LRU_session_sourcesfallback for named profiles._sibling_thread_run_keys()(gateway/run_busy.py): the busy-ack prefix is built via_session_key_namespace(source.profile)instead of the literalagent:main, so a per-user thread/stopunder multiplexing actually finds (and stops) a sibling participant's run on the same named profile — and never crosses into a different profile's run in the same chat/thread._build_process_event_source()(gateway/run_notifications.py): drops the manual split +agent:mainre-wrap; the profile now comes straight from the parsed dict.Tests
mainshape; invalid namespace still →Noneprofile="work"vs the same chat onmain(must not cross profiles)_build_process_event_source()resolves platform/chat/profile from anagent:work:...key (previously unresolvable → dropped with a warning)Local: 34 passed in the two touched suites; adjacent consumers (
test_loop_command,test_relay_delivery_followups,test_async_delegation) 72 passed;ruff checkclean; no newruff formatcomplaints on touched lines vs the pristine baseline.Fixes #105931