fix: reparar sesiones corruptas (crash) + mejoras UX detectadas en conversaciones reales - #10
Merged
Merged
Conversation
…s UX de conversación
Detectado revisando TODAS las conversaciones reales.
P0 — Crash que bloqueaba la sesión: un run cortado a media tool-call dejaba
un function_call_output huérfano (sin su call) en el historial, y OpenAI
rechazaba CADA turno ('No tool call found for function call output'). El
usuario quedaba tirado. Fix: sanitizeItems quita pares de tool incompletos
en cualquier posición (no solo al inicio), en cada guardado y al cargar
(reparando ficheros ya corruptos). Red de seguridad: si aun así llega el
error, ConversationService reinicia la sesión y pide repetir en vez de
fallar en silencio.
P1 — Donación en punto no elegido: el agente auto-elegía el punto de acopio
sin preguntar. Instrucción: nunca elegir el punto por su cuenta; confirmarlo
antes de registrar.
P2 — Hacer público un recurso: el bot daba vueltas (validar/verificar/publicar)
sin tools. Añadidas rg_verify_resource (POST /resources/{id}/verify) y
rg_publish_resource (POST /resources/{id}/publish) + instrucción del flujo.
Aclarado inventario != necesidades. Copy de botón neutral ('opción con id'
en vez de 'centro con ID'). Honestidad de identidad ante 'haz login con +34…'
estando ya autenticado.
Tests 83->90.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correcciones a partir de la revisión de todas las conversaciones.
P0 — Crash que bloqueaba la sesión 🔴
Un run cortado a media tool-call dejaba un
function_call_outputhuérfano (sin sufunction_call) en el historial; OpenAI rechazaba cada turno (No tool call found for function call output) y el usuario quedaba tirado (visto en vivo, 2 turnos seguidos rotos).sanitizeItems: elimina pares de tool incompletos en cualquier posición, en cada guardado y al cargar (repara ficheros ya corruptos).ConversationService: si aun así llega el error, reinicia la sesión y pide repetir, en vez de fallar en silencio.P1 — Donación en un punto no elegido 🟠
El agente auto-elegía el punto de acopio ("¿en qué punto lo registraste? yo no dije ninguno"). Ahora debe confirmar el punto con el usuario antes de registrar.
P2 — Varios 🟡
rg_verify_resourceyrg_publish_resource(endpoints reales) + instrucción.Verificación
tsclimpio · Tests 90/90 (nuevos: sanitizeItems, recuperación de sesión, detector de error, registro de tools).