refactor(copaw-manager): simplify _apply_mention to match worker#544
Merged
johnlanni merged 1 commit intoagentscope-ai:mainfrom Apr 3, 2026
Merged
Conversation
…ementation Manager's _apply_mention was overly complex with helper methods (_strip_lead_echo_of_ping_target, _should_show_mention_pill, _should_apply_outbound_mention) and config fields (outbound_structured_mentions, mention_pill_in_body). Simplified to match Worker's approach: scan body text for @user:domain MXIDs and populate m.mentions (MSC3952), without modifying the body. Net change: +20/-131 lines across 2 files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
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
_apply_mentionoutbound mention logic to match Worker's text-scan approach_strip_lead_echo_of_ping_target,_should_show_mention_pill,_should_apply_outbound_mention) and config fields (outbound_structured_mentions,mention_pill_in_body)@user:domainMXIDs and populatesm.mentions(MSC3952), without modifying body textChanges
copaw/src/copaw_manager/app/channels/matrix/channel.pycopaw/src/copaw_manager/config/config.pymention_pill_in_bodyandoutbound_structured_mentionsfields (-5 lines)Net: +20/-131 lines
Test plan
make build-manager-copaw) on ECS_apply_mentionextracts MXIDs from body → setsm.mentions→_was_mentionedreadsm.mentionson receive🤖 Generated with Claude Code