feat(relay): Phase 1 parity — supported_ops discovery, wire identity fields, /handoff aliasing, provision displayName (#71300)

- CapabilityDescriptor.supported_ops + supports_op() with legacy-op-set
  fallback (additive, contract doc §2 updated)
- get_chat_info gated on op discovery (skip round trip on legacy connectors)
- _event_from_wire consumes user_display_name/user_handle (§3 fields
  previously dropped); native display-name parity, session-key stable
- /handoff <fronted-platform> works on relay-fronted gateways: CLI pre-check
  reads the GATEWAY_RELAY_PLATFORMS fronted set; watcher resolves through
  resolve_delivery_transport and replies via send_for_platform
- self-provision forwards displayName (env > skin branding, stock brand
  suppressed) — the primary name source for gg#171 attribution
This commit is contained in:
Ben Barclay 2026-07-25 20:36:16 +10:00 committed by GitHub
parent 760112adb6
commit ebab890ae5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 540 additions and 12 deletions

View file

@ -569,8 +569,26 @@ class CLICommandsMixin:
pcfg = gw_config.platforms.get(platform)
if not pcfg or not pcfg.enabled:
_cprint(f" Platform '{platform_name}' is not configured/enabled in the gateway.")
return True
# Relay aliasing: a relay-fronted gateway has no per-platform
# config block for the logical platform ("discord" etc.) — only a
# RELAY entry — yet /handoff discord is deliverable when the relay
# fronts it. The fronted set is deploy config
# (GATEWAY_RELAY_PLATFORMS), readable here without the live
# adapter; the gateway watcher re-checks against the authenticated
# transport (resolve_delivery_transport) before dispatch, so this
# is a UX pre-check, not the security gate.
relay_fronts = False
try:
from gateway.relay import relay_platform_identities
relay_cfg = gw_config.platforms.get(Platform.RELAY)
if relay_cfg and relay_cfg.enabled:
fronted = {p for p, _ in relay_platform_identities()}
relay_fronts = platform_name in fronted
except Exception:
relay_fronts = False
if not relay_fronts:
_cprint(f" Platform '{platform_name}' is not configured/enabled in the gateway.")
return True
home = gw_config.get_home_channel(platform)
if not home or not home.chat_id: