feat(analyser): expose destination topic to Analyser via Message.destinationName#2068
Open
krital wants to merge 1 commit intodevelopmentfrom
Open
feat(analyser): expose destination topic to Analyser via Message.destinationName#2068krital wants to merge 1 commit intodevelopmentfrom
krital wants to merge 1 commit intodevelopmentfrom
Conversation
…inationName Add a transient `destinationName` field to `Message`, set by the engine in `Protocol.processMessageAnalyser()` immediately before calling `analyser.ingest()`. This gives Analyser implementations access to the MAPS topic the message arrived on, enabling topic-aware routing within a single Analyser instance — for example, a MicroGptRouterAnalyser that maintains per-topic models keyed by destination. The field is transient (not serialised/persisted) and follows the same pattern as the existing `lastMessage` and `bound` transient fields on Message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
destinationNamefield toMessage, set by the engine inProtocol.processMessageAnalyser()immediately before callinganalyser.ingest()Analyserimplementations access to the MAPS topic a message arrived on, with no impact on serialisation, persistence, or existing analysersMotivation
Currently
Analyser.ingest(Message)has no way to know which topic the message came from. The engine caches oneAnalyserinstance per topic (topicNameAnalyserMap), but a router-style analyser that manages multiple per-topic models internally needs the destination at ingest time.This is needed to support
MicroGptRouterAnalyserin the upcomingmaps-microgpt-mavlink-demo: a single Analyser plugin that maintains one micro-GPT model per subscribed topic, routing bymsg.getDestinationName().Changes
Two files, five lines added:
Message.java— new@Getter @Setter private transient String destinationNamein the existing transient-data fold (same pattern aslastMessageandbound)Protocol.java— one line:msg.setDestinationName(parsedMessage.getDestinationName())beforeanalyser.ingest(msg)Test Plan
destinationName)Message.pack()/ serialisation (it istransient)msg.getDestinationName()and get the correct MAPS topic🤖 Generated with Claude Code