fix(gateway): gate relay-only rename kwargs to the relay lane (#78487) - #80869
Open
WynnD wants to merge 1 commit into
Open
fix(gateway): gate relay-only rename kwargs to the relay lane (#78487)#80869WynnD wants to merge 1 commit into
WynnD wants to merge 1 commit into
Conversation
The semantic Discord auto-thread rename passed prefer_connector_created / parent_chat_id unconditionally, but the native Discord plugin adapter's rename_thread only accepts only_if_current_name. Every native-lane rename raised TypeError and was swallowed by the generic except — threads were silently never renamed and no 'rename result' log line was emitted. Gate the connector kwargs behind use_connector_guard (relay lane only); the native lane keeps the legacy string guard. Regression tests cover: native lane receives no connector kwargs, signature-strict adapter survives, relay lane keeps connector guard behavior.
Collaborator
19 tasks
7 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Fixes #78487: native Discord auto-thread semantic renames were silently dying since the connector-guard refactor.
gateway/run.pypassesprefer_connector_created/parent_chat_idtorename_threadunconditionally, but the native Discord adapter'srename_threadonly acceptsonly_if_current_name. Every native-lane rename raisedTypeError, swallowed by the bareexcept Exception(debug-level log only) — the "rename result" log line never fires and threads keep their initial auto-thread name.This PR takes the call-site gating approach (option 2 from the issue): the connector-owned kwargs are passed only on the relay lane; the native lane calls with
only_if_current_nameonly.Why this approach vs #78495
#78495 makes the native adapter silently accept/ignore the connector kwargs (single call-site preserved). This PR instead gates at the call site, keeping the native adapter's signature strict — a future relay/native mismatch will fail loudly at the boundary rather than being papered over by ignored parameters. Both approaches fix the bug; maintainers can pick or combine (the gating + adapter tolerance compose cleanly).
Changes Made
gateway/run.py: branch therename_threadcall onuse_connector_guard— relay lane keepsprefer_connector_created=True+parent_chat_id; native lane passes onlyonly_if_current_name.tests/gateway/relay/test_native_lane_rename_kwargs.py: regression tests — (1) native lane receives no connector kwargs with the string guard intact, (2) signature-strict native adapter completes without TypeError, (3) relay lane keeps connector-guard behavior.How to Test
Checklist