Generate title when goal is set later

What does this MR do and why?

When glab duo cli generates a flow, it initially generates it with no goal - see https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/blob/main/packages/cli/src/backend/gitlab/workflow_strategy.ts?ref_type=heads#L274

This means that when Ai::DuoWorkflows::GenerateWorkflowTitleWorker is run, there might not be a goal set, and thus no title generated - see ee/app/services/ai/duo_workflows/generate_workflow_title_service.rb

This MR adds another Ai::DuoWorkflows::GenerateWorkflowTitleWorker during checkpoint saving, but only when the goal is initially set.

We also add some logging to confirm this path is being run. We can remove the logging after confirming this.

References

See Slack conversation: https://gitlab.slack.com/archives/C09A8RP155K/p1788449464056139

gitlab-org/editor-extensions/gitlab-lsp#2889 (closed)

How to set up and validate locally

  1. Run duo cli at your local GDK - e.g. glab duo cli --gitlab-base-url http://gdk.test:3000 --gitlab-auth-token <PAT>
  2. Ask a simple question - e.g. What is the date?
  3. On your GDK instance, click on the sessions button on the right sidebar.
  4. Note that the title for the session was generated (i.e. not developer/v1). Might take a minute for the worker to run:

Home___GitLab

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 Roman Eisner

Merge request reports

Loading
Loading