Conversation
a6b8e86 to
85611fc
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused Discord policy coverage. The category-ID gap is still present on current main: plugins/platforms/discord/adapter.py:4914-4945 builds the shared channel keys from channel ID/name/#name and parent scope, but not category_id.
Problems
- The current shared key mechanism supersedes the PR's standalone
_discord_channel_scope_idsapproach. A salvage should preserve the current ID/name/#name/parent matching contract used by normal messages atplugins/platforms/discord/adapter.py:6170-6198and slash authorization at:3444-3472. - Current fail-closed message authorization passes only channel and parent IDs into
_is_allowed_useratplugins/platforms/discord/adapter.py:1151-1163; category-onlyDISCORD_ALLOWED_CHANNELSmust be included there or normal messages are denied before_handle_message. - The new free-response test exercises
_handle_message, not the earlier no-mention admission filter changed by the PR. Add an end-to-end category case for that gate, plus a thread-under-category case.
Suggested changes
- Rework the patch against the shared channel-key resolver and cover all authorization paths above.
- Update
website/docs/user-guide/messaging/discord.md:283-289if category IDs are intentionally accepted in the existing channel-list settings. #61593 proposes a different explicit-category API, so maintainers should select the intended configuration shape.
Automated hermes-sweeper review.
| @@ -5130,6 +5119,31 @@ def _get_parent_channel_id(self, channel: Any) -> Optional[str]: | |||
| return str(parent_id) | |||
| return None | |||
|
|
|||
| def _discord_channel_scope_ids(self, channel: Any) -> set[str]: | |||
There was a problem hiding this comment.
Current main now centralizes channel policy matching in _discord_channel_keys_from_channel() (adapter.py:4914-4945) and includes channel names, #name, and parent names. Please salvage category scope through that shared resolver rather than introducing a parallel ID-only key set, so all existing policy forms retain parity.
85611fc to
c88fc22
Compare
|
Thanks for the detailed review. I rebased the PR onto current
Targeted result: |
c88fc22 to
4877e4d
Compare
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Two PRs are included in this complex, but their diffs address separate Discord gaps: #54338 adds category-scoped channel-policy resolution, while #65931 adds searchable /model autocomplete. Neither diff implements the other's reported functionality.
Related pull requests
- #54338
related— (+291/-36) — keep open with a salvage path: The diff adds category IDs to the shared channel-key resolver and applies that resolver to early message authorization, no-mention admission, downstream message handling, and slash authorization, with direct-channel, thread-under-category, uncached-thread, allowlist, ignorelist, and documentation coverage. This preserves the salvage path identified by the contributor keep_open review on #54338 and directly addresses its stated concerns about the shared ID/name/#name/parent contract and the earlier admission gates. - #65931
related— (+269/-1) — keep open with a salvage path: The isolated diff adds authorized, thread-offloaded, searchable/modelautocomplete, preserves representable model values verbatim, skips overlong values, and tests filtering, limits, authorization, and provider-qualified values. This follows the contributor keep_open review on #65931: the current diff no longer contains the cited unrelated changes, and it addresses the value-truncation objection with discriminating regression coverage.
Suggested consolidation
Keep both PRs open on separate salvage paths rather than consolidating them as duplicates: retain #54338 for category-scoped Discord channel policies and #65931 for searchable /model autocomplete. The diffs are functionally independent, both now address the blocking concerns recorded in their respective contributor keep_open reviews, and there is no evidence that either is already implemented on main or duplicates the other.
Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 41 kB of PR diffs, 1 kB of issue/PR text, 6 kB of discussion (5 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
|
Scope note (dedup-campaign triage, 2026-08-03): this PR covers category scoping for allowed/ignored/free-response policies. The canonical feature request (#38539) also requires |
Summary
Motivation
Discord text channels expose their containing category as
category_id, while threads expose their parent channel throughparentorparent_id. Existing channel policy checks only considered the concrete channel ID and, in some paths, a thread parent ID. That meant deployments could allow a thread parent or single channel, but could not reliably target a whole category withDISCORD_ALLOWED_CHANNELSorDISCORD_FREE_RESPONSE_CHANNELS.Tests
Result:
78 passed.