fix(core): ExtraContent lost after alias resolution#553
Closed
xfromcnZL wants to merge 1 commit intochenhg5:mainfrom
Closed
fix(core): ExtraContent lost after alias resolution#553xfromcnZL wants to merge 1 commit intochenhg5:mainfrom
xfromcnZL wants to merge 1 commit intochenhg5:mainfrom
Conversation
When a message has ExtraContent (e.g. reply quotes from Discord/Telegram), handleMessage correctly prepends it to msg.Content at line 1342. However, the alias resolution at line 1347 still uses the original `content` variable (without ExtraContent) and then overwrites msg.Content, silently discarding the enriched context. Fix: pass msg.Content (which includes ExtraContent) to resolveAlias instead of the original content variable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
@xfromcnZL, please help resolve the current code conflicts. Thx. |
Contributor
Author
|
Thanks for flagging the conflict @chenhg5. After reviewing, main already fixes the same ExtraContent-loss bug with a better approach (resolve aliases on pure user text first, then merge ExtraContent back). This avoids the edge case where reply-quoted content could accidentally trigger an alias match. Since the root cause is already addressed on main, closing this PR as superseded. 🙏 |
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
ExtraContent(reply quotes, location text, etc.) was silently discarded during message processinghandleMessagecorrectly prependsExtraContenttomsg.Content, but the subsequent alias resolution uses the originalcontentvariable (withoutExtraContent) and overwritesmsg.Contentmsg.Content(which includesExtraContent) toresolveAliasinstead of the originalcontentvariableBug reproduction
ExtraContent)enrichReplyContentcorrectly returns[Reply to user]: original messagemsg.Content = ExtraContent + "\n" + contentcontent = e.resolveAlias(content)uses the originalcontentwithoutExtraContentmsg.Content = contentoverwrites the enriched content — reply context is lostChanges
core/engine.go: ChangedresolveAlias(content)→resolveAlias(msg.Content)(1 line)Test plan
go test ./core/ -run Aliaspassesgo build ./...passes🤖 Generated with Claude Code