AI conversation shows the answer before its question, and sometimes the whole prompt
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 56/100
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
- Ask the AI assistant a question and wait for the answer.
- Open the conversation in Admin > AI Assistant, or reopen it from the chat history.
- 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/answer
-
List button click not working Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-out Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Gravatar hash is computed from the un-lowercased email, so mixed-case accounts render an identicon Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Todos los issues de apache/answer
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
bug group: validation priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
codecheckers/chekhov#51 ·
-
Creating worktree from an existing remote branch with a slash in it, has unexpected behaviour Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100