Fixes agent version being created with wrong id
What does this MR do and why?
Fixes agent version being created with wrong id
The agent id was being used to query messages, when agent_version id should be used.
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
Example below:
-
Ensure you have an EE license activated
-
Enable the feature flag and populate the database:
Feature.enable(:agent_registry) p = Project.find_by_id(1) agent = Ai::Agent.create(project: p, name: 'agent_1') Ai::AgentVersion.create!(agent: agent, project: p, prompt: "Prompt 1", model: "claude") Ai::AgentVersion.create!(agent: agent, project: p, prompt: "Prompt 2", model: "claude")
-
Load
/-/ml/agents
for the project used to create the agent, and click on the agentagent_1
-
Open inspection tools, and select
Network
-
Type something and send a message. A new graphql request will be generated. If the code works, under
Payload
you will seegid://gitlab/Ai::AgentVersion/2
, previously it would requestgid://gitlab/Ai::AgentVersion/1