[go: up one dir, main page]

fix: Filter out archived Agentic Chat workflows

What does this MR do?

Fixes a UX issue where users continue to see inactive Agentic Chat workflows in their workflow history even after the underlying conversation data has been automatically deleted.

before after
Screenshot_2025-09-19_at_15.23.57 Screenshot_2025-09-19_at_15.27.05

Problem Statement

We have two separate cleanup mechanisms for Agentic Chat data:

  1. Conversation threads cleanup: The Ai::Conversation::CleanupService automatically deletes conversation threads (ai_conversation_threads table) after 30 days to comply with data retention policies
  2. Workflow records: The corresponding workflow records (duo_workflows_workflows table) with workflow_definition: 'chat' were not being cleaned up

This created a frustrating user experience where:

  • Users would see chat workflows in their history via the getUserWorkflows GraphQL query
  • When they tried to access these workflows, they would fail because the underlying conversation data was already deleted
  • Users had no way to distinguish between active and inactive chat sessions

Implementation Details

  1. Added not_archived scope to Ai::DuoWorkflows::Workflow model that filters out workflows older than 30 days
  2. Applied scope to user queries in WorkflowsResolver - only affects personal workflow lists, not project-level queries
  3. Added comprehensive tests to ensure the scope works correctly

The solution is surgical - it only affects the specific query path where users see their personal chat history, leaving all other workflow functionality unchanged.

Edited by Jannik Lehmann

Merge request reports

Loading