fix: contextual field filtering in interpretResult for core/get-site-…#172
Merged
pluginslab merged 2 commits intodevfrom Mar 27, 2026
Merged
fix: contextual field filtering in interpretResult for core/get-site-…#172pluginslab merged 2 commits intodevfrom
pluginslab merged 2 commits intodevfrom
Conversation
…info Make interpretResult context-aware so small models return focused answers instead of dumping all fields. Uses the userMessage parameter (already passed by the ReAct agent) to detect which fields the user asked about and filters the interpretation accordingly. Extracts shared FIELD_KEYWORDS map and detectRequestedFields() helper, reused by both interpretResult and parseIntent. Closes #79 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pluginslab
approved these changes
Mar 27, 2026
Owner
pluginslab
left a comment
There was a problem hiding this comment.
Well-structured PR. The shared FIELD_KEYWORDS map and detectRequestedFields() helper cleanly DRY up the field detection logic, and 17 new tests provide good coverage.
One required fix: the test file references #79 but the PR body says #109. Please reconcile the issue number.
Minor suggestions: consider word-boundary matching for keywords like "name" to avoid substring false positives, and add a test for the empty-string userMessage edge case.
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.
fix: contextual field filtering in interpretResult for core/get-site-info
Make
interpretResultcontext-aware so small models return focused answers instead of dumping all fields. Uses theuserMessageparameter (already passed by the ReAct agent) to detect which fields the user asked about and filters the interpretation accordingly.Extracts shared
FIELD_KEYWORDSmap anddetectRequestedFields()helper, reused by bothinterpretResultandparseIntent.Closes #109
What does this PR do?
Fixes the LLM returning all site info fields when the user asks for a specific one (e.g., "what is my site URL?" now yields only the URL instead of name, tagline, version, email, etc.). The fix filters
interpretResultoutput to match the user's question, so the 1.7B model receives — and relays — only the relevant fields.Type
How to test
npm run buildnpm test— all 88 tests pass, including 17 new contextual filtering testsScreenshots