Skip to content

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

@github-actions

Description

@github-actions

🤖 This is an automated contribution from Repo Assist.

Root Cause

NotificationCategorizer.Classify() accepts an optional userRules parameter so custom notification rules (step 3 in the pipeline) are applied. However, both call sites in OpenClawGatewayClientEmitNotification and EmitChatNotification — called Classify() without passing user rules. This made the UserRules feature completely non-functional: any custom rules saved in Settings were silently ignored.

Relevant code:

  • OpenClawGatewayClient.cs lines ~854 and ~1559: _categorizer.Classify(notification) — missing the userRules argument
  • NotificationCategorizer.Classify(): already supports user rules as step 3 of the pipeline
  • SettingsManager.UserRules: saves and restores rules correctly but they are never passed to the categorizer

Fix

  • Added _userRules field and SetUserRules(IReadOnlyList(UserNotificationRule)?) method to OpenClawGatewayClient
  • Updated both Classify() call sites to pass _userRules
  • In App.xaml.cs, SetUserRules() is called during InitializeGatewayClient() so rules are active from the first connection and on every settings change

Test Status

503 tests pass, 18 skipped (Windows-only integration tests in Linux CI). No new tests needed — NotificationCategorizer.Classify with user rules is already well-covered in NotificationCategorizerTests.cs.


Note

This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch repo-assist/fix-user-rules-never-applied-20260322.

Click here to create the pull request

To fix the permissions issue, go to SettingsActionsGeneral and enable Allow GitHub Actions to create and approve pull requests.

Generated by Repo Assist ·

To install this agentic workflow, run

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions