Framework
The AI Assistant playground lets a developer exercise a registered chat or structured-output agent before embedding it in a page. Choose the agent, send a representative input, then use the debug panel to inspect what the runtime received and returned.
The playground is the fastest way to exercise a registered agent end-to-end without wiring a host page. It supports both chat and object execution modes and ships a debug panel that mirrors the panels the Code Mode Command Palette exposes.
Open at /backend/config/ai-assistant/playground. Requires the ai_assistant.settings.manage feature.
Every agent aggregated into ai-agents.generated.ts shows up in the picker. The selection drives:
POST /api/ai_assistant/ai/chat?agent=<module>.<agent> (chat mode).POST /api/ai_assistant/ai/run-object?agent=<module>.<agent> (object mode).When the picked agent declares executionMode: 'chat' (the default), the playground renders an <AiChat> instance with:
mutation-preview-card, field-diff-card, confirmation-card, mutation-result-card) pre-registered.conversationId so idempotency dedupes repeated turns.agent.acceptedMediaTypes is non-empty.data-agent-task-plan / data-agent-task-update.When the picked agent declares executionMode: 'object', the playground swaps the chat for a JSON input editor and a result panel. The runtime validates the returned object against agent.output.schema and surfaces violations inline.
The panel shows the resolution the dispatcher used for the current session:
createModelFactory.resolveModel).isMutation flags, and requiredFeatures.default | override | placeholder).prepareStep swaps are visible here), tool calls and repairToolCall attempts per step, total tokens, and the stop reason (stepCountIs / hasToolCall / loop_budget_exceeded / finish-reason:stop|tool-calls|length / aborted). Populated from the dispatcher SSE loop-finish event; the same trace renders inside any host <AiChat> whose debug prop is truthy.The visible task plan and LoopTrace serve different audiences. The task plan is live operator-facing progress copy; it appears during a turn and must never contain private reasoning. LoopTrace is a debug-only, post-turn execution trace for developers and admins.
When a tenant has flipped the Disable agentic loop kill switch from Settings, the playground (and any <AiChat> instance for that agent) renders a LoopDisabledBanner above the composer and the dispatcher collapses the agent to a single model call.
Use the panel to confirm that a newly-saved prompt or loop override reached the runtime without restarting anything.
The playground reuses the shared <AiChat> shortcut set:
| Shortcut | Action |
|---|---|
Cmd/Ctrl + Enter | Send the current message (or submit the JSON in object mode) |
Escape | Abort the in-flight request |
Shift + Enter | Insert a newline inside the message |
<AiChat><AiChat> embedded in a backend page for the real user flow – the playground does not pass a pageContext, so agents that depend on resolvePageContext see a blank hydration.Use this route after changing task plans, tool streaming, or prompt guidance:
/backend/config/ai-assistant/playground and pick customers.account_assistant or customers.deal_analyzer.Find deals assigned to Joe and summarize the useful matches.pending or running to done, and the raw meta.update_task_plan tool row is not shown as an operator task. Catalog agents stay quiet by default unless you opt them in with taskPlan: { enabled: true }.failed while the final assistant text still renders.This AI Assistant settings page runs chat and object-mode agents. To run Enterprise Deal health check and review the resulting proposal, use Agents → Playground at /backend/playground. Follow Run an agent in Playground for the full example.