Skip to content

fix(gateway): add trusted sender envelope for shared sessions - #69963

Closed
xiaoyaner0201 wants to merge 1 commit into
NousResearch:mainfrom
xiaoyaner0201:fix/shared-session-trusted-sender-uid
Closed

fix(gateway): add trusted sender envelope for shared sessions#69963
xiaoyaner0201 wants to merge 1 commit into
NousResearch:mainfrom
xiaoyaner0201:fix/shared-session-trusted-sender-uid

Conversation

@xiaoyaner0201

@xiaoyaner0201 xiaoyaner0201 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • add a verified sender envelope for shared multi-user gateway turns when adapters provide trusted source.user_id / source.user_id_alt
  • preserve Slack's <@UID> mention target while extending trusted sender IDs to Discord/Telegram-style shared sessions
  • strip forged leading verified-sender envelopes from user text, keep DM/per-user sessions quiet, and fall back to the old unverified display-name prefix when no trusted sender ID is available

Test Plan

  • scripts/run_tests.sh tests/gateway/test_image_input_routing_runtime.py tests/gateway/test_active_session_text_merge.py -q
  • scripts/run_tests.sh tests/gateway/test_image_input_routing_runtime.py tests/gateway/test_active_session_text_merge.py tests/gateway/test_session.py tests/gateway/test_discord_missed_message_backfill.py tests/gateway/test_telegram_text_batching.py -q
  • python -m ruff check gateway/run.py gateway/platforms/base.py tests/gateway/test_active_session_text_merge.py tests/gateway/test_image_input_routing_runtime.py
  • python -m compileall -q gateway/run.py gateway/platforms/base.py
  • git diff --check

Refs #69961

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery platform/discord Discord bot adapter platform/slack Slack app adapter platform/telegram Telegram bot adapter needs-decision Awaiting maintainer decision before any implementation sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: #13939 is the broader all-chat-context sender-attribution proposal. This PR limits the authenticated envelope and aggregation protection to shared sessions; please choose the desired contract or consolidate the approaches.

@xiaoyaner0201
xiaoyaner0201 force-pushed the fix/shared-session-trusted-sender-uid branch from 39d3e3e to a09e6db Compare July 23, 2026 08:19
@xiaoyaner0201

Copy link
Copy Markdown
Author

Superseded by #69980.

Reason: after this branch advanced past a09e6db230b064d61c7d34b1630bce0e09872f51, the fork ref updated but this PR object did not receive a synchronize event or reflect the new head SHA via the pulls API. I opened #69980 from a fresh branch name so reviewers see the final diff, including the no-trusted-UID forged-envelope regression fix.

@xiaoyaner0201

Copy link
Copy Markdown
Author

Closing in favor of #69980 so the open PR points at the synchronized final branch/head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have platform/discord Discord bot adapter platform/slack Slack app adapter platform/telegram Telegram bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants