Remove duo_chat_workplan_empty_state flag

What does this MR do and why?

Consolidates the duo_chat_workplan_empty_state feature flag into the existing workplan flag, eliminating a redundant flag and fixing an actor mismatch.

Full context (AI generated)

Problem

The duo_chat_workplan_empty_state flag was pushed globally in gon_helper.rb with a user actor (current_user). This meant the "Generate workplan" button in Duo Chat could appear for users in projects/groups where the workplan feature was not actually enabled.

Solution

The backend only includes the AGENT_PLAN widget when the workplan feature is enabled for the project or group root ancestor. Since WorkItemAiWidget and WorkPlan are only rendered when that widget is provided, a separate frontend flag is unnecessary.

This MR:

  1. Removes the workplan frontend feature flag pushes from the EE project and group work item controllers
  2. Removes the component-level workplan feature flag checks from work_plan.vue; the component registers and refreshes the Duo Chat empty-state header while mounted
  3. Removes the global user-actor push of duo_chat_workplan_empty_state from gon_helper.rb
  4. Deletes the duo_chat_workplan_empty_state YAML definition
  5. Updates the affected frontend and controller specs

Button action confirmation

Both GenerateWorkplanEmptyState (the Duo Chat empty-state button) and WorkPlan.handleRegenerate (the workplan widget's "Generate" button) use buildWorkPlanChatCommand — they are already equivalent.

References

Screenshots or screen recordings

No UI changes — this is a feature flag consolidation. The "Generate workplan" button in Duo Chat is available only when the backend provides the AGENT_PLAN widget, which requires the workplan feature to be enabled for the project or group.

How to set up and validate locally

  1. Enable the workplan flag
  2. Visit a work item with a workplan that has not been generated yet, but the workplan widget is already visible (means AiPlanning is true)
  3. Open Duo Chat — the "Generate workplan" button should appear in the empty state
  4. Generate a workplan
  5. Open the Duo chat with a fresh state and you'll see "Review and confirm". It opens the panel with the workplan. (In case it was already open, it closes it again, which is not the best UX. But this MR isn't about fixing this UX)
  6. Disable the flag and verify the workplan widget and button are not rendered

This feature doesn't work when the Chat was already opened from before from another page. Make sure to open a fresh chat on the work item.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vanessa Otto

Merge request reports

Loading
Loading