Skip to main content

Legacy and modern agent metadata in the same deployment

What the legacy and modern agent metadata problem analyzer checks for when one deployment holds both for the same Agentforce agent.

Written by Josh Camilleri

This problem analyzer stops your deployment failing when it holds both the legacy and the modern components for the same Agentforce agent.

What triggers this problem analyzer?

Salesforce API version 68 includes planner bundles again, so one deployment can carry a complete legacy agent (Bot, BotVersion, and GenAiPlannerBundle) and the modern components (AiAgentDefinition and AiAgentDefinitionVersion) for the same agent. A deployment that carries both fails.

This problem analyzer triggers when your deployment holds both representations of the same agent:

  • A complete legacy agent and a complete modern agent.

  • A complete legacy agent and only part of the modern agent, which happens when a modern component fails to fetch.

Gearset flags it with this message:

Deploying a Bot, BotVersion, or GenAiPlannerBundle alongside the AiAgentDefinition or AiAgentDefinitionVersion that represents the same agent causes the deployment to fail. Salesforce only accepts one representation of an agent per deployment.

The analyzer does not trigger when neither representation is complete. A deployment like that still fails, and the missing dependencies problem analyzer may be enough to fix it.

What problem is it solving?

Salesforce rejects a deployment that sends both the legacy and the modern components for one agent. Removing the overlap before the deployment runs keeps the agent on a single representation.

How does it work?

Gearset removes the components that cause the failure, and keeps one representation of the agent:

  • Where both representations are complete, Gearset keeps AiAgentDefinition and AiAgentDefinitionVersion.

  • Where the legacy agent is complete and the modern agent is not, Gearset removes AiAgentDefinition and AiAgentDefinitionVersion.

The fix is not selected by default. Check the problem analyzer screen and select it before you deploy. CI jobs apply it automatically, so to stop that, turn the analyzer off in your problem analyzer templates.

If you accept another problem analyzer's fix that adds a component this analyzer would remove, this analyzer's removal wins.

Did this answer your question?