Summary
Description
POST /ask/stream supports multiple session IDs via data.session_ids. The handler iterates over session_id_list and retrieves candidates from each session (lines 3862–3964).
Affected Files
rag-service/main.py lines 3862–4148 (ask_question_stream, post-loop session_id usage)
Steps to reproduce
POST /ask/stream
{
"question": "summarize",
"session_ids": ["uuid-A", "uuid-B"],
"session_secrets": ["secret-A", "secret-B"]
}
After the call, session A's chat history is empty; session B contains the message twice (if retrieved from both sessions).
Expected behavior
After the loop, the code uses the bare Python variable session_id — which holds the last value assigned during the loop — for all subsequent operations including:
append_chat_exchange(current_session, ...) (evidence-gate refusal path)
_mark_session_dirty(session_id)
sessions.get(session_id) for persisting the final answer
Actual behavior
When a request spans two sessions (e.g. session_ids: ["A", "B"]), every chat message and dirty mark is written to session "B" regardless of which session actually provided the answer context. Session "A"'s history is never updated.
Additional context
No response
Summary
Description
POST /ask/streamsupports multiple session IDs viadata.session_ids. The handler iterates oversession_id_listand retrieves candidates from each session (lines 3862–3964).Affected Files
rag-service/main.pylines 3862–4148 (ask_question_stream, post-loopsession_idusage)Steps to reproduce
After the call, session A's chat history is empty; session B contains the message twice (if retrieved from both sessions).
Expected behavior
After the loop, the code uses the bare Python variable
session_id— which holds the last value assigned during the loop — for all subsequent operations including:append_chat_exchange(current_session, ...)(evidence-gate refusal path)_mark_session_dirty(session_id)sessions.get(session_id)for persisting the final answerActual behavior
When a request spans two sessions (e.g.
session_ids: ["A", "B"]), every chat message and dirty mark is written to session"B"regardless of which session actually provided the answer context. Session"A"'s history is never updated.Additional context
No response