fix(sdk): recognize CJK and Markdown-adjacent mentions - #3917
Chessing234 wants to merge 6 commits into
Conversation
CJK and other scripts often omit spaces around agent names. Treat any non-alphanumeric ASCII predecessor as a mention boundary while still rejecting email-like `user@host` (block#3904). Signed-off-by: Taksh <takshkothari09@gmail.com> Signed-off-by: Taksh <takshkothari09@gmail.com>
Give operators and agent authors a short table for block#3904 without reading the Rust module docs. Signed-off-by: Taksh <takshkothari09@gmail.com> Signed-off-by: Taksh <takshkothari09@gmail.com>
Point agent authors at the boundary rule so handoffs without spaces still wake harnesses (block#3904). Signed-off-by: Taksh <takshkothari09@gmail.com> Signed-off-by: Taksh <takshkothari09@gmail.com>
Keep the CJK vs email rule discoverable from the contributor guide (block#3904). Signed-off-by: Taksh <takshkothari09@gmail.com> Signed-off-by: Taksh <takshkothari09@gmail.com>
Demonstrate that messages send emits p-tags for spaced-less handoffs. Signed-off-by: Taksh <takshkothari09@gmail.com> Signed-off-by: Taksh <takshkothari09@gmail.com>
2edbe97 to
86a52d0
Compare
|
Rebased onto latest |
|
@tlongwell-block @wesbillman @wpfleger96 mind taking a look when you get a chance? |
86a52d0 to
3344196
Compare
|
@wesbillman sdk @mention fix for cjk-adjacent tokens without breaking emails. tip is rebased + dco. review/merge when you can? |
…ndary-3904 Signed-off-by: Taksh <takshkothari09@gmail.com> # Conflicts: # AGENTS.md
🔐 Codex Security Review
|
|
This branch is doing more than #3904 and the title hides it. It also fixes #2526, and on every case I can produce it is the only one of the four open branches editing this predicate that fixes all of them. Five open PRs currently touch So I measured rather than argued. One probe test appended to Run: https://github.com/cristiansotogarciaxatech/buzz/actions/runs/34030702637
"none" is an empty vec, which on the CLI path means the message publishes with zero Two things fall out of that table. Main drops The BOM row is the argument for your approach. A leading BOM is not an exotic input. I hit this in production on a Windows box running managed agents. A message reached the relay with U+FEFF at position 0 opening with an at-mention. The doc comment two functions up already states the contract every "none" in that table breaks, at I am not asking you to change anything. Three suggestions if you want them. Add |
Summary
@mentionextraction when@is preceded by anything other than an ASCII letter/digit — so交给@Scout处理emits aptag whileuser@example.comstays inert (Proposal: define CLI/SDK @mention behavior next to CJK text #3904).extract_at_mentions_with_knownwith the same char-aware boundary (it previously inspected a single UTF-8 byte) and treat trailing CJK as a word boundary.docs/mention-boundaries.md, AGENTS gotchas, CONTRIBUTING, and the CLI README.Test plan
cargo test -p buzz-sdk extract_at_namescargo test -p buzz-sdk extract_at_mentions_with_known_allows_cjk_adjacentcargo test -p buzz-sdk email_address_not_matchedbuzz messages send --content "交给@Scout处理"against a channel where Scout is a member → Scout receives a mention / agent wakesCloses #3904
The same boundary rule also accepts Markdown-emphasis and parenthesized mentions, rather than maintaining a separate allowlist of leading delimiters. This covers the emphasis issue as well as CJK adjacency.
Closes #2526.