fix(gateway): respect routed profile busy modes - #83550
Conversation
|
Heads-up: Evidence:
Looks like this landed via #83550 ( |
|
Follow-up on the CI failure above: This is a deterministic fixture gap from this PR, not a flake and not caused by the unrelated PRs that are going red.
It can pass locally if a real Tracked in #83743 with a fixture fix in #83745 (monkeypatch |
After selective multiplex profile serving (NousResearch#83550), route resolution rejects target profiles missing from the served set, so this boundary test fell back to default interrupt on every CI slice (NousResearch#83743). Stamp research as served so the route-path assertion matches production rules. Same fixture shape as open NousResearch#83745.
After selective multiplex profile serving (NousResearch#83550), route resolution rejects target profiles missing from the served set, so this boundary test fell back to default interrupt on every CI slice (NousResearch#83743). Stamp research as served so the route-path assertion matches production rules. Same fixture shape as open NousResearch#83745.
After selective multiplex profile serving (NousResearch#83550), route resolution rejects target profiles missing from the served set, so this boundary test fell back to default interrupt on every CI slice (NousResearch#83743). Stamp research as served so the route-path assertion matches production rules. Same fixture shape as open NousResearch#83745.
Why this matters
A multiplexed gateway can serve several Hermes profiles from one process, and each profile can configure how new messages are handled while its agent is already running:
queue: wait until the current response finishessteer: redirect the active response using the new messageinterrupt: stop the active response and handle the new message immediatelyBefore this fix, those profile-specific settings were not actually independent. The gateway loaded the default profile's busy mode once and reused it for every routed profile. For example, if the default profile used
queueand a secondary worker profile usedsteer, messages routed to the worker could still be queued.That made a valid per-profile configuration silently behave incorrectly.
What this PR does
This PR makes every routed profile honor its own
display.busy_input_modeand legacybusy_text_modesettings.After this change:
queue,steer, orinterrupt;Implementation
The gateway snapshots each served secondary profile's busy settings during multiplex startup and resolves the appropriate in-memory snapshot from the routed message source.
The profile-aware resolver is used by all busy-input paths:
Secondary adapter events are stamped with their owning profile before the routed session key and busy behavior are resolved.
Related issue
Fixes #83439
Type of change
Test coverage
The new regression suite verifies:
queue,steer, andinterruptbehavior across profiles;busy_text_moderesolution;Commands
scripts/run_tests.sh tests/gateway/test_multiplex_busy_input_mode.py -q scripts/run_tests.sh \ tests/gateway/test_multiplex_busy_input_mode.py \ tests/gateway/test_busy_session_ack.py \ tests/gateway/test_multiplex_adapter_registry.py \ tests/gateway/test_profile_routing.py \ tests/gateway/test_profile_resolution.py \ tests/gateway/test_restart_drain.py -q ruff check . python -m py_compile gateway/run.py tests/gateway/test_multiplex_busy_input_mode.py python scripts/check-windows-footguns.py --all ty check tests/gateway/test_multiplex_busy_input_mode.pyResults
Checklist
Code
scripts/run_tests.shsuites and they pass.Documentation and housekeeping
cli-config.yaml.examplechanges are N/A; no config keys changed.