Skip to content

refactor(copaw-manager): simplify _apply_mention to match worker#544

Merged
johnlanni merged 1 commit intoagentscope-ai:mainfrom
maplefeng-a:refactor/simplify-manager-apply-mention
Apr 3, 2026
Merged

refactor(copaw-manager): simplify _apply_mention to match worker#544
johnlanni merged 1 commit intoagentscope-ai:mainfrom
maplefeng-a:refactor/simplify-manager-apply-mention

Conversation

@maplefeng-a
Copy link
Copy Markdown
Contributor

Summary

  • Simplify CoPaw Manager's _apply_mention outbound mention logic to match Worker's text-scan approach
  • Remove 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)
  • New implementation scans body for @user:domain MXIDs and populates m.mentions (MSC3952), without modifying body text

Changes

File Change
copaw/src/copaw_manager/app/channels/matrix/channel.py Replaced complex mention logic with Worker-aligned scan approach (-126 lines)
copaw/src/copaw_manager/config/config.py Removed mention_pill_in_body and outbound_structured_mentions fields (-5 lines)

Net: +20/-131 lines

Test plan

  • Built CoPaw Manager image (make build-manager-copaw) on ECS
  • Deployed and verified 6/6 health checks pass (Tuwunel, MinIO, Higress Gateway, Higress Console, Manager API, Manager Agent)
  • Verified mention functionality: _apply_mention extracts MXIDs from body → sets m.mentions_was_mentioned reads m.mentions on receive

🤖 Generated with Claude Code

…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>
@maplefeng-a
Copy link
Copy Markdown
Contributor Author

截屏2026-04-03 12 54 52 测试环境完整测试

Copy link
Copy Markdown
Collaborator

@johnlanni johnlanni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johnlanni johnlanni merged commit 8c5c695 into agentscope-ai:main Apr 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants