Loading a session doesn't reset RAG state: citation numbers clash and the old shortlist is reused
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Read src/chatty/ui/session_handlers.py, especially handle_session_load at line 112 and load_session_file at line 33, and compare their reset behavior with action_new_session. Trace how loaded history represents assistant turns and citations; saved sessions lack citation metadata, so the issue leaves that counter choice open. Done means both load paths reset the RAG shortlist and initialize the turn counter consistently, preventing citation clashes and reuse of another session’s papers.
Written by the indexing model from the issue text.
Description
LitkitProvider keeps per-conversation state: _turn_number (for [T.N] citation numbers) and _last_paper_ids (the cached shortlist). action_new_session calls rag_provider.reset(), but the two session-load paths don't:
handle_session_load(src/chatty/ui/session_handlers.py:112, Ctrl+L)load_session_file(src/chatty/ui/session_handlers.py:33,chatty chat --session FILE)
Effect:
- Starting chatty with
--sessionon a conversation that already cites[1.1]to[3.5]numbers the next retrieval as turn 1 again, so new[1.N]citations clash with old ones in the same conversation. Avoiding that ambiguity is the reason[T.N]numbering exists. - Loading session B after session A keeps A's turn counter and paper shortlist. B's first follow-up question searches A's papers (see also #7).
Fix: call rag_provider.reset() on every load, and set the turn counter from the loaded history (the highest T cited, or the number of assistant turns). Saved sessions don't store citation metadata, so decide which of those to use.
- Dominant language
- Python
- Stars
- 0
- Forks
- 2
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lanl/chatty
-
area: rag bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
area: client bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area: ui bug wrong-result
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area: config bug wrong-result
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
area: config bug wrong-result
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day