Skip to content

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

Merged
shanselman merged 1 commit into
masterfrom
repo-assist/fix-user-rules-never-applied-20260322-d7698d193be52e4d
Apr 1, 2026
Merged

shanselman merged 1 commit into
masterfrom
repo-assist/fix-user-rules-never-applied-20260322-d7698d193be52e4d

Conversation

@github-actions

Copy link
Copy Markdown
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 OpenClawGatewayClient — EmitNotification 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 <[email protected]>
@github-actions github-actions Bot mentioned this pull request Apr 1, 2026
12 tasks
@shanselman
shanselman marked this pull request as ready for review April 1, 2026 06:43
@shanselman
shanselman merged commit 180acbe into master Apr 1, 2026
shanselman added a commit that referenced this pull request Apr 1, 2026
#104)

Adds preferStructuredCategories parameter to Classify() — when false,
structured metadata (Intent, Channel) is skipped, going straight to
user rules and keyword fallback.

Reimplemented on current master (post-#93 UserRules merge).
5 new tests covering all code paths.

Co-authored-by: Copilot <[email protected]>
shanselman added a commit that referenced this pull request Apr 1, 2026
#104)

Adds preferStructuredCategories parameter to Classify() — when false,
structured metadata (Intent, Channel) is skipped, going straight to
user rules and keyword fallback.

Reimplemented on current master (post-#93 UserRules merge).
5 new tests covering all code paths.

Co-authored-by: Copilot <[email protected]>
shanselman added a commit that referenced this pull request Apr 1, 2026
#104)

Adds preferStructuredCategories parameter to Classify() — when false,
structured metadata (Intent, Channel) is skipped, going straight to
user rules and keyword fallback.

Reimplemented on current master (post-#93 UserRules merge).
5 new tests covering all code paths.

Co-authored-by: Copilot <[email protected]>
@vincentkoc
vincentkoc deleted the repo-assist/fix-user-rules-never-applied-20260322-d7698d193be52e4d branch August 2, 2026 07:56
vixco pushed a commit to vixco/openclaw-windows-node that referenced this pull request Aug 16, 2026
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 openclaw#93

Co-authored-by: Copilot <[email protected]>
vixco pushed a commit to vixco/openclaw-windows-node that referenced this pull request Aug 16, 2026
openclaw#104)

Adds preferStructuredCategories parameter to Classify() — when false,
structured metadata (Intent, Channel) is skipped, going straight to
user rules and keyword fallback.

Reimplemented on current master (post-openclaw#93 UserRules merge).
5 new tests covering all code paths.

Co-authored-by: Copilot <[email protected]>
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.

1 participant