Skip to content

[Repo Assist] fix: pass UserRules to NotificationCategorizer in OpenClawGatewayClient#93

Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/fix-user-rules-never-applied-20260322-d7698d193be52e4d
Draft

[Repo Assist] fix: pass UserRules to NotificationCategorizer in OpenClawGatewayClient#93
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/fix-user-rules-never-applied-20260322-d7698d193be52e4d

Conversation

@github-actions
Copy link
Contributor

🤖 This is an automated contribution from Repo Assist.

Root Cause

NotificationCategorizer.Classify() accepts an optional userRules parameter so user-defined notification rules (step 3 in the categorization pipeline) can be applied when classifying incoming notifications. However, both call sites in OpenClawGatewayClientEmitNotification and EmitChatNotification — called Classify() without passing user rules.

This made the UserRules feature completely non-functional: custom rules saved in Settings were never applied to incoming gateway notifications.

Fix

  • Added _userRules field to OpenClawGatewayClient
  • Added SetUserRules(IReadOnlyList(UserNotificationRule)?) public method
  • Updated both Classify() call sites to pass _userRules
  • In App.xaml.cs, call SetUserRules() immediately after constructing the gateway client so the rules from Settings are active from the first connection

Impact

Any user who configured custom notification rules (keyword/regex pattern matching under UserRules in 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.Classify with user rules is already well-exercised in NotificationCategorizerTests.cs. The call-site change is mechanical.

Closes #93

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants