Skip to content

API Reference parrot.handlers.studio.agents

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.handlers.studio.agents

View source

Studio agent lifecycle endpoints (FEAT-467 TASK-2512).

Implements the core agent CRUD of the Studio API (spec §3 Module 4):

POST   /api/v1/astudio/agents               — create a simple agent
GET    /api/v1/astudio/agents                — list (registry + DB, merged)
GET    /api/v1/astudio/agents/{name}          — single agent
POST   /api/v1/astudio/agents/{name}/reload   — hot reload (TASK-2510)
DELETE /api/v1/astudio/agents/{name}          — delete (factory-origin only)

Reuses the proven patterns of ChatbotHandler (handlers/bots.py) — slugify/duplicate-check discipline, server-set created_by, merged registry+DB listing — WITHOUT touching bots.py itself (spec §7 "bots.py untouched" regression-isolation constraint).

Package layout (oversize-module split, owner decision D1): the two views live here with their verbs and PBAC gates; the shared helpers, the legacy filesystem bodies, the database-mode bodies and the reload paths are mixins in _mixin.py / _legacy.py / _db.py / _reload.py.

Alias AGENTS_DIR

Re-exported from parrot.conf.AGENTS_DIR.

Class StudioAgentReloadHandler

POST /api/v1/astudio/agents/{name}/reload — hot-swap an agent.

Delegates to BotManager.reload_agent (FEAT-467 TASK-2510); this handler only maps the typed errors it raises to HTTP status codes.

Method StudioAgentReloadHandler.post

Reload a Studio agent through manager.studio (database mode) or reload_agent (legacy).

post()

Class StudioAgentVisibilityHandler

PATCH /api/v1/astudio/agents/{name}/visibility — change who can see an agent (owner/admin only).

Method StudioAgentVisibilityHandler.patch

Set visibility / allowed_groups of a Studio agent (404 invisible, 403 not manageable, 422 rules).

patch()

Class StudioAgentsHandler

/api/v1/astudio/agents and /api/v1/astudio/agents/{name}.

GET (list/single), POST (create), DELETE (factory-origin only).

Method StudioAgentsHandler.get

List all agents, or return a single agent by name (database mode: Studio rows + legacy on GLOBAL).

get()

Method StudioAgentsHandler.post

Create an agent: database mode persists a Studio row; filesystem mode registers (legacy).

post()

Method StudioAgentsHandler.delete

Delete a Studio row (database mode) or a factory-origin YAML agent; DB agents are delegated.

delete()

Method StudioAgentsHandler.patch

PATCH /agents/{name} — edit the General fields (database mode only, spec §2.9a).

patch()

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally