Files
windmill/backend/windmill-common
Guilhem LemouelandClaude Opus 5 ec9c4054f3 fix(chat): release a stuck chat, forget a flow on re-point, serialise conversation cleanup
Three separate holes, all in code this PR added.

`endTurn` cleared every flag but `isDispatchingTurn`, so Stop could not release the
hold a failed transcript load leaves behind. That flag gates the whole surface, so
a conversation whose rows never load took New chat and every other chat with it.

The route component is reused between two flows, so the chat is re-pointed rather
than rebuilt, and `cleanup()` only ended turns. The selection survived, so
`selectLatestConversation` found one already open and the new flow rendered — and
would have sent into — the previous flow's conversation and agent memory. Cleanup
now forgets what it holds about a flow.

Two `delete_jobs` calls each removing one of a conversation's last messages could
not see each other's uncommitted deletes, so neither collected the conversation
and nothing tried again, stranding the row and its `ai_agent_memory`. The
conversation rows are taken before the emptiness check, which serialises them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 15:25:39 +02:00
..