[Repo Assist] feat: add Tags routing to NotificationCategorizer structured metadata pipeline#196
Closed
github-actions[bot] wants to merge 1 commit intomasterfrom
Conversation
… pipeline The Tags field on OpenClawNotification was populated by the gateway but never consulted during classification. Add it as step 3 in the structured metadata phase (after Intent and Channel, before user rules): Intent → Channel → Tags (first known tag) → user rules → keyword fallback Tags are checked against the existing IntentMap via case-insensitive lookup so the same category vocabulary applies consistently across all structured fields. The Tags path is skipped when preferStructuredCategories=false, consistent with how Intent and Channel are treated. Add 18 tests covering: known-tag routing, first-match-wins across multiple tags, unknown tags falling through, priority ordering (intent > channel > tags > user rules), and behaviour when preferStructuredCategories=false. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
13 tasks
Collaborator
|
Closing this automated PR. The code is correct and well-tested, but the design choice of Tags overriding User Rules needs more thought — user rules are explicit user intent while tags are free-form gateway hints. Users should be able to override tags with their own rules. If we revisit this, tags should go below user rules in the pipeline priority. |
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 PR from Repo Assist.
Summary
The
Tagsfield (string[]?) has been present onOpenClawNotificationsince the structured-metadata overhaul, but theNotificationCategorizernever checked it. Every notification with tags silently fell through to user rules and keyword matching regardless of what those tags said. This PR plugs that gap.What changed
NotificationCategorizer.cs— adds a Tags step (step 3) in the structured metadata phase:When
preferStructuredCategoriesis true (the default), the categorizer now iterates theTagsarray and returns on the first tag that resolves viaIntentMap. Unknown tags are silently skipped and fall through. Tags are skipped entirely whenpreferStructuredCategoriesis false, consistent with how Intent and Channel are treated.Why Tags uses IntentMap
Intent, Channel, and Tags all express gateway-side routing intent; using the same map keeps the vocabulary consistent and avoids a separate data structure.
Backward compatibility
No existing behaviour changes. Notifications without
Tags(or withTags = null) are completely unaffected — the guardTags is { Length: > 0 }short-circuits immediately.Trade-offs
IntentMapis used for tag lookup (notChannelMap). Tags are free-form hints, not structured channel names, so the intent vocabulary is the right match.NotificationCategorizerTests.cs— +18 tests covering:preferStructuredCategories=falseTest Status
Ran locally on Linux runner:
Build: succeeded, 0 warnings.