Resolving markup://agent_authoring:modelManager Exceptions in Agentforce Subagents

Resolving markup://agent_authoring:modelManager Exceptions in Agentforce Subagents

    How to Fix Salesforce Agentforce Error: [Agent definition model not found]

    Salesforce Agentforce administrators and developers occasionally encounter metadata synchronization issues during agent configuration, commit, or activation. One common blocker is the model definition lookup exception inside subagent routing scripts.

    The Issue

    During deployment or activation of an Agentforce Agent, the platform throws the following error:

    • Error: [Agent definition model not found]
    • Failing Descriptor: {markup://agent_authoring:modelManager}

    This failure occurs when the internal framework loses the binding reference to the subagent’s classifier model configuration, preventing successful metadata compilation.

    Step-by-Step Resolution

    To clear the broken metadata reference and restore activation functionality, perform a manual configuration toggle on the router subagent:

    1. Open your Agentforce Agent and navigate to the Agent Router (start_agent agent_router) subagent.
    2. Remove the following Agent Script code block:
       model_config:
    model: "model://sfdc_ai__DefaultEinsteinHyperClassifier"
    1. Save or apply the change to purge the cached state.
    2. Add the exact code snippet back into the Agent Script:
       model_config:
    model: "model://sfdc_ai__DefaultEinsteinHyperClassifier"
    1. Commit and activate the Agentforce Agent.

    Toggling this configuration forces Salesforce’s underlying modelManager descriptor to re-index the default Einstein classifier, resolving the exception instantly.

    Code & Metadata Best Practices

    • Metadata Cache Clearing: Removing and re-adding code blocks is a proven workaround for metadata cache desynchronization, which often occurs after major release updates or sandbox refreshes.
    • Source Control for Agent Scripts: Maintain external version control (e.g., Git) for all YAML and Agent Script definitions so you can safely purge and re-apply router configurations without risking uncommitted logic.
    • Classifier Verification: Ensure system-level default models (sfdc_ai__DefaultEinsteinHyperClassifier) are properly licensed and enabled in target org environments before deploying subagent configurations across pipeline stages.

    Leave a Reply