feat(gateway): attribute every inbound sender with stable identity - #76516
feat(gateway): attribute every inbound sender with stable identity#76516NicholaiVogel wants to merge 1 commit into
Conversation
|
Thanks for carrying the sender identity onto the current inbound turn; current main still limits the prefix to shared sessions ( Problems
Suggested changes
Automated hermes-sweeper review. |
|
Thanks @teknium1, I'm addressing your feedback and making a few more adjustments. |
811aea1 to
d823053
Compare
|
Addressed in d823053.
|
SummaryOne PR addresses #35147. #76516 expands the requested session-context change into per-message attribution, attaching a neutralized display name and adapter-authenticated stable sender ID to attributable inbound turns, including DMs, while preserving platform-specific privacy handling and a legacy opt-out. Related pull requests
Suggested consolidationKeep #76516 open with a salvage path focused on its stable-ID sender envelope, spoofing defenses, privacy behavior, configuration support, and regression coverage. It is the only PR in this complex, so there are no competing PRs to close as duplicates. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I35147(["issue #35147 (open)"])
P76516["PR #76516 (open)"]
P76516 -->|best fix| I35147
class I35147 open
class P76516 open
class P76516 best
class P76516 target
click I35147 "https://github.com/NousResearch/hermes-agent/issues/35147"
click P76516 "https://github.com/NousResearch/hermes-agent/pull/76516"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 31 kB of PR diffs, 8 kB of issue/PR text, <1 kB of discussion (2 comments), 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
What does this PR do?
Adds durable, per-message sender attribution to gateway turns so the agent and persisted transcripts can identify the speaker in every chat context, including DMs. Previously, the per-turn prefix was limited to shared sessions, which left direct messages without durable sender identity.
The implementation uses an adapter-authenticated envelope with a display name and stable platform identity. It preserves Slack's native
<@USER_ID>mention target, respectsprivacy.redact_piifor phone-based platforms, and providesattribute_sender: falsefor the legacy behavior.Related Issue
Fixes #35147
Supersedes #13939.
Type of Change
Changes Made
gateway/run.py: prefixes attributed inbound turns with a spoof-resistant sender envelope and preserves the legacy behavior when disabled.gateway/config.py,hermes_cli/config.py: adds default-onattribute_sender, supporting bothattribute_senderandgateway.attribute_senderthrough runtime loading andhermes config setvalidation.gateway/session.py: shares the platform privacy classification used by sender attribution and session context.tests/gateway/test_shared_group_sender_prefix.py,tests/hermes_cli/test_set_config_value.py: cover DM attribution, canonical IDs, redaction, spoof handling, legacy opt-out, and both config forms.cli-config.yaml.exampleandwebsite/docs/user-guide/configuration.md: document the setting and privacy behavior using synthetic examples only.How to Test
attribute_sender: falseorgateway.attribute_sender: false; confirm direct messages retain legacy unprefixed behavior.privacy.redact_pii: truefor WhatsApp or Signal; confirm sender IDs are stable hashes rather than raw phone-like identifiers.Validation: 368 focused tests passed locally.
scripts/run_tests.shcould not run because this managed checkout's venv lacks pytest; the system Python test runner was used instead.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass (focused suite above: 368 passed)Documentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A (not applicable)