[Repo Assist] fix: pass UserRules to NotificationCategorizer in OpenClawGatewayClient#93
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Conversation
The NotificationCategorizer.Classify() method accepts an optional userRules parameter so custom notification rules (step 3 in the categorization pipeline) are applied. However, both call sites in OpenClawGatewayClient — EmitNotification and EmitChatNotification — called Classify() without passing user rules, making the UserRules setting completely non-functional. Changes: - Add _userRules field to OpenClawGatewayClient - Add SetUserRules(IReadOnlyList<UserNotificationRule>?) method - Pass _userRules to both Classify() call sites - Call SetUserRules() in App.xaml.cs when initializing the gateway client so rules from settings take effect immediately Closes #93 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Mar 23, 2026
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.
🤖 This is an automated contribution from Repo Assist.
Root Cause
NotificationCategorizer.Classify()accepts an optionaluserRulesparameter so user-defined notification rules (step 3 in the categorization pipeline) can be applied when classifying incoming notifications. However, both call sites inOpenClawGatewayClient—EmitNotificationandEmitChatNotification— calledClassify()without passing user rules.This made the
UserRulesfeature completely non-functional: custom rules saved in Settings were never applied to incoming gateway notifications.Fix
_userRulesfield toOpenClawGatewayClientSetUserRules(IReadOnlyList(UserNotificationRule)?)public methodClassify()call sites to pass_userRulesApp.xaml.cs, callSetUserRules()immediately after constructing the gateway client so the rules from Settings are active from the first connectionImpact
Any user who configured custom notification rules (keyword/regex pattern matching under
UserRulesin settings) would have seen those rules silently ignored. With this fix, user rules are evaluated as step 3 of the categorization pipeline: after structured metadata (Intent/Channel) but before keyword fallback.Test Status
503 tests pass, 18 skipped (Windows-only integration tests skipped in Linux CI).
No new tests needed —
NotificationCategorizer.Classifywith user rules is already well-exercised inNotificationCategorizerTests.cs. The call-site change is mechanical.Closes #93