mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-21 10:22:18 +00:00
fix(gateway): keep non-Discord home-channel startup send byte-identical
The salvaged non_conversational marking made the home-channel startup no-metadata branch always pass metadata= explicitly; for non-Discord platforms _non_conversational_metadata returns None, so Telegram/etc. went from adapter.send(chat_id, message) to adapter.send(..., metadata=None). Behaviorally identical but broke test_restart_notification's exact assert_called_once_with. Only attach metadata when the marker applies (Discord), restoring the original call shape elsewhere.
This commit is contained in:
parent
caaa916289
commit
df2420f571
1 changed files with 9 additions and 5 deletions
|
|
@ -12130,11 +12130,15 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew
|
|||
metadata=_non_conversational_metadata(metadata, platform=platform),
|
||||
)
|
||||
else:
|
||||
result = await adapter.send(
|
||||
str(home.chat_id),
|
||||
message,
|
||||
metadata=_non_conversational_metadata(platform=platform),
|
||||
)
|
||||
_startup_meta = _non_conversational_metadata(platform=platform)
|
||||
if _startup_meta:
|
||||
result = await adapter.send(
|
||||
str(home.chat_id),
|
||||
message,
|
||||
metadata=_startup_meta,
|
||||
)
|
||||
else:
|
||||
result = await adapter.send(str(home.chat_id), message)
|
||||
if result is not None and getattr(result, "success", True) is False:
|
||||
logger.warning(
|
||||
"Home-channel startup notification failed for %s:%s: %s",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue