[Repo Assist] fix: honour PreferStructuredCategories setting in notification categorizer#104
Closed
github-actions[bot] wants to merge 1 commit intomasterfrom
Closed
Conversation
…rizer The PreferStructuredCategories setting was persisted in SettingsManager and SettingsData but never read. The categorizer always ran the full pipeline (Intent → Channel → UserRules → keyword fallback) regardless of the user's preference. Changes: - NotificationCategorizer.Classify() gains a preferStructuredCategories parameter (default true, backward-compatible). When false, the Intent and Channel checks (steps 1–2) are skipped; classification starts from user-defined rules then keyword fallback. - OpenClawGatewayClient gains SetPreferStructuredCategories(bool) and stores the flag; both EmitNotification and EmitChatNotification now forward it to Classify(). - App.xaml.cs calls SetPreferStructuredCategories(_settings.PreferStructuredCategories) when initialising the gateway client. - Five new unit tests cover the false branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
36 tasks
9 tasks
Collaborator
|
Implementing fresh on current master — the Classify() call sites changed after #93 merged (added _userRules). |
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 <223556219+Copilot@users.noreply.github.com>
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 <223556219+Copilot@users.noreply.github.com>
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 <223556219+Copilot@users.noreply.github.com>
shanselman
added a commit
that referenced
this pull request
Apr 1, 2026
When PreferStructuredCategories is false, classification skips structured metadata (Intent, Channel) and goes straight to user rules + keyword fallback. 5 new tests. 521 shared tests pass. Reimplements #104 on current master. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 draft PR from Repo Assist.
Summary
PreferStructuredCategorieswas persisted inSettingsManagerandSettingsData(defaulttrue) but never read. The categorizer always ran the full pipeline — Intent → Channel → UserRules → keyword fallback — regardless of the user's preference.Root cause
NotificationCategorizer.Classify()had no parameter to opt out of the structured metadata steps.OpenClawGatewayClientalso had no way to forward the setting to the categorizer.Fix
NotificationCategorizer.Classify()gains abool preferStructuredCategories = trueparameter. Whenfalse, the Intent and Channel checks (steps 1–2) are skipped; classification starts from user-defined rules then keyword fallback. The default keeps all existing behaviour.OpenClawGatewayClientgainsSetPreferStructuredCategories(bool)and stores the flag. BothEmitNotificationandEmitChatNotificationforward it toClassify().App.xaml.cscallsSetPreferStructuredCategories(_settings.PreferStructuredCategories)when initialising the gateway client.Trade-offs
Classify()is backward-compatible via a default parameter. Callers that don't pass the flag continue to work exactly as before.UserRuleswiring — that is addressed separately in PR [Repo Assist] fix: pass UserRules to NotificationCategorizer in OpenClawGatewayClient #93 to keep each fix reviewable on its own.Relationship to PR #93
Both PRs touch
OpenClawGatewayClient.csandApp.xaml.cs. If #93 merges first, a brief rebase will be needed to resolve the overlapping lines; no semantic conflict exists.Test Status
Five new tests cover the
preferStructuredCategories = falsebranch:PreferStructuredCategories_False_SkipsIntentPreferStructuredCategories_False_SkipsChannelPreferStructuredCategories_False_UserRulesStillApplyPreferStructuredCategories_False_FallsBackToKeywordsPreferStructuredCategories_True_Default_BehaviourUnchanged