Agentic Studio and Tool-Calling Guide
Complete setup and usage guide for the Agentic pane in Studio, including worker orchestration, tool contracts, cancellation behavior, and practical prompt patterns.
Overview
Agentic mode lets Studio run multi-step plans through a relay-connected orchestrator worker. Instead of one-shot model responses, the agent can choose tools, observe outputs, iterate, and return a final answer with an execution trace.
Two user entry points exist:
- Agentic pane in Studio (dedicated run/stop panel with trace viewer).
- Assistant -> Run as Agentic in chat, using the same backend route.
Runtime architecture
Studio browser
-> POST /api/agentic/run (authenticated)
-> server/agentic.js bridge
-> relay message to AgenticStarter worker
-> planner (Ollama)
-> tool workers (http, memory, registry, filesystem, clouddb)
<- answer + per-step trace
<- JSON response for UI
The server route is a relay bridge and guardrail layer. Tool execution and planning happen in the external workers.
Prerequisites
| Requirement | Why |
|---|---|
| Studio running and signed in | Agentic API route requires authenticated session. |
| Relay URL | All worker communication is relay request/reply. |
| AgenticStarter worker online | Handles function: agent.run requests. |
| Ollama reachable | Planner calls /api/chat for step planning. |
| Tool workers online | Agent actions depend on target workers (http/memory/etc). |
Worker setup
1. Prepare agentic starter
cd agentic-starter
npm install
cp .env.example .env
2. Set core variables
RELAY_URL=https://relay.yourdomain.com
AGENT_NAME=AgenticStarter
OLLAMA_HOST=http://127.0.0.1:11434
OLLAMA_MODEL=qwen2.5:7b
AGENT_MAX_STEPS=6
AGENT_PLAN_RETRIES=2
AGENT_TOOL_RETRIES=2
3. Start workers
# terminal 1
npm run start:tool:memory
# terminal 2
npm run start:tool:http
# terminal 3
npm run start:tool:registry
# terminal 4
npm run start:tool:filesystem
# terminal 5
npm run start:tool:clouddb
# terminal 6
npm run start:agent
Studio pane workflow
- Open the Agentic pane in Studio.
- Set Relay URL and Agent name (default agent name is
AgenticStarter). - Set max steps (UI enforces 1 to 12).
- Optionally keep Include current editor context enabled to pass file/selection/problems context.
- Write goal and click Run goal.
The response renders as:
- Answer: final agent text.
- Trace: per-step thoughts, actions, and observations.
Pane context payload (automatic)
{
"source": "studio-agentic-pane",
"at": "2026-10-02T12:34:56.000Z",
"editor": {
"openFile": {"name":"...","type":"...","content":"..."},
"files": [...],
"selection": "...",
"errors": [...],
"problems": [...]
}
}
Assistant workflow (Run as Agentic)
From Assistant chat, the Run as Agentic button sends the current prompt through the same API route. While running, the button switches to Stop Agentic. On cancellation it shows Agentic run stopped.
This is useful when you want to keep conversational history in Assistant while still invoking tool-calling for selected prompts.
API contract
Request: POST /api/agentic/run
{
"relay": "https://relay.yourdomain.com",
"agent": "AgenticStarter",
"goal": "Find latest Node LTS and save it to memory",
"maxSteps": 6,
"context": {"source":"manual-api-call"}
}
Response (success)
{
"ok": true,
"answer": "Latest LTS is ... and was saved.",
"trace": [
{
"step": 1,
"thought": "Need current release info.",
"actions": [{"tool":"http.request","args":{"url":"..."}}],
"observations": [{"tool":"http.request","ok":true,"output":{...}}]
}
]
}
Server validation and limits
| Field | Rule |
|---|---|
goal | Required, cleaned text, max 8000 chars. |
relay | Required http(s) URL. |
agent | Regex ^[A-Za-z0-9_-]{1,128}$. |
maxSteps | Clamped to 1..12. |
context | JSON object only, max 200000 chars after stringify. |
| Rate limit | 120 requests/hour per signed-in user. |
Tool-calling details
The orchestrator recognizes these tool names by default:
| Tool name | Purpose |
|---|---|
http.request | External/internal HTTP calls. |
memory.list/get/set/delete | Persistent agent memory KV operations. |
registry.search/package | Nodofi package registry lookup. |
filesystem.list/read/write/append/delete | Root-scoped file operations. |
clouddb.call | Forward operations to CloudDB worker over relay. |
Example action shape
{
"tool": "memory.set",
"args": {
"namespace": "research",
"key": "latest_node_lts",
"value": "v22.x"
}
}
Goal templates and examples
Research + cache pattern
Find the latest Node.js LTS release from official sources. Save it in memory namespace "release_cache" key "node_lts" and return a 3-line summary.
Workspace file synthesis pattern
Read docs/setup.md and docs/api.md, then write a concise onboarding note to docs/quick-onboarding.md with sections: prerequisites, first run, gotchas.
CloudDB operational pattern
Using clouddb.call, list rows from project 0123... table tasks where status=todo limit 20, then produce a markdown sprint checklist.
Constrained safe prompt pattern
Do not call filesystem.write or filesystem.delete. Only use filesystem.read and memory.* tools. Analyze the release notes and summarize upgrade risks.
Stop/cancel semantics
What happens when user clicks Stop
- Browser aborts
fetchfor/api/agentic/run. - Server detects request close and aborts relay wait.
- Server sends relay message
{"function":"agent.cancel","runId":"..."}. - Orchestrator looks up active run by runId and aborts its controller.
- Planner/tool loops stop at next abort check; in-flight relay asks that honor signals are cancelled.
User-visible outcomes
- Agentic pane: status becomes
Agent run stopped. - Assistant flow: message bubble becomes
Agentic run stopped.
Cancellation is cooperative. If a specific external operation is not abort-aware, stop takes effect at the next checkpoint.
Trace interpretation
Each trace step contains these parts:
| Field | Meaning |
|---|---|
thought | Short model rationale for current step. |
actions | Tool calls selected by planner. |
observations | Tool results or errors returned to planner. |
final (optional) | Final answer text when done in that step. |
Debug approach: identify first step where ok: false appears, then inspect worker availability, arguments, and connectivity.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| "relay must be an http(s) URL" | Invalid relay input | Use full URL including protocol. |
| "agent must be 1-128..." | Name has unsupported chars | Use letters, numbers, underscore, dash only. |
| "The agent did not answer in time." | Worker offline / model stalled | Check agent logs, relay connectivity, Ollama reachability. |
| Frequent step failures in trace | One or more tool workers down | Start missing workers and retry. |
| 429 rate limit error | Exceeded hourly cap | Wait until request window clears or reduce automation burst. |
| Stop pressed but still running briefly | Cooperative cancellation checkpoint delay | Expected; watch for next step boundary termination. |
Safety and limits
- Do not expose privileged filesystem roots to agent workers unless strictly needed.
- Use least-privilege worker credentials for registry/CloudDB environments.
- Treat memory namespace data as untrusted input when reused in future runs.
- For production, add explicit allowlists for outbound HTTP domains if possible.
- Keep goal prompts bounded and explicit to reduce unintended tool actions.