[bug] clicking "New" on an empty conversation creates duplicate empty sessions

Abierto
#246 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
58/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
backend, frontend

Línea de trabajo

The payload names no files, so begin with the "New conversation" click handler in the Chat with AI panel and the backend create path that archives the current session. Confirm how the client generates the conversation ID, then check the reuse logic on the server. Done means repeated clicks on an empty conversation yield one session, and a backend contract test covers repeated create against an empty current session.

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

Descripción

area:agent type:bug

Summary

On the Chat with AI panel, when the current conversation has no messages,
clicking "New conversation" creates a new empty session on every click
instead of reusing the current one. Empty sessions accumulate in the history
list and in project storage until the 100-conversation limit blocks new
sessions entirely.

Steps to reproduce

  1. Open a project and the Chat with AI panel, with the current conversation
    empty.
  2. Click "New conversation" several times.
  3. Open the history panel: one empty session has been created per click.

Cause

The client generates a fresh conversation ID per click, while the backend's
create path is idempotent only by conversation ID, so the dedupe never
matches: each request archives the previous empty session and creates a new
one. The same accumulation is reachable from the agent/HTTP entry points,
because "reuse the empty active session" is not enforced as a server-side
rule.

Proposed fix

  • Frontend: when the current conversation is empty, "New" reuses it instead
    of creating a new session.
  • Backend: in the create path, return the current session when it is empty
    instead of archiving it and creating a new one. This protects the agent
    and HTTP entry points as well.

Acceptance

  • Repeated clicks with an empty current conversation produce exactly one
    session, and the history list stops accumulating empty entries.
  • Backend contract test: repeated create against an empty current session is
    idempotent.
Lenguaje dominante
TypeScript
Estrellas
119
Forks
16
Merge medio
16 h 13 min
PR fusionados (30 d)
195

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 ThinkFlowLab/OpenDirector

Todos los issues de ThinkFlowLab/OpenDirector

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.