fix(discord): gate relay-only thread rename kwargs - #82911
quocanh261997 wants to merge 1 commit into
Conversation
|
I refreshed this fix against current upstream while preserving Michael Nguyen's authorship rather than reopening duplicate #81389. Current candidate: rungmc357@2d185fa Verification on the current repository test harness:
We also reproduced the failure again on a live native Discord lane on 2026-08-18: semantic title generation and the rename-dispatch INFO line both succeeded, but no rename-result or adapter-success line followed and the placeholder remained. Current upstream still passes the relay-only kwargs into the strict native adapter. The call-site gating in this PR remains the right contract: relay receives |
|
+1 from a production native Discord gateway. This is the implementation we want merged for #78487: call-site gating, strict native signature, TypeError promoted to WARNING. Confirmed the bug is still present on current Please merge this and close the duplicate cluster (#80869, #78495). |
What does this PR do?
Restores native Discord auto-thread semantic renames by passing each adapter only the keyword arguments its lane supports.
The shared gateway caller previously sent relay-only
prefer_connector_createdandparent_chat_idarguments to the native Discord adapter. Its strictrename_threadsignature rejected those arguments withTypeError; the surrounding best-effort handler logged only at DEBUG, so the thread kept its placeholder title without an INFO-level result.This change keeps one polymorphic invocation while building lane-specific kwargs:
only_if_current_nameno-clobber guard.prefer_connector_created=Trueand the parent-channel discriminator.TypeErrorcontract failures are visible at WARNING; other cosmetic failures remain DEBUG-only.This follows the call-site-gating direction discussed in #80869, but keeps the invocation single and adds one focused boundary regression to the existing title-rename test module. #78495 is the alternative adapter-tolerance approach.
Related Issue
Fixes #78487
Type of Change
Changes Made
gateway/run.py: gate native and relay rename kwargs at the shared call site and surface unexpectedTypeErrorcontract failures.tests/gateway/test_session_title_rename_lane.py: cover the real gateway-to-native boundary with a signature-strict adapter stub.How to Test
discord auto-thread rename result: ... applied=Trueappears at INFO and the semantic title replaces the placeholder.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — N/A; behavior and protocol are unchangedcli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Live Discord acceptance was not performed as part of this deterministic test pass.