From df2420f571b32466b376fc77de093e7ec178941e Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Fri, 19 Jun 2026 07:19:33 -0700 Subject: [PATCH] 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. --- gateway/run.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gateway/run.py b/gateway/run.py index e612d8a34d5..b16110e54d4 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -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",