loader

How to Configure the AI Agent Correctly in ScriptExpert Code Editor

By likegeo 0 replies 6 views 0 score

Hello everyone,

ScriptExpert includes the Cline AI Agent for planning tasks, analyzing projects, editing files, running commands and helping with development directly inside the code editor.

This guide explains how to configure the AI Agent correctly, how to choose a provider and models, and what the runtime settings mean.

Opening the AI settings

Open ScriptExpert and navigate to:

Settings → AI

You can also open the AI configuration window directly from the AI panel.

The available agent is:

Agent: Cline

Selecting an AI provider

ScriptExpert supports the following providers:


                      • OpenAI
                      • OpenAI-compatible custom
                      • OpenRouter
                      • Groq
                      • Google Gemini
                      • GitHub Models
                      • Cerebras
                      • Together AI
                      • DeepSeek
                      • Mistral
                      • xAI
                      • LM Studio local
                      • Ollama local


                        Cloud providers require an account and usually an API key. Some providers offer free quotas, while others charge based on token usage.

                        Local providers such as Ollama and LM Studio do not require a paid API key.

                        Configuring a cloud provider

                        Select the provider you want to use. ScriptExpert automatically fills in the correct Base URL for known providers.

                        Click the API key button to open the provider’s official API-key page, create a key and paste it into the API key field.

                        Example configuration:

                        Provider: OpenAI
                        Base URL: https://api.openai.com/v1
                        API key: your-provider-api-key
                        Plan model: a strong reasoning model
                        Act model: a fast coding and tool-use model
                        

                        Do not modify the automatically configured Base URL unless the provider specifically requires a different endpoint.

                        After entering the key, press:

                        Test connection
                        

                        A successful result should display:

                        OK: number-of-models models
                        

                        You can then select the Plan and Act models from the refreshed lists.

                        Configuring OpenAI-compatible custom providers

                        Use OpenAI-compatible custom for a self-hosted API or a provider that implements the OpenAI API format but does not appear in the predefined provider list.

                        Example:

                        Provider: OpenAI-compatible custom
                        Base URL: https://your-provider.example.com/v1
                        API key: your-api-key
                        

                        Some local OpenAI-compatible servers do not require a real API key. If the server expects a value, you can use a placeholder such as:

                        local
                        

                        The endpoint must provide a compatible models endpoint and chat-completions API.

                        Configuring Ollama

                        When Ollama runs on the same computer:

                        Provider: Ollama local
                        Ollama URL: http://localhost:11434
                        

                        When Ollama runs on another computer in your local network:

                        Ollama URL: http://192.168.1.100:11434
                        

                        Replace the address with the IP of your Ollama server.

                        Do not add /v1 to the Ollama URL. ScriptExpert automatically uses the necessary Ollama and OpenAI-compatible endpoints.

                        Press the refresh button beside the Act model field. ScriptExpert will load the models installed on the Ollama server.

                        Example:

                        Plan model: qwen2.5-coder:7b
                        Act model: qwen2.5-coder:7b
                        

                        If the computer has limited VRAM, use the same model for both Plan and Act. This avoids repeatedly loading different models into memory.

                        See our separate Ollama server setup guide for complete installation and hardware instructions.

                        Configuring LM Studio

                        Start the local server from LM Studio, then configure:

                        Provider: LM Studio local
                        Base URL: http://localhost:1234/v1
                        

                        Make sure a model is loaded in LM Studio and its local server is running before pressing Test connection.

                        Understanding Plan model and Act model

                        ScriptExpert allows separate models for planning and execution.

                        Plan model

                        The Plan model is used to:

                        • analyze the request;

                        • inspect the project structure;

                        • identify affected files;

                        • design an implementation;

                        • find possible risks;

                        • prepare the steps before making changes.

                        Choose a model with strong reasoning and good code understanding.

                        Act model

                        The Act model is used to:

                            • edit files;
                            • generate code;
                            • fix errors;
                            • run commands;
                            • apply the implementation;
                            • work with tools and project files.


                          Choose a model that supports coding and tool use reliably.

                          For paid providers, you can use a powerful model for planning and a faster, less expensive model for execution.

                          For local providers, using the same model for both modes is usually more efficient.

                          Context length

                          The context length controls how much conversation, code and project information the agent can keep available.

                          Available options are:

                          4k
                          8k
                          16k
                          32k
                          64k
                          

                          Recommended usage:

                          • 4k: simple questions and small code snippets;

                          • 8k: small tasks and files;

                          • 16k: recommended starting point for normal development;

                          • 32k: larger features and multi-file tasks;

                          • 64k: large projects and repository-level analysis.

                          A larger context consumes more API tokens or local GPU memory. Do not select 64K automatically if your local model or GPU cannot support it efficiently.

                          Recommended starting setting:

                          Context length: 16k
                          

                          For an Ollama server with 8 GB VRAM, start with 8K or 16K. Increase it only if the model remains fully loaded on the GPU.

                          Thinking depth

                          Thinking depth controls how much reasoning the agent should perform before responding or acting.

                          Available settings:

                          • Low: faster responses for simple tasks;

                          • Medium: balanced speed and accuracy;

                          • High: deeper analysis for difficult bugs or architectural work.

                          Recommended default:

                          Thinking depth: Medium
                          

                          Use High for complex debugging, database changes, licensing systems or major refactoring. High thinking may increase response time and API costs.

                          Show and lock files while the agent edits

                          Recommended setting:

                          Show and lock files while the agent edits: Enabled
                          

                          When enabled, ScriptExpert opens the file currently being edited and temporarily locks it to reduce conflicts between manual and AI changes.

                          Keep this enabled unless you have a specific workflow that requires editing the same file simultaneously.

                          Auto-compress context

                          Recommended setting:

                          Auto-compress context when it gets large: Enabled
                          

                          ScriptExpert automatically summarizes older context when the conversation approaches the configured limit.

                          This helps prevent context-overflow errors and allows longer development sessions.

                          Enter sends messages

                          Enable this option if you want the Enter key to send your message immediately.

                          Leave it disabled if you frequently write multi-line prompts and want to use the Send button manually.

                          Maximum agent iterations

                          This setting controls how many internal action cycles the agent may perform during one task.

                          Recommended default:

                          Max agent iterations: 40
                          

                          Suggested values:

                          • 10–20: small and controlled tasks;

                          • 30–40: normal feature development;

                          • 50–60: complex multi-file work;

                          • more than 60: only when necessary.

                          A higher value does not automatically improve the result. It can increase API costs and allow a poorly defined task to continue for too long.

                          Task timeout

                          This setting defines how long the agent may work on one task.

                          Recommended values:

                          Cloud provider: 30 minutes
                          Local Ollama model: 45–60 minutes
                          Large local model: 60–120 minutes
                          

                          Slow local models may need a longer timeout, especially when analyzing large projects or generating multiple files.

                          Project Prompt

                          The Project Prompt explains the purpose and technology of the current project.

                          Example:

                          This is a Laravel marketplace application for digital products. It uses PHP 8.3, Laravel, MySQL, Blade, Bootstrap and a plugin-based architecture.
                          

                          Keep this field concise. It should describe what the project is, not contain a complete task.

                          Project Instructions

                          Project Instructions define rules that the agent must follow while working on the selected project.

                          Example:

                          Inspect existing code before making changes.
                          Follow the current Laravel architecture and coding style.
                          Do not modify unrelated files.
                          Do not remove existing functionality.
                          Use the existing database and service patterns.
                          Validate all user input.
                          Run relevant tests after implementation.
                          Report every modified file.
                          

                          Good project instructions significantly reduce unnecessary changes and help the agent remain consistent with your codebase.

                          Avoid contradictory or excessively long instructions.

                          Skills

                          Skills provide reusable project knowledge and workflows to the agent.

                          Example:

                          [
                            {
                              "title": "Laravel Development",
                              "content": "Use Laravel validation, service classes and existing project conventions. Do not place business logic directly in Blade templates."
                            },
                            {
                              "title": "Safe Database Changes",
                              "content": "Use migrations for schema changes. Never delete production data. Check existing columns and indexes before creating new ones."
                            }
                          ]
                          

                          The Skills field must contain a valid JSON array.

                          Use the Import button to import an existing skill file. Only import skills from trusted sources.

                          MCP servers

                          MCP servers extend the agent with optional tools such as:

                              • persistent memory;
                              • filesystem access;
                              • Git operations;
                              • web-page fetching;
                              • sequential thinking;
                              • date and timezone information.


                          MCP configuration must be a valid JSON array.

                          Example:

                          [
                            {
                              "name": "memory",
                              "command": "cmd",
                              "args": [
                                "/c",
                                "npx",
                                "-y",
                                "@modelcontextprotocol/server-memory"
                              ],
                              "enabled": true
                            }
                          ]
                          

                          MCP servers can execute local commands and access resources. Install and enable only servers you trust.

                          Beginners should configure the provider and models first and leave MCP servers empty until the basic AI Agent works correctly.

                          Recommended balanced configuration

                          For most users:

                          Agent: Cline
                          Context length: 16k
                          Thinking depth: Medium
                          Show and lock files while editing: Enabled
                          Auto-compress context: Enabled
                          Max agent iterations: 40
                          Task timeout: 30 minutes
                          

                          For a local Ollama server:

                          Provider: Ollama local
                          Ollama URL: http://localhost:11434
                          Plan model: qwen2.5-coder:7b
                          Act model: qwen2.5-coder:7b
                          Context length: 8k or 16k
                          Thinking depth: Medium
                          Max agent iterations: 40
                          Task timeout: 60 minutes
                          

                          Testing the configuration

                          Before starting real development:

                          1. Press Test connection.

                          2. Confirm that ScriptExpert displays OK.

                          3. Save the AI settings.

                          4. Open or select a project.

                          5. Open the AI panel.

                          6. Start with a small test task.

                          Example:

                          Inspect this project and identify the main framework, entry points and database configuration. Do not modify any files.
                          

                          Next, test Plan mode:

                          Create an implementation plan for adding a contact-phone field. Do not edit files yet.
                          

                          After reviewing the plan, switch to Act mode and request the implementation.

                          Writing better tasks

                          A good request should include:

                          • the desired result;

                          • the affected page or feature;

                          • important restrictions;

                          • whether tests should be run;

                          • what the agent must not change.

                          Good example:

                          Add a phone-number field to the existing contact form. Follow the current validation and design patterns. Update only the required controller, request validation and Blade view. Do not modify unrelated pages. Run the relevant tests and report every changed file.
                          

                          Avoid vague requests such as:

                          Fix the application.
                          

                          The more precise the task, the safer and more predictable the result.

                          Troubleshooting

                          If Test connection fails:

                          • verify the API key;

                          • verify the Base URL;

                          • check whether the provider account has available quota;

                          • confirm that the selected model is still available;

                          • check that Ollama or LM Studio is running;

                          • verify firewall access for a remote local server.

                          If the agent stops before finishing:

                          • increase Max agent iterations;

                          • increase Task timeout;

                          • check for provider rate limits;

                          • use a faster model;

                          • divide the request into smaller tasks.

                          If the agent forgets earlier information:

                          • increase Context length if your provider or hardware supports it;

                          • keep Auto-compress enabled;

                          • move permanent rules into Project Instructions;

                          • create a reusable Skill for repeated rules.

                          If the agent changes too many files:

                          • make the request more precise;

                          • specify the allowed files;

                          • add Do not modify unrelated files to Project Instructions;

                          • use Plan mode before Act mode.

                          Final advice

                          Always begin an important task in Plan mode. Review the proposed approach, correct any incorrect assumptions, and only then allow the agent to continue in Act mode.

                          Keep backups or use Git before allowing the AI Agent to modify production projects. Review all generated code, database changes and terminal commands before deploying them.

                          If you need help, reply to this topic with:

                          • your operating system;

                          • selected provider;

                          • Plan and Act models;

                          • context length;

                          • the exact connection or agent error;

                          • whether you are using a local or cloud model.

                          ScriptExpert website:

                          https://scriptexpert.net

                          0 / 0

                          Replies

                          No replies yet.