Repository navigation
fix(bot-mode): isolate group member sessions by thread - #93580
Wenfengcheng wants to merge 1 commit into
Conversation
Strong design and unusually thorough testing — per-thread session isolation with stable scopes across renames (
Minor: |
|
Thanks for the review. I checked all three points against exact head
The |
7708781 to
213d7a7
Compare
|
Rebased onto current The conflict overlapped main's per-turn retained route lease (#93602) with this PR's per-thread session ensure. The merged contract now retains the member route before thread-session ensure/create/resume and keeps it through attachment staging, submit, 4001 stored-id recovery, and polling. Direct helper callers still retain automatically; the production round path passes an explicit already-retained flag, so it does not double-retain. Every continue/return/error path releases through A new production-path regression calls Validation on exact head:
GitHub now reports the PR mergeable with no conflict. Fork workflows are |
213d7a7 to
24eeafa
Compare
|
@Wenfengcheng — two things you may not have seen, since neither of them shows up as a notification on this PR. 1. It has gone 2. Your PR was named as the designated fix on Sep 9. @teknium1 filed #106460 from the weekly user-pain miner — two Discord support threads this week, support-confirmed repro, classified P2 with severity raised because cross-thread bleed is also an information-leak surface when the threads belong to different clients. The issue says, verbatim:
The proposed direction there — key member-session resolution on So this is not a stale PR any more; it is the one an open P2 points at. Worth a rebase whenever you have the time, and linking it to #106460 so the two do not drift apart. If you would rather not carry it further, say so and I am happy to do the rebase-and-adapt work against the decomposed modules with your commit kept as the base and credit to you — but it is your patch and your call, and I would rather you land it. |
|
Superseded by #111003. Your premise and your design were both right, and #111003 carries them forward with credit ( What carried over unchanged: keying member-session identity on Thanks for the original work and for the careful exact-SHA reviews on this thread. |
|
@maxmilian @austinpickett Sorry I missed this message and did not follow up sooner. Thank you both for following up and carrying the fix forward in #111003. I really appreciate the work to adapt it to the decomposed Bot Mode modules, address the migration, and preserve the contributor credit. |
What does this PR do?
Bot Mode group threads now keep separate hidden model sessions for each
room + thread + memberidentity.The room log and watermarks were already thread-aware, but
ensureGroupChatSession(group, member)still stored one session pointer per member. Starting thread B therefore resumed the same backend transcript used by thread A, allowing a visually new thread to inherit the previous topic and model context.This change scopes the session pointer, title, transcript bootstrap, stranded replies, clarification/approval state, and background harvest to the thread. The same member still reuses one session within a thread, while a different thread gets a different hidden session.
Related Issue
Fixes #90420
Changes Made
How to Test
Validation on exact SHA
770878181e60a80d66bb9973987cc93bc0dc0fe2:A real Windows Electron E2E created two visible group threads and inspected the actual
state.db: the threads produced two distinct session ids, and neither backend transcript contained the other thread's unique prompt (1 pass, 0 fail). The temporary environment-specific harness was not included in this diff.Independent exact-SHA review: PASS, zero concrete #90420 defects.
Scope and overlap
PR #92041 addresses the separate room-drive scheduling race: serializing live follow-ups and preserving the pre-submit watermark boundary. This PR does not duplicate that queue. It closes #90420's remaining model-context leak by making hidden member-session identity thread-scoped.
Type of Change
Checklist
main