alibaba/nacos · error · IllegalArgumentException

The first Agent draft must contain callInterfaces and cannot

Error message

The first Agent draft must contain callInterfaces and cannot use basedOnVersion

What it means

Error "The first Agent draft must contain callInterfaces and cannot use basedOnVersion" thrown in alibaba/nacos.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentOperationService.java:963

        result.setTags(request.getTags());
        result.setExtensions(request.getExtensions());
        result.setStatus(AiConstants.Agent.RESOURCE_STATUS_ENABLE);
        String currentIdentity = VisibilityHelper.resolveCurrentIdentity();
        result.setOwner(StringUtils.isBlank(currentIdentity) ? DEFAULT_OWNER : currentIdentity);
        result.setScope(VisibilityHelper.resolveDefaultScopeForCreate(RESOURCE_TYPE));
        return result;
    }
    
    private Agent toInitialLegacyAgent(String namespaceId, AgentDraftCreateRequest request) {
        Agent result = toInitialAgent(namespaceId, request);
        result.setScope(VisibilityConstants.SCOPE_PUBLIC);
        return result;
    }
    
    private void requireInitialDraftContent(AgentDraftCreateRequest request) {
        if (StringUtils.isNotBlank(request.getBasedOnVersion())
            || request.getCallInterfaces() == null) {
            throw new IllegalArgumentException(
                "The first Agent draft must contain callInterfaces and cannot use basedOnVersion");
        }
    }
    
    private boolean hasInitialAgentMetadata(AgentDraftCreateRequest request) {
        return request.getDisplayName() != null || request.getDescription() != null
            || request.getIconUrl() != null || request.getProvider() != null
            || request.getTags() != null || request.getExtensions() != null;
    }
    
    private void validateListFilters(String agentNameContains, String tag, String scope,
        String orderBy) {
        if (StringUtils.isNotEmpty(agentNameContains)) {
            AgentValidationUtils.validateAgentName(agentNameContains);
        }
        if (StringUtils.isNotBlank(tag)
            && tag.codePointCount(0, tag.length()) > MAX_TAG_LENGTH) {
            throw new IllegalArgumentException("Invalid Agent tag filter: " + tag);

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Review the input and runtime state for ai service agent draft create, correct the reported problem, and retry.

When it happens

Trigger: Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentOperationService.java:963 when the library encounters an invalid state.

Common situations: Creating the first draft of an Agent without callInterfaces, or passing basedOnVersion on the very first draft.


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/885a7914485e486f. Report an issue: GitHub.