Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

AI conversation shows the answer before its question, and sometimes the whole prompt

Abierto
#1,621 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
56/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go, postgresql

Línea de trabajo

Start by locating the conversation record queries, context-building path, and the two detail endpoints used by the Admin AI Assistant and chat history views. Reproduce the issue with records sharing a created_at second and trace how the first record is selected. Done means records retain write order, the opening question is preserved, and the rendered prompt is not exposed.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Describe the bug

AI conversation records are ordered by created_at alone. A turn's user and assistant records are inserted back to back once the stream ends, and TIMESTAMP columns are stored at whole-second precision, so the pair almost always shares one created_at. The database resolves the tie as it pleases, and often enough the answer comes back before its question. This shows in the conversation views and in the context built for the next turn.

The same tie exposes the prompt. The opening question is stored as the full rendered prompt, and both detail endpoints replace the first record's content with the conversation topic. When the answer sorts first, the answer is overwritten with the topic and the stored prompt appears in full one record later.

To Reproduce

  1. Ask the AI assistant a question and wait for the answer.
  2. Open the conversation in Admin > AI Assistant, or reopen it from the chat history.
  3. Some conversations show the answer above the question; some show the prompt template as the user message and the question text where the answer should be.

Whether a given conversation is affected depends on how the database orders the tied rows, so it is intermittent. Observed on PostgreSQL (Aurora) with v2.0.2.

Expected behavior

Records appear in the order they were written, and the topic only ever replaces the opening question.

Platform

  • Device: Desktop
  • OS: macOS
  • Browser and version: Chrome
  • Version: v2.0.2
Lenguaje dominante
Go
Estrellas
15.7k
Forks
1.4k
Merge medio
1 d 20 h
PR fusionados (30 d)
6

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/answer

Todos los issues de apache/answer

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.