Platform
Studio Authoring and Debugging
Author Studio-ready apps, use runtime patch APIs, and debug sessions efficiently.
#Studio Authoring and Debugging
Studio works best when your apps tell it a little about themselves: what prompts to suggest, how to run, and which variant to start with. This guide shows how to author apps so they behave cleanly in Studio, and how to track down problems fast once they are running.
#Authoring Studio-Friendly Apps
For reliable Studio behavior, each app module should expose:
- at least one top-level
AgentorSwarm APP_PROMPTS(recommended)- optional
APP_INVOCATION - optional
configure_variant(variant: str | None)
#Prompt Metadata
APP_PROMPTS entries support:
namecontentdescriptionis_defaultstructured_output(tool name)message_type(humanorredacted)variant(pre-select an app variant)
APP_PROMPTS = [ { "name": "Seed Memory", "content": "Store this deployment runbook...", "description": "Seed turn for memory lifecycle", "is_default": True, "message_type": "human", "variant": "focus", }]#Invocation Defaults
APP_INVOCATION lets Studio prefill execution options:
APP_INVOCATION = { "model": "balanced", "reasoning": "medium", "memory_config": { "enabled": True, "level": "focus", "summarization_enabled": True, },}For supervised multi-pass apps, set orchestration defaults in the same object:
APP_INVOCATION = { "orchestration_config": { "mode": "supervisor_loop", "final_output_mode": "supervised", "allow_followup_actions": True, "stop_strategy": "objective_satisfied", "allow_reevaluate_loop": True, "max_cycles": 5, },}Studio treats repeated deployments of the same agent as separate invocations. UI code should key
cards by invocation, assignment, or action ID rather than agent_name alone.
Supported keys:
modelreasoningforce_final_tooltargeted_toolsmetadatamemory_configsystem_tools_configorchestration_configallow_private_in_system_tools
Use system_tools_config when the app depends on system-tool runtime boundaries.
For example, a Studio-friendly compose_artifact app can pre-approve its intended target arg:
APP_INVOCATION = { 'force_final_tool': True, 'system_tools_config': { 'allowed_tools': ['compose_artifact'], 'approved_compose_artifact_targets': ['validate_query_artifact.query'], },}This keeps Studio runs aligned with the same policy checks enforced in normal SDK invocation.
#Variant Hook
Use configure_variant when your module must switch runtime wiring:
def configure_variant(variant: str | None) -> None: if variant == "focus": ... elif variant == "clarity": ...#Discovery Workflow
When you add a new app, point Studio's discovery at the directory that holds
it. Studio rescans on demand from the Scan Repo action in the catalog and
merges the result with apps you have already approved.
This keeps config aligned with actual modules and avoids drift inid/module/category.
#Introspection Workflow
Open an app in Studio's catalog and click into the Config tab to confirm
how Studio resolved your module:
- resolved agents and swarms
- tool inventory and dependencies
- discovered prompts
- private-data schema
- default invocation (from
APP_INVOCATION)
This is the fastest way to confirm that Studio is reading your module as
expected.
#Session Debugging Workflow
- Pick the app, optionally choose a variant, send a controlled test message.
- Watch the Inspect tab for the live SSE stream. (The Inspector also
surfaces the Recall tab for memory state, Config for the active
invocation config, and Schedule for upcoming scheduled fires.) - Resolve any
interrupt_requiredprompts inline. - Send follow-ups in the same session to keep
thread_idcontinuity. - Use the per-event detail view for replayable event history.
Studio runs locally for the developer who owns the data, so it keeps full
bridge visibility for debugging. If you reuse the same event patterns in a
customer-facing app, switch your backend bridge toEventBridge(..., audience="frontend_safe") to apply the safe redaction layer.
If you are debugging duplicate activity in Studio, separate transport replay
from logical duplicate delivery:
- replay duplicates usually indicate a reconnect/history issue
- repeated interrupts or adjacent identical status messages usually indicate
overlapping producer paths in your own emission code
#Batch Matrix Debugging
Use Studio's Batch Matrix when you need to compare prompts, variants, models,
or targeted tools in one grouped turn. Each matrix row becomes one batch item
and can override variant, model, reasoning, system_message, andtargeted_tools without changing the app module. Uniform batches reuse the
top-level invocation settings for every item.
The batch SSE sequence is:
batch_start: pending row metadatabatch_item_complete: one completed row payloadbatch_complete: aggregate status and all item results
#Runtime Patching Without Restart
Studio supports live edits to a loaded app's prompts, descriptions, tags,
limits, and per-agent / per-swarm settings while a session is running. Use
this for rapid iteration while diagnosing behavior — saved prompt and
description edits persist in maivn_studio.json; runtime agent/swarm patches
apply only to the live loaded instance for the rest of the session.
#Memory-Specific Debugging Tips
For memory apps:
- reuse the same
thread_idacross turns - verify enrichment events:
memory_retrieving,memory_retrieved,memory_indexing - expect some memory/document extraction phases after
final - validate recall using a follow-up query and check hit counts in enrichment payloads
If retrieval appears empty:
- confirm
memory_config.levelis at leastglimpse - confirm thread continuity (
thread_id) - allow short delay for async post-finalize indexing