Skip to content

fix: share configured group sessions across users - #31214

Closed
Jdelg718 wants to merge 2 commits into
NousResearch:mainfrom
Jdelg718:mothership-0.14.0-bluebubbles
Closed

fix: share configured group sessions across users#31214
Jdelg718 wants to merge 2 commits into
NousResearch:mainfrom
Jdelg718:mothership-0.14.0-bluebubbles

Conversation

@Jdelg718

@Jdelg718 Jdelg718 commented May 24, 2026

Copy link
Copy Markdown

Summary

  • Reduce active agent instruction bloat by moving the full AGENTS reference into docs and keeping AGENTS.md concise
  • Add shared_group_chat_ids config normalization and session-key propagation across gateway runner/session store/platform adapters
  • Fix shared multi-user detection for configured group threads so prompt/context behavior matches shared session keys

Test Plan

  • python -m pytest tests/gateway/test_session.py tests/gateway/test_config.py tests/gateway/test_session_hygiene.py tests/gateway/test_session_reset_notify.py -q -o 'addopts=' — 168 passed after rebasing onto latest main
  • git diff --check

Notes

  • Net active AGENTS.md reduction vs latest main: 1,073 lines / 49,256 chars (~93.84%)
  • Unrelated local backup file intentionally left untracked: tools/send_message_tool.py.bak-20260508-0012

@Jdelg718
Jdelg718 force-pushed the mothership-0.14.0-bluebubbles branch from 946d129 to 228e1f8 Compare May 24, 2026 00:30
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter platform/discord Discord bot adapter platform/slack Slack app adapter platform/feishu Feishu / Lark adapter platform/matrix Matrix adapter (E2EE) platform/wecom WeCom / WeChat Work adapter labels May 24, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the selective shared-group-session direction. The premise remains valid: current main has only the global group_sessions_per_user setting (gateway/config.py:699-701), while build_session_key() still applies that global policy to every non-thread group (gateway/session.py:949-959).

Problems

  • Current adapter key paths have moved to plugin adapters and still pass only the global flags, e.g. plugins/platforms/telegram/adapter.py:7618-7622, plugins/platforms/discord/adapter.py:6611-6615, and gateway/platforms/base.py:4627-4631. A salvage must update all current batching/guard paths or one selected chat can use inconsistent keys.
  • /resume and session authorization still classify sharing from global settings only (gateway/slash_commands.py:760-775, :915-928). They need the same per-source resolver as session-key creation so a selected shared group is not treated as per-user.
  • User docs currently describe only the global switch (website/docs/user-guide/sessions.md:615-625); the new setting needs documented semantics.

Suggested changes

  • Salvage the scoped config against the current plugin adapter layout, centralize the effective policy, and apply it to session keys, prompt attribution, batching, and slash-command authorization.
  • Split the unrelated BlueBubbles send-path rewrite from tools/send_message_tool.py into separate review scope.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/sessions Session lifecycle, resume, persistence, history labels Jul 13, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded by #70197 (merged): deferred as an intentional-design question about the per-user session model — needs a maintainer call before any implementation; not a quality judgment.

Thanks for the work — it's credited in #70197's summary.

@teknium1 teknium1 closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/discord Discord bot adapter platform/feishu Feishu / Lark adapter platform/matrix Matrix adapter (E2EE) platform/slack Slack app adapter platform/telegram Telegram bot adapter platform/wecom WeCom / WeChat Work adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades 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/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants