Bug Description
When running Hermes with the Yuanbao platform enabled, stopping the gateway consistently takes approximately 5 seconds even when there are no active sessions.
The shutdown sequence completes immediately for all phases except Yuanbao adapter disconnection.
Relevant logs:
INFO gateway.run: Received SIGINT as a planned gateway stop — exiting cleanly
INFO gateway.run: Stopping gateway...
INFO gateway.run: Shutdown phase: notify_active_sessions done at +0.00s
INFO gateway.run: Shutdown phase: drain done at +0.00s (drain took 0.00s, timed_out=False, active_at_start=0, active_now=0)
INFO gateway.platforms.yuanbao: [Yuanbao] Disconnected
INFO gateway.run: ✓ yuanbao disconnected (5.01s)
INFO gateway.run: Shutdown phase: all adapters disconnected at +5.02s
INFO gateway.run: Gateway stopped (total teardown 5.02s)
The shutdown delay appears to come entirely from the Yuanbao adapter disconnect path.
Steps to Reproduce
- Configure and start Hermes with the Yuanbao platform enabled.
- Ensure there are no active conversations or running tasks.
- Stop the gateway with SIGINT (Ctrl+C).
- Observe shutdown timing in logs.
Expected Behavior
Gateway shutdown should complete almost immediately when there are no active sessions or pending Yuanbao operations.
Adapter disconnect should not introduce a fixed multi-second delay.
Actual Behavior
The Yuanbao adapter consistently requires approximately 5 seconds to disconnect:
✓ yuanbao disconnected (5.01s)
As a result, total gateway teardown time is approximately 5 seconds even when the system is otherwise idle.
Affected Component
Gateway (Telegram/Discord/Slack/WhatsApp)
Messaging Platform (if gateway-related)
No response
Debug Report
Report https://paste.rs/pNwc6
agent.log https://paste.rs/Pct7f
gateway.log https://paste.rs/llN7Q
Operating System
Debian GNU/Linux 12 (bookworm)
Python Version
3.11.2
Hermes Version
0.16.0
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?
Bug Description
When running Hermes with the Yuanbao platform enabled, stopping the gateway consistently takes approximately 5 seconds even when there are no active sessions.
The shutdown sequence completes immediately for all phases except Yuanbao adapter disconnection.
Relevant logs:
The shutdown delay appears to come entirely from the Yuanbao adapter disconnect path.
Steps to Reproduce
Expected Behavior
Gateway shutdown should complete almost immediately when there are no active sessions or pending Yuanbao operations.
Adapter disconnect should not introduce a fixed multi-second delay.
Actual Behavior
The Yuanbao adapter consistently requires approximately 5 seconds to disconnect:
✓ yuanbao disconnected (5.01s)
As a result, total gateway teardown time is approximately 5 seconds even when the system is otherwise idle.
Affected Component
Gateway (Telegram/Discord/Slack/WhatsApp)
Messaging Platform (if gateway-related)
No response
Debug Report
Operating System
Debian GNU/Linux 12 (bookworm)
Python Version
3.11.2
Hermes Version
0.16.0
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?