Investigate $workflowId error showing up in the agentic chat

User problem to solve

Users occasionally see the error "Error: Variable $workflowId of type AiDuoWorkflowsWorkflowID! was provided invalid value" which disrupts their chat experience. This error is confusing and provides no actionable guidance for the user.

Assumption: The root cause is that the workflowId or activeThread stored in localStorage becomes invalid, either because:

  1. It contains just a numeric ID ("123") instead of the required full Global ID format ("gid://gitlab/Ai::DuoWorkflows::Workflow/123")
  2. The stored value becomes corrupted, undefined, or empty
  3. A race condition occurs where the workflow is deleted but the local reference persists in an inconsistent state

When the chat attempts to validate or fetch workflow events using this malformed ID, GraphQL's type coercion fails before any business logic can handle it gracefully.

Proposal

Spike to understand the issue and validate the assumption above.


Original writeup:

Title: Agentic Chat Displaying "$workflowId error" Message to Users

Description: Users are reporting frequent occurrences of an error message displaying "$workflowId error" within the agentic chat interface.

Impact:

  • Multiple user reports
  • Affecting chat functionality
  • Error visible to end users

Additional Information:

Steps to Reproduce:

  1. Visit any broken pipeline on Duo-enabled project (example)
  2. Click "troubleshoot"
  3. Note that agentic chat shows this error

Priority: High - Due to multiple user reports and customer-facing nature of the issue


Description was generated using AI

Edited by 🤖 GitLab Bot 🤖