Conversations from POST /conversations stay untitled and keep their creation time

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

I maintainer di solito rispondono entro 1 giorno

@NopeCharon ci sta già lavorando.

Dal 5/12/2026.

  • #657 di @NopeCharon — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
fastapi, python, sqlalchemy, sqlite
Ambito
backend, database

Direzione di ricerca

Read backend/'s conversation CRUD code, especially crud.create_message and crud.get_or_create_conversation, then inspect the conversation model and the tests described in CONTRIBUTING.md. Check that creating a message updates the conversation timestamp and sets an untitled conversation's title from the first user message, capped at 100 characters. Verify the JSON, streaming, and TUI paths; pull request #657 is already open for this issue.

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

Descrizione

The Next.js app creates a conversation with POST /conversations, then sends each question to POST /conversations/agent-retriever with that conversation_uuid. After that, two fields in the conversation list never change.

Title. POST /conversations stores title = None. The chat endpoints pass the first question as the title to crud.get_or_create_conversation, but it uses the title only when it creates the conversation. Here the conversation already exists, so the title stays None, and the sidebar shows "Untitled conversation" for every thread. The chatbot.py TUI also creates its conversations with title=None.

updated_at. Conversation.updated_at has an onupdate, but crud.create_message only inserts a messages row and never updates the conversation row. GET /conversations sorts by updated_at desc, so the list stays in creation order, and the sidebar shows the creation time as the last update. The mock API in frontend/mock-flask-api sets updated_at after each answer, so the UI behaves correctly against the mock but not against the backend.

Reproduce

From backend/, with the test setup in CONTRIBUTING.md: an app with the conversations router, an in-memory SQLite database, and a mocked graph:

a = POST /conversations         -> title None, updated_at 02:15:19.510079
b = POST /conversations         -> title None, updated_at 02:15:19.613398
POST /conversations/agent-retriever {"query": "How do I install OpenROAD?", "conversation_uuid": a}
GET /conversations/{a}          -> title None, updated_at 02:15:19.510079, 2 messages
GET /conversations              -> [b, a]

Expected: a is titled "How do I install OpenROAD?", its updated_at is the time of the answer, and it is listed first.

Proposed fix

Update the conversation in crud.create_message, in the same commit as the message:

  • set updated_at on every message;
  • give an untitled conversation the first 100 characters of a user message as its title, the rule the chat endpoints apply today when they create a conversation.

This covers the JSON and streaming endpoints and the TUI. The 100-character rule then lives in one place.

Lingua principale
Python
Stelle
51
Fork
27
Merge medio
11h 59m
PR unite (30g)
33

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 The-OpenROAD-Project/ORAssistant

Tutte le issue di The-OpenROAD-Project/ORAssistant

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.