fix(group): persist group chats and route subchat whispers - #5847
fix(group): persist group chats and route subchat whispers#5847uhhgoat wants to merge 10 commits into
Conversation
RaresKeY
left a comment
There was a problem hiding this comment.
I reviewed the complete latest head against current dev and found four issues, including one regression that prevents the main streaming chat route from running.
Findings
issue (chat runtime): Restore the independent
incognito request flag
-
Problem: The stream handler previously assigned
incognitobeside the other request flags. This change replaces that assignment withgroup_internal, but the handler still passesincognitointo context construction and reads it throughout the response path. There is no remaining assignment in the function. -
Impact: Every
/api/chat_streamrequest that reaches context construction raisesUnboundLocalErrorbefore model execution, so ordinary chat UI requests fail globally. -
Ask: Keep the existing
incognitoparse and assigngroup_internalseparately. Please add a route-level streaming regression covering ordinary, incognito, and group-internal requests. -
Location:
routes/chat_routes.py:843,routes/chat_routes.py:1093
issue (data integrity): Make group cascade deletion atomic and check every deletion
-
Problem: Group deletion commits each child separately, then deletes the parent, then removes group state. A child deletion returning
Falseis ignored. The underlying delete helper converts database errors intoFalse, so a failed child can be left behind while the parent and group state disappear; a later failure can instead leave only some histories permanently deleted. -
Impact: An ordinary group deletion during a persistence failure can silently orphan participant histories or irreversibly erase only part of the group.
-
Ask: Delete parent, participants, and group state in one checked transaction, roll back on any failure, and update in-memory state only after commit. Please add injected-failure tests for a child and the parent.
-
Location:
routes/session_routes.py:378,core/session_manager.py:542
issue (API consistency): Mirror child whispers on
/api/chat as well as /api/chat_stream
-
Problem: The child-to-parent lookup and both mirror calls exist only in the streaming route. The supported non-streaming
/api/chatroute still accepts and persists messages to the same child sessions but never mirrors the user or assistant message to the group parent. -
Impact: API and non-stream clients can successfully send a whisper while the parent group transcript silently loses that exchange, so persisted history depends on the transport used.
-
Ask: Apply the same owner-scoped mirroring to
/api/chat, or explicitly reject group-child use there if it is unsupported. Please add an API-level regression for both directions and for avoiding duplication on internal group requests. -
Location:
routes/chat_routes.py:701,routes/chat_routes.py:1261,routes/chat_routes.py:1756
issue (accessibility): Put the whisper destination in the accessible name
-
Problem: The button's visible text and accessible name remain
Whisper; only itstitlechanges toWhisper to <participant>. A title is not a reliable destination announcement when the button already has child text. -
Impact: Screen-reader users cannot reliably determine which participant will receive the next whisper before activating the control.
-
Ask: Update an
aria-labelor associated accessible description with the active participant and cover the state transition in a DOM/browser accessibility test. -
Location:
static/index.html:1174,static/app.js:970
Validation
- 35 focused persistence, storage, lifecycle, and search tests passed in the secretless runner.
- Changed Python compilation, all changed JavaScript syntax checks, and
git diff --checkpassed. - A fresh conflict check against current
devate7eddbaepassed, and source inspection confirmed that all four findings remain present. - All visible current-head checks pass, but none exercises the broken streaming runtime, failed child deletion, non-streaming whisper path, or accessibility tree.
- Browser/mobile group interaction and restart migration behavior remain to be checked after the fixes.
Merge current dev, restore independent streaming flags, mirror sync whispers, make group deletion atomic, and keep the whisper control's accessible name participant-specific.
|
Addressed all four findings in
Validation: |
|
Changed-file classification: UI-sensitive. Author-reported runtime / visual state
Checkboxes are author attestations. GitHub Actions results remain the execution evidence for CI; this check does not prove that a local command ran. This comment updates automatically when the description or changed files change. |
|
Fixed the unstable pytest check in commit 060114a and merged current dev. The group-chat regressions had drifted from two current route interfaces:
The focused updates keep production behavior unchanged while exercising the current fallback-aware path. Validation:
|
Summary
Reopens and rebases the closed #4137 group-chat persistence fix against the new
odysseus-dev/odysseusdevbranch. The change persists group chat state server-side, hides participant child sessions from normal top-level session views, exposes participants through the parent session disclosure, routes direct child sends as private group whispers, cascades parent moves/deletes to participant children, and preserves legacy/null-owner group state rows through the current owner-filtering behavior.Linked Issue
Fixes #4038.
Type of Change
How to Test
Manual review flow: create a group chat with multiple personas, reload or switch away and back, confirm the parent restores group mode and participants, expand the parent row to inspect participant children, open a child raw transcript, send a whisper, and confirm the parent mirrors the exchange while child lifecycle actions remain blocked.
Validation run while reopening:
Local pytest was not available in the bundled Python runtime, so the focused pytest suite is left to GitHub CI.
Checklist