Conversation
|
Ran into this as well - cherry picked the fix and validated that it resolved the problem in both group and 1:1 chats on my install. |
Follow-up: preserve explicit agent handoffsCommit The original readable-delivery fallback remains for incidental unresolved mentions. The follow-up adds a stricter path for intentional handoffs:
This updates one statement in the original description: the PR now does add an optional config key, documented in Verification of the final implementation:
|
|
This was generated by AI during triage. Summary: Problems:
Solution: Checked against |
8ec0c45 to
c0b8d94
Compare
|
Addressed the configured-handoff image-caption gap reported in #77647 (comment) at exact head The local-image caption path now matches the existing text and standalone/cron paths:
Regression coverage proves exact Verification on the rebased current-upstream branch:
|
|
Status after the Buzz consolidation: the base fix (deliver despite unresolved @mentions) landed via #99431's recovery ladder. Surviving half: configured-handoff protection (extra.outbound_mention_pubkeys mapping names→exact pubkeys so intentional handoffs fail visibly instead of silently downgrading) — not on main. Worth a slimmed rebase to just that half. |
c0b8d94 to
d4d76f7
Compare
Squashed and rebased onto current main (PR NousResearch#77647). Configured outbound_mention_pubkeys map display names to exact identities; a complete @name marker for a configured identity is always published as a structured --mention, is never escaped or downgraded by the unresolved-mention recovery ladder, and forces a fresh final send instead of an edit so the p-tag survives streaming.
d4d76f7 to
1924405
Compare
What does this PR do?
Buzz supports structured identity mentions, but deliberate agent handoffs need a stable display-name-to-pubkey mapping. Dynamic channel-member lookup alone can resolve a configured name to the wrong identity, add duplicate notifications, or silently downgrade the handoff when Buzz rejects the intended identity.
This adds an optional
outbound_mention_pubkeysmap. When outbound text contains a complete configured@display-namemarker, Hermes sends only the exact mapped npub or hex pubkey for that marker. Configured handoffs fail visibly if Buzz rejects the identity; they are never escaped, dynamically reassigned, or silently published as unstructured edits.The guarantee applies to direct sends, local-image and attachment captions, standalone/cron sends, and streamed final replies. Matching uses Unicode NFKC plus casefold normalization, gives the longest configured name ownership of overlapping markers, and prevents dynamic lookup from reclaiming any configured span.
Related Issue
No linked issue. This preserves the configured-handoff portion requested in the maintainer review while dropping the unresolved-mention fallback superseded by current
main.Type of Change
Changes Made
platforms.buzz.extra.outbound_mention_pubkeysconfiguration for exact display-name-to-npub/hex identity mappings.main's bounded recovery ladder for unconfigured presentation mentions and remove this PR's superseded broad unresolved-mention fallback.How to Test
HERMES_PYTHON=<dev-python> scripts/run_tests.sh tests/gateway/test_buzz_adapter.py tests/gateway/test_stream_consumer.py -qand verify all 270 tests pass.HERMES_PYTHON=<dev-python> scripts/run_tests.sh tests/gateway -q; in the recorded environment this produced 7,299 passed, 2 failed, 36 skipped. The two WeCom callback failures reproduce on exactupstream/mainbecausedefusedxmlis unavailable.git diff --checkon the changed Python files.--mentionidentity.AnnandAnn Lee, then verify@Ann Leenotifies only the longer exact identity while separate@Annand@Ann Leemarkers notify both intended identities.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keysCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/A; no contributor workflow changedScreenshots / Logs
Exact candidate SHA:
d4d76f7430192e1b7431a4fc89b33a0b8bbdb216.Focused Buzz adapter and stream-consumer verification passed 270 tests. The full Gateway suite produced 7,299 passed / 2 failed / 36 skipped; both failures are the pre-existing WeCom callback environment failures described above. Ruff, Python compilation,
git diff --check, and the added-line security scan passed.Independent exact-head review exercised configured and dynamic identity collisions, NFKC-equivalent and overlapping names, distinct markers, stream success and failure paths, attachments, standalone delivery, config validation, retry behavior, and duplicate-notification risk, and returned APPROVE with no findings.