Skip to content

feat: collaboration -- delete a routine run's chats with the run - #3846

Merged
ryanweiler92 merged 1 commit into
devfrom
collab-updates-11-03-26
Nov 3, 2026
Merged

ryanweiler92 merged 1 commit into
devfrom
collab-updates-11-03-26

Conversation

@ryanweiler92

Copy link
Copy Markdown
Contributor

Description

Deleting a routine run now also deletes the chats that came from it. Before, the run left its history, but its chats stayed in the owner's Chats list.

The latest result's "Ask Assistant" chat now uses the run's own chat, the same one History's "Open chat" opens. That way every chat of a run can be found from the run when the run is deleted.

Changes Made

  • WorkRoutineRoom.deleteRun deletes these chats before it deletes the run:
    • the rooms the run's agent worked in (every room id in the run's node outputs; each run gets new ones),
    • the chat opened from the run in History or the sidebar,
    • the latest result's chat, while this run is still the routine's latest.
  • Each chat is removed the way RemoveUserRoom removes one: it is marked inactive for the owner, and its agent code context and Redis copy are cleared.
  • If a chat can't be deleted, the call fails and the run stays, so deleting it again finishes the job.
  • WorkDeleteRoutineRun now returns { deleted: true, roomIds: [...] }, the rooms it deleted, so the client can leave one that is open.
  • WorkRoutineRoom.open for the latest result now opens the chat keyed by the run id, not by the routine row's start time. A latest-result chat that already exists keeps opening.
    • Why: the row's start time is when the run was claimed, not when it started, and the next run overwrites it. An older run's latest-result chat could never be found again.
  • 4 new tests in WorkRoutineRoomUnitTests.

@ryanweiler92 ryanweiler92 self-assigned this Nov 3, 2026
@ryanweiler92
ryanweiler92 requested a review from a team as a code owner November 3, 2026 20:14
@snyk-io

snyk-io Bot commented Nov 3, 2026

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ryanweiler92
ryanweiler92 merged commit a03a1d3 into dev Nov 3, 2026
5 checks passed
@ryanweiler92
ryanweiler92 deleted the collab-updates-11-03-26 branch November 3, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant