Add DWS ValidateFlowConfig gRPC integration for custom agents

What does this MR do and why?

This MR adds an additional validation layer for custom agents. When a custom agent is saved during the create and update service, we'll validate the agent configuration (mainly prompts and tools) with DWS, so the user gets the error at creation time itself.

Currently on master we're not validating this against DWS, which is why custom flow execution fails and it leaves the user wondering why it's failing.

References

WorkItem - #601986

Similar changes on custom flow - !235560 (merged)

How to set up and validate locally

Click to expand
Feature.enable(:ai_catalog_dws_validate_agent_config)

1. Create agent with valid definition

  1. Navigate to AI Catalog
  2. Create a new agent with a valid system prompt (e.g., You are a helpful assistant)
  3. Expected: Agent is created successfully

2. Create agent with invalid definition

  1. Create a new agent with an invalid system prompt containing <!--category-value-->
  2. Expected: DWS validation error is surfaced, agent is not saved

3. Update agent with invalid definition

  1. Open an existing agent
  2. Update the system prompt to contain <!--category-value-->
  3. Expected: DWS validation error is surfaced, agent is not updated

image

4. Update agent without definition change

  1. Open an existing agent
  2. Update only the name or description (no prompt/tool changes)
  3. Expected: Agent updates successfully without calling DWS validation

5. DWS unavailable

  1. Stop DWS (gdk stop duo-workflow-service)
  2. Try to create or update an agent with any definition change
  3. Expected: Error message "Duo Workflow Service is currently unavailable" is shown

6. Feature flag disabled

  1. Disable the feature flag:
    Feature.disable(:ai_catalog_dws_validate_agent_config)
  2. Create or update an agent with an invalid prompt
  3. Expected: Agent is saved without DWS validation

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.

Related to #601986

Edited by Jaydip Pansuriya

Merge request reports

Loading