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

Đang mở
#655 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@NopeCharon đang làm issue này rồi.

Từ ngày 5/12/2026.

  • #657 của @NopeCharon — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
fastapi, python, sqlalchemy, sqlite
Lĩnh vực
backend, database

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
51
Fork
27
Merge trung bình
11 giờ 59 phút
Pull request đã merge (30 ngày)
33

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của The-OpenROAD-Project/ORAssistant

Tất cả issue của The-OpenROAD-Project/ORAssistant

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.