Persist web search toggle on workflow record

What does this MR do and why?

Adds a webSearchEnabled field to the Ai::DuoWorkflows::Workflow model so the web search toggle is persisted on the workflow.

Two GraphQL mutations are introduced: aiDuoWorkflowCreate now accepts webSearchEnabled at creation time, and a new updateDuoWorkflowWebSearch mutation lets clients toggle it mid-conversation. This means the setting is persisted and is available to the backend when processing the workflow.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

Use the GraphQL Explorer in GDK (http://gdk.test:3000/-/graphql-explorer).

1. Create a workflow with webSearchEnabled: true

mutation {
  aiDuoWorkflowCreate(input: {
    goal: "test web search toggle"
    workflowDefinition: "chat"
    environment: WEB
    webSearchEnabled: true
  }) {
    workflow {
      id
      webSearchEnabled
    }
    errors
  }
}

2. Verify the value is persisted (use the id from step 1)

query {
  duoWorkflowWorkflows(workflowId: "gid://gitlab/Ai::DuoWorkflows::Workflow/YOUR_ID") {
    nodes {
      id
      webSearchEnabled
    }
  }
}

3. Toggle mid-conversation

mutation {
  updateDuoWorkflowWebSearch(input: {
    workflowId: "gid://gitlab/Ai::DuoWorkflows::Workflow/YOUR_ID"
    webSearchEnabled: false
  }) {
    workflow {
      id
      webSearchEnabled
    }
    errors
  }
}

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 Eva Kadlecová

Merge request reports

Loading
Loading