Fixes bug causing AI Agent prompt updates not to be saved
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
-
Ensure you have an EE license activated
-
Enable the feature flag
Feature.enable(:agent_registry)
-
Load
/-/ml/agents
for any project (for example/flightjs/Flight/-/ml/agents
) and clickCreate agent
-
Input an Agent Name and Prompt and click
Create agent
. -
Load the edit screen at
/-/ml/agents/ID/edit
. Ensure the agent name and prompt you just created are shown in the input fields. -
Make changes to the name and prompt and click
Update agent
. -
Load the edit screen again at
/-/ml/agents/ID/edit
and ensure your changes are displayed.