Skip to content

Fixes bug causing AI Agent prompt updates not to be saved

Darby Frey requested to merge fix-prompt-update-bug into master

What does this MR do and why?

This MR fixes a bug with the AI agent edit page that caused updates to the prompt input to not be correctly persisted to the database.

Database Review

UPDATE
  "ai_agent_versions"
SET
  "updated_at" = '2024-03-07 18:35:44.069271',
  "prompt" = 'some prompt'
WHERE
  "ai_agent_versions"."id" = 30

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/26931/commands/83861

UPDATE
  "ai_agents"
SET
  "updated_at" = '2024-03-07 18:35:44.075708',
  "name" = 'my-cool-agent-2'
WHERE
  "ai_agents"."id" = 44

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/26931/commands/83862

MR acceptance checklist

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

How to set up and validate locally

  1. Ensure you have an EE license activated

  2. Enable the feature flag

    Feature.enable(:agent_registry)
  3. Load /-/ml/agents for any project (for example /flightjs/Flight/-/ml/agents) and click Create agent

  4. Input an Agent Name and Prompt and click Create agent.

  5. Load the edit screen at /-/ml/agents/ID/edit. Ensure the agent name and prompt you just created are shown in the input fields.

  6. Make changes to the name and prompt and click Update agent.

  7. Load the edit screen again at /-/ml/agents/ID/edit and ensure your changes are displayed.

Edited by Darby Frey

Merge request reports