fix(gateway): honor per-platform session isolation overrides - #84925
fix(gateway): honor per-platform session isolation overrides#84925Diaspar4u wants to merge 7 commits into
Conversation
0c4a482 to
6af89e8
Compare
|
Re-review requested. Closed the remaining per-platform isolation gaps in authorization, persisted Validation: 152 focused gateway tests passed; focused Ruff, diff checks, and SSH signature verification passed. |
…ssion keys SessionStore._generate_session_key and the run.py fallback/write paths read group_sessions_per_user / thread_sessions_per_user only from the global gateway config, while the adapters' text-batching keys resolve per-platform extra.* overrides. This divergence means a WhatsApp group with extra.group_sessions_per_user: false still gets per-user session keys on the main dispatch path, so each member carries a separate context even though batching keys say they share one. Resolve the per-platform extra overrides in the same three places the session key is built so dispatch, fallback, and shared-session attribution never diverge from the adapter's batching key.
The shared-key loop in load_gateway_config() only bridged known top-level keys (dm_policy, group_policy, require_mention, ...) into the platform extra and silently dropped the platform's own nested ``extra:`` dict. So ``whatsapp.extra.group_sessions_per_user: false`` never reached PlatformConfig.extra, and the session-key paths (which honor per-platform extra) fell back to the global default - every group member kept a separate context even though the config asked for a shared group session. Preserve the nested ``extra:`` dict before applying bridged keys so top-level bridged keys keep precedence. Adds a regression test that fails on main (nested extra dropped) and passes with this fix.
6af89e8 to
d8b6490
Compare
|
Rebased the completed isolation fix onto current Validation: 164 focused gateway tests passed; focused Ruff, GitHub Actions for exact head @coderabbitai review Maintainers: please re-review the current head. |
|
@teknium1 @alt-glitch please re-review the current head. |
fix(gateway): honor per-platform session isolation overrides Centralizing resolution in
|
|
Addressed all three points on current head
Validation: 165 existing and new session/resume/config/WhatsApp isolation tests passed; focused Ruff, attribution audit, both diff checks, and all six upstream-range SSH signature checks passed. @teknium1 @alt-glitch please re-review the materially changed current head. |
|
Fixed profile-safe recovery when a per-user session key becomes shared: durable session ownership now wins over the legacy key namespace, while rows owned by another profile remain rejected. Added continuity and cross-profile rejection regressions. Current head e9dde73 preserves the validated patch exactly. Validation: 165 focused tests passed; focused Ruff, diff checks, attribution audit, and all upstream-range commit signatures passed. @teknium1 @alt-glitch please re-review the current head. Actions on this exact SHA are awaiting write-access approval; please approve the workflow runs. |
9e363b6 to
e9dde73
Compare
|
Final disposition on #81207: #84925 is the preferred replacement. It carries #81207’s two session-isolation commits with original authorship preserved, then applies the same effective per-platform policy consistently to authorization, durable |
|
Significant-overlap disposition: #62370 fixes one remaining global group/thread-precedence case inside |
|
Further relationship disposition: #13939 deliberately decouples sender attribution from session isolation by adding a default-on stable |
Summary
group_sessions_per_userandthread_sessions_per_usersession-key overrides<platform>.extravalues while loading config/resumescoping, Discord prospective-thread attribution, and sender attribution aligned with the same effective per-platform isolation policyTest plan
scripts/run_tests.sh tests/gateway/test_session.py tests/gateway/test_resume_command.py tests/gateway/test_config.py tests/gateway/test_whatsapp_text_batching.py tests/gateway/test_whatsapp_group_gating.py -qruff check gateway/config.py gateway/run.py gateway/session.py gateway/slash_commands.py tests/gateway/test_config.py tests/gateway/test_session.py tests/gateway/test_resume_command.pygit diff --checkSupersedes #81207, including its reported prompt-context gap. The first two session-isolation commits were carried from the stack in #81208 with original authorship preserved; #81208 retains separate WhatsApp mention-tagging scope.