fix the agent support for scripting models