Skip to content

[Repo Assist] fix: honour PreferStructuredCategories setting in notification categorizer#104

Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/fix-prefer-structured-categories-cfdb7e220d855953
Draft

[Repo Assist] fix: honour PreferStructuredCategories setting in notification categorizer#104
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/fix-prefer-structured-categories-cfdb7e220d855953

Conversation

@github-actions
Copy link
Contributor

🤖 This is an automated draft PR from Repo Assist.

Summary

PreferStructuredCategories was persisted in SettingsManager and SettingsData (default true) 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. OpenClawGatewayClient also had no way to forward the setting to the categorizer.

Fix

  • NotificationCategorizer.Classify() gains a bool preferStructuredCategories = true parameter. When false, 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.
  • OpenClawGatewayClient gains SetPreferStructuredCategories(bool) and stores the flag. Both EmitNotification and EmitChatNotification forward it to Classify().
  • App.xaml.cs calls SetPreferStructuredCategories(_settings.PreferStructuredCategories) when initialising the gateway client.

Trade-offs

Relationship to PR #93

Both PRs touch OpenClawGatewayClient.cs and App.xaml.cs. If #93 merges first, a brief rebase will be needed to resolve the overlapping lines; no semantic conflict exists.

Test Status

dotnet test tests/OpenClaw.Shared.Tests/ Passed! - Failed: 0, Passed: 508, Skipped: 18, Total: 526 

Five new tests cover the preferStructuredCategories = false branch:

  • PreferStructuredCategories_False_SkipsIntent
  • PreferStructuredCategories_False_SkipsChannel
  • PreferStructuredCategories_False_UserRulesStillApply
  • PreferStructuredCategories_False_FallsBackToKeywords
  • PreferStructuredCategories_True_Default_BehaviourUnchanged

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64 
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

0 participants