Loading a session doesn't reset RAG state: citation numbers clash and the old shortlist is reused

Aperta
#8 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: rag area: sessions bug wrong-result

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 --session on 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.

Lingua principale
Python
Stelle
0
Fork
2
Merge medio
1g 4h
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lanl/chatty

Tutte le issue di lanl/chatty

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.