You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gateway lifecycle notices currently share the platform home channel with ordinary conversation and scheduled delivery. Operators must either accept restart noise in that channel or disable lifecycle visibility entirely.
This change separates those concerns without changing normal home-channel routing:
When omitted, behaviour remains unchanged and lifecycle notices use home_channel.
Active-session interruption messages deliberately remain in the affected conversation; only platform-level startup/shutdown broadcasts use the lifecycle destination.
Compatibility and failure behaviour
no new environment variable
supports top-level platform blocks, platforms.*, and gateway.platforms.*
preserves documented config precedence
malformed lifecycle channel mappings log a warning and fall back to the home channel without dropping the platform config or preventing gateway startup
Relay-fronted targets retain user_id and scope_id provenance
Verification
focused canonical suite: 91 passed, 2 skipped
full gateway suite: 5,271 passed, 4 failed, 33 skipped
the same 4 failures reproduce on pristine origin/main:
macOS abstract systemd socket test
shutdown-forensics subprocess test
2 optional WeCom XML tests
ruff check: passed
git diff --check: passed
independent exact-commit review of 0b4b107a7deaef9d49f91eec1d6ae0ed322f967f: PASS, no findings
Related work
This uses a structured HomeChannel target rather than a bare chat ID, addressing the Relay provenance and malformed-config gaps previously identified on #76787.
AI code review — automated review for reference, author can ignore or act on any point.
fix(gateway): support dedicated lifecycle channels
Shutdown notifications now iterate all configured platforms (self.config.platforms) via resolve_delivery_transport instead of only connected adapters. A platform whose native adapter failed to start is now reached through the relay path even when the platform never actually connected — it will receive a "shutdown" notice it was never operational for. Worth verifying resolve_delivery_transport cannot return a transport for a platform in a failed/never-started state (or gating on connection state for non-relay targets).
In _merge_platform_map, the new and not has_restart_channel skip-condition means a platform block containing onlygateway_restart_channel now materializes a platform entry where it previously was dropped. Any downstream code that assumes the presence of an entry implies enabled/other config should be checked for the new edge (the malformed-value preservation is good, this is about the newly-materialized minimal entries).
_send_home_channel_startup_notifications is now misnamed — it sends to the lifecycle channel with a home fallback. Renaming (or at least a docstring update) would prevent confusion for future readers searching for "lifecycle channel".
Minor: gateway_restart_channel.platform is not validated against the containing platform key in from_dict (the malformed tests cover bad enum values, but a valid HomeChannel for a different platform would be accepted silently).
Gateway suite: 5,734 passed, 32 skipped; the three remaining failures were reproduced identically on pristine upstream and are unrelated host/optional-dependency failures
Ruff and git diff --check: clean
Independent review of exact commit f1d4a30167d07213f063d103453d3de2eb46bc1b: PASS, with no medium-or-higher publication blockers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area/configConfig system, migrations, profilescomp/gatewayGateway runner, session dispatch, deliveryneeds-decisionAwaiting maintainer decision before any implementationP3Low — cosmetic, nice to havesweeper:risk-compatibilitySweeper risk: may break existing users, config, migrations, defaults, or upgradessweeper:risk-message-deliverySweeper risk: may drop, duplicate, misroute, or suppress messagestype/featureNew feature or request
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gateway_restart_channelfor gateway startup and shutdown broadcastsgateway_restart_notificationsuppression flagCloses #76780.
Why
Gateway lifecycle notices currently share the platform home channel with ordinary conversation and scheduled delivery. Operators must either accept restart noise in that channel or disable lifecycle visibility entirely.
This change separates those concerns without changing normal home-channel routing:
When omitted, behaviour remains unchanged and lifecycle notices use
home_channel.Active-session interruption messages deliberately remain in the affected conversation; only platform-level startup/shutdown broadcasts use the lifecycle destination.
Compatibility and failure behaviour
platforms.*, andgateway.platforms.*user_idandscope_idprovenanceVerification
origin/main:ruff check: passedgit diff --check: passed0b4b107a7deaef9d49f91eec1d6ae0ed322f967f: PASS, no findingsRelated work
This uses a structured
HomeChanneltarget rather than a bare chat ID, addressing the Relay provenance and malformed-config gaps previously identified on #76787.