fix(suggestion): avoid echoing the current query - #2582
Open
hjxccc wants to merge 1 commit into
Open
Conversation
hjxccc
marked this pull request as ready for review
August 15, 2026 02:20
Author
|
友好 ping 一下 🙏 这个 PR 开了 11 天了,CI 全绿、无冲突。 修的是 #2519:知识路径会把标题为 需要我 rebase 到最新 main、或者把改动拆得更小,随时说,我会立刻跟进。 |
Collaborator
|
抱歉拖了这么久才回复,整个改动没有问题,不过我看PR 信息你是从实际数据库中导出的,这些信息会涉及你的一些个人身份信息,建议测试用例简单做个修改,换成一些通用的日常表达,即可merge了。🙏 Sorry for taking so long to reply,there are no problem with the changes overall,but I see from the PR information that you exported this from an actual knowledge database,and this information may involve some of your personal identifying information,I suggest making a simple change to the test cases,replacing it with some generic everyday expressions,then it can be merged。🙏 |
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.
Description
Prevent follow-up suggestions from repeating the user's current question after normalization.
The knowledge path can mechanically turn an entity or summary Wiki page titled
Xinto介绍一下X. When that is also the current query, relevance ranking promotes the echo because its context starts withCurrentQuery, and the hybrid merge reserves a knowledge slot for it. The model path can also ignore the prompt-level instruction not to repeat prior questions.This change:
CurrentQueryon both model and knowledge paths;Type of Change
Related Issue
Fixes #2519
Testing
gofmt -l internal/application/service/message_suggestion.go internal/application/service/message_suggestion_test.go— no outputgo test ./internal/application/service/ -run 'Suggestion|FollowUp|MergeHybrid' -count=1— passed with Go 1.26go vet ./internal/application/service/— passed with Go 1.26git diff --check upstream/main...HEAD— passedThe focused backend package was validated. Full-repository
make testwas not run because this change is isolated to follow-up suggestion generation and its unit tests.Checklist
git diff --check origin/main...HEADpassesgo vetfor the changed package)Screenshots / Recordings
Not applicable; this is a backend-only fix.