Skip to content

Studio HTTP API

View as Markdown

Studio serves one HTTP surface under its base path: a JSON API under api/, OTLP ingest under v1/, the devtools panel’s two files, and the UI shell for every other path. This page lists every route weft v0.20.2 registers, with its parameters, who may call it, the capability that gates it, the response shape and the status codes. The how-to pages are Run Studio, Secure Studio and Watch runs live; the Go side is weft/studio.

Terminal window
curl -s -H "Authorization: Bearer $WEFT_STUDIO_TOKEN" http://127.0.0.1:7331/api/meta

The answer, from a weft studio with a token and the playground on (trimmed: db.path shortened):

{
"weft_version": "v0.20.2",
"studio_version": "v0.20.2",
"panel_version": "v0.20.2",
"db": { "kind": "sqlite", "path": "…/weft.db", "size": 278528 },
"title": "weft studio",
"has_manifest": false,
"ingest_open": true,
"ingest": { "dropped": [], "accepted": 0, "refused": 0 },
"interrupted_after_ms": 30000,
"capabilities": ["requests", "steps", "export", "logs", "diff", "traces", "search", "manifests",
"spans_tree", "timeline", "pricing", "delete", "proposals", "live", "ingest", "auth", "handoff",
"panel-config", "runtimes", "preview", "breakpoints", "steer", "cancel", "playground"],
"manifest_sources": 0,
"auth_required": true,
"live_all": true,
"debug_scope": "runtime-started runs",
"content": {
"ingest": "as_received",
"latest": { "run_id": "0284b9967cc95119e5e12416f9982fe9", "mark": "full", "note": "the latest run's content is stored in full" }
},
"pricing": { "source": "default", "dated": "2026-10-10", "models": 47 },
"retention": null,
"runtimes": 0,
"manifest_check": null,
"pid": 3015109
}

These hold for every route unless its row says otherwise.

TopicRule
Base pathEvery path on this page is relative to Studio’s base: / under weft studio, /studio/ by default for an embedded studio.Handler (studio.Base)
FormatJSON, application/json; charset=utf-8. Times are RFC 3339; every time parameter takes RFC 3339 only (since=2026-10-17 is a 400), except /api/stats’ since, which also takes a positive duration (90m, 24h, 7d)
Errors{"error": {"code", "message"}}, plus request_id on a 5xx. Codes: bad_request (400, and 413 over a body cap), unauthorized (401), forbidden (403), not_found (404), method_not_allowed (405), conflict (409), unsupported (415, ingest only), internal (500), not_implemented (501: spans?tree=1, the session timeline and entries, or an error_class filter, on a database that cannot serve them), unavailable (503)
Badged errorsA refusal that is about a hole adds badge, reason and fix beside error: 403 hidden (a read-scoped token), 409 with the record’s hole, 400 derived (a run built from stock spans)
Database errorsobsdb.ErrNotFound is 404 no <noun> <id>. Any other read error is 500 read <noun> <id>: <err>; a panel token gets read <noun> <id> failed, the cause only in the server log
Request bodiesAt most 4 MiB on every /api route (413 <what>: larger than the 4 MiB limit); the runtime link’s register and acks take 8 MiB; ingest takes 16 MiB after decompression
Headers on every responseX-Request-Id (yours when it is 1 to 64 characters of [A-Za-z0-9._:-], else 16 generated hex digits), X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer, and a Content-Security-Policy that loads nothing from another origin
Methods and unknown pathsA GET route also answers HEAD, without a body. A wrong method on a path under api/ or v1/, and an unknown path there, is 404 no such api route <path> in the error shape, never the UI shell; under api/ that answer comes after the token wall, so without a bearer it is the wall’s 401. The UI shell answers 405 to a method other than GET or HEAD
PagingRun, session and trace lists take limit (0 or absent: 50; above 500: clamped to 500; negative or not an integer: 400 limit must be a non-negative integer) and the cursor before (RFC 3339) plus before_id (an exact cursor inside a tie). They answer total, next_before and next_before_id, both null on the last page. before_id is read only beside before: sent alone, it is ignored. A group of rows with the same timestamp is never split: a page may hold up to 500 rows past limit
Run idsA subagent’s run id holds slashes (<parent>/<step>/<call id>), so on GET and DELETE everything after /api/runs/ is the id. The POST verbs (approvals, steer, cancel) and GET /api/runs/{id}/commands take one path segment: send a child id with its slashes encoded as %2F. A trailing events, transcript, spans, requests, tools, export or logs segment, or steps/<n>, is a sub-route; a child id that ended in one of those words would be shadowed, and provider call ids never do
CORSWith a Token or an AllowOrigins list, every answer carries Vary: Origin. An allowed origin gets Access-Control-Allow-Origin, methods GET, POST, PUT, DELETE, OPTIONS, headers Authorization, Content-Type, Last-Event-ID, Access-Control-Expose-Headers: X-Request-Id; a preflight is 204 with Max-Age: 600. With a Token and no list, the allowed origins are http or https localhost and 127.0.0.1 on any port. The entry "*" admits every origin and, in setup A, every Host

The route groups are registered in studio/routes.go; /api/meta’s capabilities is computed from them, never hard-coded, and the panel and playground files add their own groups through package hooks.

SinceChange
0.7.0The route groups; the read routes (transcript, spans, traces/{id}, sessions, public/{public_id}, panel-tokens); S4.3’s run row with the identity chain in full (parent_run_id, trace_id, service, session_id, public_id, turn, playground, experiment_id, forked_from, meta, last_seen, pending, stop_reason, message_count)
0.8.0The run and session lists take before_id and answer next_before_id; every /api body is capped at 4 MiB
0.14.0The trace list, with the same cursor from the start
0.18.0A session is grouped over its own turns, pool child sessions included; its status is the newest turn’s outcome. Caller-linked runs leave children. The session timeline, entries and export routes
studio 0.1.0The read API is pinned by golden files on the Go side, and the web app mirrors their types against the same fixtures

Studio knows five callers. The security page explains the setups; this table is the rule each route below applies.

CallerHow Studio knows itReadsWrites
Server token (the dev token under weft studio)Authorization: Bearer equal to studio.Token, compared in constant timeEverythingEverything
Setup ANo Token configured, and the Host is loopback (localhost, *.localhost, 127.0.0.0/8, [::1]) or an AllowOrigins host:portEverythingEverything from its own origin; an unsafe method from another Origin, or with no Origin but Sec-Fetch-Site: cross-site, is 403 cross-origin write refused (setup A): …
Playground panel tokenweft_pt.<payload>.<signature> minted with "playground": trueIts public id’s runs, sessions, traces and stream, prompts includedRuns, decisions, steer and cancel inside its public id
Read panel tokenA panel token minted without playgroundIts public id’s runs, sessions, traces and stream; no system prompt, tool catalog or app logNone: 403 this token is read-only: mint it with "playground": true to act
Tag-scoped panel token (0.20.0)A panel token minted with tags, with or without a public_idWhat a read token reads, held to the runs carrying every tag: across public ids for a tag-only token; a token with a public_id is also held to that public id. A tag-only token reads no run commands (403)None: it is read-only

The wall, in order: ?token= on any /api route is 401 a token in the URL is never accepted: … in every setup. In setup A a non-loopback Host is 403 and a cross-origin write is 403. With a Token, no bearer is 401 the API requires a token: Authorization: Bearer <token>, and a bad or expired panel token is 401 bad or expired token. Studio sends no WWW-Authenticate header. A sig from POST /api/live-grant is the one credential a URL may carry, on /api/live only.

Four rules recur in the tables below:

RuleWho passes
Server or loopbackThe server token, or no Token and a loopback Host (an AllowOrigins host does not count). It governs db.path, db.size, pid, pricing.path, live_all and all=1, deletion and proposals
Reads promptsEveryone but a read panel token. A read token gets 403 with badge hidden where a route carries system prompts, catalogs or app logs, or the field replaced by a hidden badge inside a 200
ScopeA panel token reads only its own public id, and a tagged one only runs carrying its tags. Another public id’s run, session or trace, or another value of one of its tag keys, is 403 this token is scoped to public id <pub> (or tags <k>=<v>, or both). An unknown id is 404 as for anyone, so scope never reveals whether a run exists. Child runs outside the scope are one hidden hole with a count
Server to serverThe server token or setup A; every panel token gets 403. The runtime link (this route speaks server-to-server: it needs the server token, not a panel token) and breakpoints (breakpoints park every future run of the runtime: the server token, not a panel token)
Method and pathCapabilityWho
GET /api/metanoneanyone past the token wall
GET /api/manifestnonereads prompts
GET /api/manifests/{hash}manifestsreads prompts
PUT /api/agents/{name}/proposal, DELETEproposalsserver or loopback
GET /api/runsnonescoped
GET /api/runs/{id}nonescoped
GET /api/runs/{id}/eventsnonescoped
GET /api/runs/{id}/transcriptnonescoped
GET /api/runs/{id}/spansnone; ?tree=1 needs spans_treescoped
GET /api/runs/{id}/requests, /toolsrequestsreads prompts, scoped
GET /api/runs/{id}/steps/{n}stepsscoped
GET /api/runs/{id}/exportexportscoped
GET /api/runs/{id}/logslogsreads prompts, scoped
DELETE /api/runs/{id}deleteserver or loopback
GET /api/runs/{id}/commandsrun_commandsscoped
GET /api/statsstatsscoped
GET /api/searchsearchscoped
GET /api/diffdiffscoped
GET /api/traces, GET /api/traces/{id}traces / nonescoped
GET /api/sessions, GET /api/sessions/{id}nonescoped
GET /api/sessions/{id}/timeline, GET /api/sessions/{id}/entriestimelinescoped
GET /api/sessions/{id}/exportnonescoped
GET /api/sessions/{id}/public_idnoneno panel token
GET /api/public/{id}nonescoped
DELETE /api/sessions/{id}deleteserver or loopback
GET /api/settings/pricingpricinganyone
GET /api/live, POST /api/live-grantlivescoped
POST /api/panel-tokensauthserver token
GET /api/panel-handoffhandoffserver or playground token
GET /panel.js, GET /panel-config.json, GET /none / panel-config / noneno auth
POST /v1/traces, POST /v1/logsingestingest token or loopback
GET /api/runtimes and the other playground routesplayground, preview, breakpoints, steer, cancelsee each
DELETE /api/runtimes/{id}runtime_forgetno panel token
POST /api/runtime/register, GET /api/runtime/commands, POST /api/runtime/acksruntimesserver to server

/api/meta’s capabilities lists the registered route groups’ names, in registration order, then any names a hosting wrapper declared with studio.Capabilities(...). The UIs gate each screen on these names. A capability that could be on and is not appears in capabilities_off with the reason below, or with the words a host gave studio.OffReason (0.20.0; weft studio --no-playground uses it); capabilities_off is omitted when nothing is off, and a name a host declared is never both on and off. /panel-config.json serves the same list. The read API and /panel.js belong to groups that name no capability.

CapabilityPresent whenGatescapabilities_off reason
requestsalwaysGET /api/runs/{id}/requests, /tools; the Request pane (0.10.0)—
stepsalwaysGET /api/runs/{id}/steps/{n}—
exportalwaysGET /api/runs/{id}/export—
logsalwaysGET /api/runs/{id}/logs—
diffalwaysGET /api/diff—
tracesalwaysGET /api/traces—
searchthe database implements obsdb.SearcherGET /api/searchthe database cannot search: its obsdb.DB does not implement obsdb.Searcher (obsdb/sqlite and obsdb/clickhouse both do)
manifeststhe database implements obsdb.ManifestStoreGET /api/manifests/{hash}the database cannot store manifests: …
spans_treethe database implements obsdb.TreeReader?tree=1 on GET /api/runs/{id}/spans (no route of its own)the database cannot read a run tree: … GET /api/runs/{id}/spans?tree=1 answers 501
timelinethe database implements obsdb.SessionEventReaderGET /api/sessions/{id}/timeline, /entries (0.18.0)the database cannot read a session's state log: … GET /api/sessions/{id}/timeline and /entries answer 501
pricingalwaysGET /api/settings/pricing; cost on the rows—
deletealwaysDELETE /api/runs/{id}, DELETE /api/sessions/{id}—
proposalsalwaysPUT and DELETE /api/agents/{name}/proposal—
livealwaysGET /api/live, POST /api/live-grant—
ingestnot studio.NoIngest()POST /v1/traces, POST /v1/logsOTLP ingest is off: studio.NoIngest() turned it off
autha Token is setPOST /api/panel-tokensno server token to sign panel tokens with: turn it on with studio.Token(tok); weft studio always sets one
handoffa Token is setGET /api/panel-handoffno Token: panel tokens do not exist here, so there is none to hand off from: …
panel-configalwaysGET /panel-config.json—
playgroundstudio.Playground(true)GET /api/runtimes, POST /api/playground/runs, GET /api/playground/commands/{id}, POST /api/runs/{id}/approvals, POST /api/playground/fixtures, GET and POST /api/experiments, GET /api/experiments/{id}the playground is off: turn it on with studio.Playground(true); weft studio --no-playground turns it off
runtimesPlayground(true)the three runtime link routesthe playground reason
previewPlayground(true)POST /api/playground/previewthe playground reason
breakpointsPlayground(true)PUT /api/runtimes/{id}/breakpointsthe playground reason
steerPlayground(true)POST /api/runs/{id}/steerthe playground reason
cancelPlayground(true)POST /api/runs/{id}/cancelthe playground reason
target_checkPlayground(true) (0.19.0)no route: GET /api/runtimes’ per-agent manifest_hash and per-runtime studio_url, the preview’s scripted_hit and scripted_key_match, the cross-agent refusal (cross_agent: true opts in) and a command’s reasonthe playground reason
runtime_forgetPlayground(true) (0.19.0)DELETE /api/runtimes/{id}the playground reason
run_commandsPlayground(true) (0.19.0)GET /api/runs/{id}/commandsthe playground reason
statsthe database implements obsdb.Aggregator (0.19.0)GET /api/stats; the search error_class facet and filterthe database cannot aggregate: its obsdb.DB does not implement obsdb.Aggregator …; GET /api/stats and the error_class facet and filter are off
scope_tagsalways (0.20.0)no route: tag.<k>=<v> and flow= on /api/runs, /api/sessions, /api/search, /api/traces, /api/stats and /api/live—
panel_token_tagsa Token is set (0.20.0)"tags" in POST /api/panel-tokens, and every read route holding such a token to themthe auth reason
Capabilities(...) extra namesthe host passed themwhatever the host servesnever listed off

Without its condition a group registers nothing, so its routes answer 404 no such api route …. Three answers are 501 instead, on a database without the interface: spans?tree=1 without obsdb.TreeReader, the session timeline and entries without obsdb.SessionEventReader, and an error_class filter without obsdb.Aggregator.

Versions, the database, what is on, and the state of ingest. Every identity may call it; with a Token set it still needs a bearer (401 without). It then always answers 200: a failed observation goes into a field, not the status. weft doctor prints it line by line.

FieldMeaning
weft_versionThe weft that serves it
studio_versionstudio.Version
panel_versionThe version stamped into the embedded /panel.js; "" when the bundle is missing. It differs from studio_version only when the committed bundle is stale
db{kind, path, size}. kind is memory, sqlite, clickhouse, the bare type name or unknown. path and size (the file’s bytes plus its -wal) only to the server-or-loopback rule, and absent for a database with no file
titlestudio.Title (weft studio by default)
has_manifestA weft.json is configured, or a runtime registered a manifest
ingest_openIngest is on and has no IngestToken: loopback peers may post
ingestOmitted for a panel token. dropped: [{service, records, last_heard}], never null, most records first: the largest weft.records.dropped each service’s heartbeats, run_start and run_finish reported on /v1/logs, kept in memory. accepted and refused: the OTLP POSTs under /v1/ answered below 400 and at 400 or above since start. last_error (<status> <code>: <reason>) and last_at: the last refusal, omitted before the first
interrupted_after_ms30000: a running run silent this long reads interrupted
capabilitiesThe list above
capabilities_off{capability: why}, omitted when nothing is off
manifest_sourcesHow many sources /api/manifest lists
auth_requiredA Token is set
live_allThis caller may open /api/live?all=1 (the server-or-loopback rule); always present
debug_scoperuntime-started runs, or own+runtime while a connected runtime registered runtime.Sessions or breakpoints_own. Present only with the breakpoints capability
contentingest: always as_received (Studio stores records as they arrive). latest: the newest top-level run in the caller’s scope, or null. It carries the run’s run_id, its mark (full, stripped, none or unmarked, from its first event’s weft.content) and a note. When content was off, a fix names otel.NoContent() or weft.Content(false). Since 0.20.0 it also carries the run’s started, weft_version and service (the last two omitted for a non-weft exporter), which weft doctor’s data line reads. error: a failed read
pricing{source, path?, dated, models}: source is default, file or option; path to the server-or-loopback rule; models the row count. Cost
retentionstudio.Retain’s duration as a Go string (720h0m0s), or null when off
runtimesRuntimes holding a command stream now; 0 without the playground
manifest_checknull for a panel token or with no manifest. Else source (file or runtime), agents (how many agents the manifest names) and checked (how many of them have a latest run carrying a manifest_hash). stale lists the checked agents whose latest hash is no known version; it is never null. differs names those registered in more than one version, omitted when none. latest is each checked agent’s latest run’s manifest hash, by agent name, omitted when nothing was checked. error is the first read failure. The keys weft and name it parses are the manifest document’s own
pidThe serving process, to the server-or-loopback rule only (0.11.0)
runtime_link{studio_url?, in_process}: this process’s own runtime links (0.19.0). in_process says a link talks to this server, runtime.Local(srv) or HTTP to this very Studio; studio_url names the Studio another link dialled instead. Omitted when no link of this process is open, and under db.path’s rule
discovery_fileThe discovery file apps find this Studio through, while it names this process (0.20.0, studio.DiscoveryFile); omitted for setup A, under WEFT_DISCOVERY=off, and under db.path’s rule
SinceChange
0.7.0db, ingest_open, interrupted_after_ms
0.10.0The requests capability
0.11.0db becomes {kind, path, size} (breaking); content, pricing, retention, runtimes, panel_version; pid under db.path’s rule
0.19.0runtime_link; the stats, target_check, runtime_forget and run_commands capabilities
0.20.0discovery_file; content.latest’s started, weft_version, service; the scope_tags and panel_token_tags capabilities

Request ids and server logs.

SignalBehaviour
X-Request-IdOn every answer; a 5xx body also carries it as error.request_id
ERROR on slog.DefaultEvery 5xx (the real error, even when a panel token’s body masks it) and every handler panic; never rate-limited
WARN on slog.DefaultA refused ingest batch, at most one a minute per remote host, route class (/v1/traces, /v1/logs or /v1/*), code and status
Handlerweft studio --log-level and --log-format choose it

weft doctor checks only the fields its lines name; read retention, pricing, live_all, debug_scope and interrupted_after_ms here, or with weft mcp’s meta tool.

AspectBehaviour
WhoReads prompts: a read token gets 403 hidden, the manifest carries the agents' system prompts: a read-scoped panel token does not read it
With a weft.jsonThe file verbatim, with sources added as its last key. An agent with a held proposal gains proposed: {instructions, instructions_hash, since}
Without one{weft, agents, sources} from the manifests runtimes registered, each agent prefixed with its manifest_hash, one per service and name
sources[{source, manifest_hash, service?, live?, registered_at?, runtime_id?, agents: [{name, manifest_hash}]}]: the file first, then registrations, live before remembered, newest first. Registrations are remembered in memory by service and manifest hash and forgotten on restart
404no manifest: no weft.json configured (studio.Manifest, or weft studio --manifest) and no runtime has registered (with the playground reason when the playground is off)
AspectBehaviour
Capabilitymanifests
WhoReads prompts (403 hidden for a read token)
200{manifest_hash, agent, source, first_seen, current_manifest_hash, manifest}: the one-agent manifest a run’s manifest_hash names; source is file or runtime; current_manifest_hash is "" when the current manifest names no such agent
404no manifest <hash>: Studio stores a manifest when a runtime registers it or a weft.json it serves names it
StorageWritten from the weft.json at New and from every runtime registration, content-addressed, first write kept, kept forever: deletion and Retain never touch it. A run document whose hash resolves carries manifest_available: true
AspectBehaviour
Capabilityproposals
WhoServer or loopback. A panel token: 403 a proposed prompt is a system prompt: …; setup A through an AllowOrigins host: 403
Body{"instructions": "…"}, required; "" proposes no system prompt. A missing key: 400 proposal body: instructions is required (…)
200{agent, proposed: {instructions, instructions_hash, since}, note}; instructions_hash is SHA-256 hex. /api/manifest shows it beside the registered prompt
404no agent <name> in the manifest file or any registered manifest
409A file is served and only a runtime names the agent: the served manifest file does not name agent <name>; the proposal would not show
StorageIn memory, at most 64, the oldest forgotten first; lost on restart

Same capability and rule as PUT. 200 {agent, proposed: null, note: "the proposal is forgotten"}; 404 no proposal for agent <name>.

ParameterValues
agent, session, public_id, experiment_id, error_typeExact match
id_prefixRuns whose id starts with it, byte for byte (obsdb.RunQuery.IDPrefix; the ⌘K palette’s short-id lookup)
stopped_byExact, or a prefix when it ends in : (has_tool_call:)
statusrunning, succeeded, failed, interrupted, parked, cancelled. parked and cancelled are read-time: succeeded with open pending calls and no resumer; failed with error type cancelled. Any other word: 400 status must be running, succeeded, failed, interrupted, parked or cancelled ("bogus" given)
parentAbsent: top-level runs only; *: every run; a run id: that run’s children
all1/true: child runs too (parent=*). Not a boolean: 400
playgroundtrue/false. Not a boolean: 400 playground must be true or false
tag.<key>, flowMetadata match, tag.tenant=acme; flow matches weft.flow (0.20.0)
error_classA failure class, exact: the /api/search facet’s class string. Needs the stats capability; without it, 501 (0.19.0)
turn_below, turn_aboveA positive turn number: runs whose turn is below or above it (obsdb.RunQuery.TurnBelow, TurnAbove). With session and limit=1, a turn’s neighbour, total the count on that side: the turn stepper’s one-row read (0.18.0)
oldest1/true: oldest first, the cursor reading forward (obsdb.RunQuery.Oldest, 0.18.0)
before, before_id, limitPaging

A panel token is pinned to its own public id; another public_id is 403. Every parameter but limit is checked before scope, so a malformed one is a 400 before another public_id’s 403. The answer is {total, runs, next_before, next_before_id}; total counts the whole match. On a page narrowed by public_id or session, the turn marks above are read for at most 50 sessions and 10 pages of marks each; the turns left without them are counted in the answer’s turn_marks_capped, a truncated hole with cause response_cap. Each run row:

FieldMeaning
id, parent_run_id, parent_call_id, trace_id, agent, model {provider, name}, manifest_hash, weft_version, serviceIdentity
caller_run_id, caller_call_idA caller-linked run: one started on a tool call’s context that is no Subagent child, such as a thread/pool child session’s turn (0.18.0). It has no parent_run_id; omitted when none
session_id, public_id, turn, playground, experiment_id, forked_from, metaThe identity chain; meta is the run’s metadata pairs, never null
started, finished (null while running), last_seen, status, err, steps, pending, stop_reason, usageOutcome
stopped_by, cancel_causeWhat ended it (final_answer, max_steps, parked, has_tool_call:<name>, …) and a cancel’s cause; omitted when none
error_typeA failed run’s kind; a context error reads cancelled
resumed_from, resumed_byThe approval link: the parked run a resume names, and on the parked run the run that resumed it; read time, either ingest order; omitted when none
attempts_retried, fallbacks, tool_errors, denied, truncated, repaired, tap_panicsProblem counters, counted at ingest, each omitted when 0. attempts_retried counts a failed attempt a later one of its call followed; fallbacks the attempts weft.attempt.layer marks; tool_errors skips RETRY results
children_count, children_failed, children_unknownThe runs whose parent is this one, one level deep, read once for the whole page; omitted when 0. Since 0.18.0 a caller-linked run is not counted. children_unknown: true when that read failed (the UI’s ”⑂ ?”)
prompt_previewThe turn’s own prompt: the input record’s last user text (a resume’s new prompt when it has one), else its first; 200 runes; absent when content was off
settlingtrue while the run’s root span is stored, its run_finish is not, and it was heard from within 30 s; never on a failed root. The UI treats such a run as live
events_emitted, messages_emitted, event_count, message_count, delta_countWhat the root span says was emitted, and what was stored
instructions_hash, catalog_hash, request_countThe request record’s summary (0.10.0). requests_badge: not_recorded for a run written before ADR 0028, derived for a run built from stock spans
derivedtrue for a run built from stock OTel GenAI spans
cost_usd, cost_known, cost_badge, cost_reason, cache, unpriced_modelsOwn cost at read time, never stored: cost_usd is null when not known, never a made-up 0; cost_badge is unpriced, unknown or scripted; cache is exact or not_reported; at most five models, then (+n). Cost and the badges
delegated_cost_usd, delegated_cost_known, delegated_cost_reason, delegated_unpriced_modelsThe descendants’ own cost, never folded into cost_usd
own_usage, delegated_usageThe run’s own model calls’ usage, and its Subagent children’s, read at request time (0.20.0). Omitted on a run with no Subagent child, a running run, a failed read, or where a panel token cannot see one of the children
session_compactions, delegated_sessionsA session turn’s marks, only on a page the request narrowed by public_id or session (0.18.0): the session compaction markers filed under the turn, and the sessions its calls delegated. The devtools panel draws them as its ⌗ and ↳ chips without a fetch per turn. Read through the session events index (obsdb.SessionEventQuery’s Kinds); omitted when 0 or not read
ended_by, ended_by_turn, ended_kindOn the same pages, what ended a turn a busy policy felled: the weft.thread.interrupt record filed under it, its by_run, by_turn and policy (interrupt or rollback), drawn ”✗ interrupted by t7” or ”↶ rolled back by t9 · off path”. Omitted when no such record was read

One row as captured (trimmed: hashes and empty fields removed):

{
"id": "0284b9967cc95119e5e12416f9982fe9",
"trace_id": "3bfe79976e96ecfb6c4516fd4fce747d",
"agent": "support-bot",
"model": { "provider": "wefttest", "name": "script" },
"service": "refb1seed",
"started": "2026-10-18T14:44:33.062103108Z",
"finished": "2026-10-18T14:44:33.066851684Z",
"status": "failed",
"err": "weft: run failed at step 1: weft: run exceeded the maximum number of steps",
"steps": 1,
"stop_reason": "tool_calls",
"stopped_by": "max_steps",
"error_type": "max_steps",
"usage": { "input_tokens": 10, "output_tokens": 5 },
"cost_usd": 0,
"cost_known": true,
"cost_badge": "scripted",
"cost_reason": "a scripted model: nothing bills it, an exact $0",
"cache": "exact",
"event_count": 5,
"message_count": 3,
"request_count": 1,
"prompt_preview": "Where is order 43?"
}

The run document: the run row plus the fields below. Out of scope: 403; unknown: 404 no run <id>.

FieldMeaning
childrenChild rows, each with holes when it has any. A panel token sees only its own public id’s children; the rest are one hidden hole with a count. Since 0.18.0 a caller-linked run is not a child: read it from caller_linked
caller_linked, caller_linked_more, caller_linked_hidden, caller_linked_unknownThe runs this run’s calls started that are no Subagent children (their caller_run_id names it), the first 100 in start order; the other fields say more exist, some are hidden from a panel token, or the read failed
holesAlways a list of {hole, reason, fix?, count?}, from the closed table
compactions[{scope, index?, step?, from_seq?, to_seq?, hash, replaced, entries, tokens_before?, tokens_after?, reason?}]: run-scope views first, then session markers, which carry no index, step or range
manifest_availabletrue when the run’s manifest_hash resolves on manifests/{hash}
log_warn, log_error, logs_cappedApp log counts at severity 13–16 and 17–24, read at request time through obsdb.DB.CountLogs; logs_capped when they are floors (the UI’s ”≥”). On the document only
decided, resumesSince 0.18.0, on a parked run that a resume names (resumed_by), each parked call’s decision as that resume applied it; on the resume (resumed_from), the same calls. {run, at, actor?, source, calls, more?, hole?, notes?, error?}: run the other side, at the resume’s start, actor its weft.approval.actor (metadata: every token reads it), source where the calls come from: resume_calls (the resume’s weft.resume.calls), transcript (its pre-step results), spans (its pre-step execute_tool spans) or none with hole not_recorded. At most 32 calls, more counting the rest. Each call: call_id, name, outcome (approved, denied, resolved, expired or no_decision), derived (read from a result text or a span, not a decision record), via, key_id, grant_id, who, approved_by (a split verdict’s overruled approvers), reason, result and at. The thread decision records are read with obsdb.SessionEventQuery’s RunIDs. A read-scoped panel token gets no who (who_hidden), reason or result (reason_badge, result_badge hidden); content-off they read not_recorded. Omitted when the run is neither
summarizerWhat the summarizer calls filed under this run cost: the compaction markers and SummarizeLeft branches under it, priced at the recorded summarizer model’s rates, else the run’s model’s as an estimate. Never in the run’s usage or cost_usd; omitted when none
AspectBehaviour
afterThe first position to return, inclusive; -1 or 0 from the start. Below -1 or not an integer: 400
limitDefault 500. Studio passes at most 5,000 to the database; both first-party databases return at most 1,000 per page, a third-party obsdb.DB may return up to 5,000
200{events: [{pos, time, event, attrs?}], next_after, done, gaps}. event is the core event as recorded; attrs only when the content is not full. next_after is null when nothing follows; done is true once the run is terminal; gaps lists missing positions (at most 1,000). A derived run adds badge, reason, fix
WhoScoped; a read token reads events
AspectBehaviour
Bare{batches: [{index, step, input, badge?, messages}]}: every stored messages batch. A batch with no step stamped reads step -1 and badge not_recorded; one whose input flag was inferred reads derived
step=NAlso step, messages (what step N’s model call carried: the record’s truth, the replay prefix for from_step N > 0; from_step 0 re-runs step 0’s PrepareStep over the original input), and compacted_at (the run-scope view the request carried, else null). derived when no request record placed the messages. A read token over a compaction view gets messages: null with badge hidden (ADR 0029)
400step must be a non-negative integer ordinal
404no step N of run <id>: the run never reached it
409The records do not rebuild the step: badge gap or stripped; a derived run with step: badge derived
AspectBehaviour
200{spans}, each {trace_id, span_id, parent_span_id, name, kind, start, end, status, status_message, service, attrs, events, run_id}; run_id is the run asked for. kind is internal, server, client, producer, consumer or unspecified; status is ok, error or unset
tree1/true: the run tree. Not a boolean: 400 tree must be true or false (1 or 0)
WhoScoped. A read token’s spans lose weft.override.tools, weft.override.park_on and weft.override.park_all_except, and a named weft.override.tool_choice is cut to its mode

The sub-routes of a run are runs/{id}/events|transcript|spans|requests|tools, plus steps/{n}, export and logs below.

The run’s spans and every descendant run’s, found by the weft.parent.run.id chain and core’s id rule (<parent>/<step>/<call>) from the run rows and read by run id, never the whole trace. A caller-linked run is not a descendant (0.18.0). Capability spans_tree (obsdb.TreeReader); without it, 501 not_implemented, checked before scope.

CaseBehaviour
200{spans, holes}. Each span adds run_id and parent_run_id (absent for the root’s spans); a span is keyed by run_id plus span_id. holes is always a list of {hole, cause?, reason, fix?, runs?, count?}
truncated, cause response_capPast 10,000 spans (obsdb.TreeSpanCap), or past a derived run’s 50,000-span trace read
not_recorded, cause no_spansFinished child runs with a row and no span: runs names the first 100, count counts all. A running child is not missing
hiddenA panel token’s descendants with another public id, left out with their subtrees before the cap and counted (obsdb.RunTree.HiddenCount, obsdb.TreeQuery.PublicID); never a 403

Captured from a run with one subagent child (trimmed: one span):

{
"spans": [
{ "trace_id": "95722f4da1c2f6ef1595b77f15fba570", "span_id": "fc36bce8bc5c2035",
"name": "invoke_agent support-bot", "kind": "internal", "status": "ok",
"service": "refb1seed", "run_id": "c5c6be88c1cdb9e00b58780ccc1db0bd" }
],
"holes": []
}

Every model-call attempt’s request record (ADR 0028), with the prompt and catalog it named.

AspectBehaviour
Capabilityrequests
WhoReads prompts, then scoped. A read token: 403 hidden, the request record carries the system prompt and the tool catalog: a read-scoped panel token does not read it
stepOne step’s records; else 400 step must be a non-negative integer
from, limitThe first request index (else 400 from must be a non-negative request index), and the page size: 100 by default, at most 1,000
refs1: hashes only, no inline prompt or catalog; else 400 refs must be 1 (hashes only) or 0
200{requests, next_from?, badge?, reason?, fix?}. Each row: index, step, attempt, time, system_hash, catalog_hash, content, truncated_bytes, body, prompt, tools, raw. prompt and tools are inline documents (below) or {hash, badge} when the record is missing. raw is the attempt’s wire pair under otel.RawBodies (development gate: WEFT_ENV=dev, or otel.DevMode()), else null with raw_badge: "not_recorded", raw_reason and raw_fix (“run under WEFT_ENV=dev (or otel.DevMode()) with otel.RawBodies(true) …”)
Old or derived run200 with an empty list and the page badge (not_recorded or derived)
prompt document{hash, text, segments?, content, truncated_bytes}: the composed system text; segments attributes it to the instructions and each tool’s prompt snippet (PromptSegment), absent when the record carries none; content is "", truncated (truncated_bytes > 0) or derived (a body that did not parse)
tools document{hash, tools, content, truncated_bytes}: the catalog of that hash, tools in name order; content as the prompt’s

Same capability and rule as requests. 200 {catalogs: [{hash, tools, content, truncated_bytes}], badge?}; the badge is not_recorded, derived, stripped, or gap when a request names a catalog that was not stored.

One step assembled on the server: capability steps, scoped.

AspectBehaviour
nA canonical non-negative integer; else 400 the step must be a non-negative integer ordinal
200run_id, step, status (ok, error, parked or running), reason, started, finished, latency_ms, ttft_ms, model {provider, requested, answered}, request, attempts, attempts_badge?, messages_in, events, tool_calls, children, usage, cost fields, compaction?, holes. A read token’s request is {badge: "hidden", …} inside the 200
attempts[{attempt, model, provider, outcome, error_type?, retry_after_ms?, layer?, http_status?, wait_ms?, error?, started, finished, span_id, request_index, badge?}]: http_status is http.response.status_code; wait_ms is weft.attempt.wait_ms, the wait before this attempt was sent (absent on a first try); retry_after_ms is the provider’s ask
tool_calls[{call_id, name, seq, args, result {content, is_error, bytes, truncated?}, span, child_run_id?, pending?, badge?}]. result is absent while the call runs or is parked; bytes is the span’s weft.tool.result_bytes when content was stripped; truncated means the result cap cut it
tool_calls[].span{id, started, finished, status}: the call’s execute_tool span
tool_calls[].badgemax_tokens: the step hit the output token limit, so the call never ran (no span; its result is the “not executed” text). stripped: content-off dropped args and result. On a content-off max_tokens step the calls are known only by count and listed with call_id ""
messages_in{index?, count, badge?, reason?, fix?}: the messages record index the request’s view ends at, and how many messages it carried. badge is stripped, compacted (the index names the step’s compaction view) or not_recorded (no request record)
events[{pos, time, event, attrs?}]: the step’s durable events in pos order, from its step_start up to the next step’s, a steer delivered after the step included
children[{id, call_id, agent, status, usage}] plus the run row’s cost and delegated fields (cost_usd, cost_known, cost_badge?, cost_reason?, cache, delegated_cost_usd, …): the child runs this step’s calls started, own and delegated never folded
compaction{scope, index, from_seq, to_seq, hash, replaced, entries, badge?}: the compaction view the request carried; transcript entries [from_seq, to_seq) replaced by entries messages
holes[{hole, reason, fix?, count?}], deduplicated; count only on a hidden hole, the child runs a panel token’s scope left out
404no step N of run <id>: nothing records the step

The run cards’ words built from this document live in src/lib/cards.ts, shared by the run page and the panel.

The whole run as one download: capability export, scoped. Export a run shows each format.

AspectBehaviour
formatRequired: json (weft.run.export/1: run, events, transcript, compactions, requests with prompts and catalogs, spans, holes), jsonl (one record per line), otlp ({logs, traces}, re-ingestable through /v1/*), wefttest (a zip: <agent>_replay_test.go and testdata/TestReplay_<run>/ fixtures). Else 400 format must be json, jsonl, otlp or wefttest
tree1 on json, jsonl or otlp: every subagent run under it too, breadth first, at most 200, each its own export (subagents, subagent_holes; the file <run>.tree.<ext>). With wefttest: 400; not a boolean: 400 tree must be true or false (1 or 0)
WhoA read token: otlp and wefttest are 403 hidden; json and jsonl carry the request block as a hidden badge
200Content-Disposition: attachment; filename="<id>.<ext>", the extension .json, .jsonl, .otlp.json or .zip. In the name /, \, ", control characters and non-ASCII become _; a non-ASCII name also gets filename*. Content-Length is set
409wefttest for a transcript that cannot be fixtured: the hole as badge (stripped, gap or derived); without a badge when the run recorded no assistant turn. A derived run: 400 derived

The app’s own log lines under the run’s spans: capability logs; reads prompts, then scoped. A read token: 403 hidden, a run's app logs may carry anything the app logged, prompts included: …. Read a run’s app logs shows the bridge.

AspectBehaviour
from, limitThe first log index (else 400 from must be a non-negative log index); the page size, 100 by default, at most 1,000
severitytrace, debug, info, warn, error, fatal, a severity text or 1–24: lines at or above it. Else 400
200{logs: [{index, time, severity, severity_number, body, attrs, span_id?}], next_from?, partial?, partial_reason?, holes, badge?, reason?, fix?}; the top-level badge repeats the first hole. A running run is partial: spans export when they end
Holesnot_recorded when the run stored no span; truncated past 10,000 candidate lines; gap for lines naming an unstored span; and the not_recorded hint for a run without the slog bridge, whose fix names otel.Slog()

The captured hint for a run recorded without the bridge (trimmed: the reason shortened):

{
"logs": [],
"holes": [{ "hole": "not_recorded", "reason": "no app logs: no weft slog bridge was recorded for this run …",
"fix": "bridge slog: otel.Install(…, otel.Slog()), or log through slog.New(otel.SlogHandler(h))" }],
"badge": "not_recorded",
"reason": "no app logs: no weft slog bridge was recorded for this run …",
"fix": "bridge slog: otel.Install(…, otel.Slog()), or log through slog.New(otel.SlogHandler(h))"
}
AspectBehaviour
Capabilitydelete (always on)
WhoServer or loopback. A panel token: 403 deletion answers the dev token (or loopback in setup A) only, never a panel token; setup A through an AllowOrigins host: 403
WhatThe run with its subagent children and the runs derived from stock spans under its tools: rows, records, search index, spans, app logs, from obsdb’s tables only (obsdb.DB.DeleteRun). The app’s conversation store and a shared file’s thread tables are untouched; stored manifests stay
PathThe whole rest of the path is the id; no sub-route
200{deleted: "run", run_id, note}
404 / 500no run <id>; delete run <id>: <err>

The commands sent to one run, oldest first: {"commands": [...]}, never null. Each is GET /api/playground/commands/{id}’s row plus its verb (decide, steer or cancel) and, for a decision, its call_id and decision. Lost and rejected commands are listed too, so the run page can mark a command that never landed after a reload or a Studio restart. A panel token reads a run inside its scope and only the commands its own public id sent; a tag-only token is refused with 403. With no command and no such run stored, 404. A child run’s id goes in one path segment, its slashes as %2F. Capability run_commands (0.19.0).

Numbers across runs, grouped by=agent, model, tool, error_type or step, over the run filters: since, until, agent, tag.<k>=<v>, flow, public_id, parent, playground, experiment_id and status. since defaults to 24 hours before until, and also takes a duration. parent defaults to *, every run. playground defaults to false, or both kinds with experiment_id; all asks for both. Each group carries runs, failures, calls, tokens, the cost block priced at read time, latency percentiles and a 24-bucket series. Capability stats, present when the database implements obsdb.Aggregator (0.19.0). Track agent health explains every field.

Capability search (obsdb.Searcher: SQLite FTS5 trigram, ClickHouse one derivation per search). Scope is checked first, so another public_id is 403 before any 400. Find runs covers the query language.

ParameterValues
qTerms over prompt, answer, error and tool names: substrings, all must match, a "quoted phrase" is one term. A bad query: 400 with its message
agent, tool, modelExact
errorSubstring
status, session, public_id, experiment_id, stopped_by, error_type, parent, all, playground, tag.<key>, flowAs on /api/runs; id_prefix, before and before_id are not read
error_classA failure class, exact, from the facets.error_class list. Without the stats capability, 501 (0.19.0)
since, untilRFC 3339; else 400
min_tokensA non-negative integer
min_costUSD, own plus delegated; an unpriced run never matches. Not a non-negative number: 400
sortstarted (default), duration, tokens, cost (most first, unpriced last); else 400 sort must be started, duration, tokens or cost
limit, offset50 by default, at most 500; offset 0 to 100,000

200 {total, runs, sort, next_offset, cost_sort_cap?, facets?}. facets.error_class is the match’s failures by class, most runs first, at most 20, counted without the request’s own error_class; error_class_capped says past 2,000 distinct texts the rarest were not read. facets is absent without the stats capability. min_cost and sort=cost are applied in Studio over the match’s first 2,000 runs; cost_sort_cap: 2000 says the match was larger and total counts the capped set.

Two runs aligned by step ordinal: capability diff; both runs scoped. Compare runs draws it.

AspectBehaviour
a, bBoth required; else 400 a and b must both name a run: /api/diff?a=<run id>&b=<run id>
200{a: {run_id, steps, status}, b, steps: [{step, changed, a, b, changes, unknown}], summary: {changed_steps, first_changed}, holes}. Each side is reduced to status, system_hash, system, tool_calls, tool_results, text, usage, marks, holes; changes names system, tool_calls, tool_results, text, usage or missing. A column a side did not record is in unknown, never compared. Compaction and subagent are marks, never a change
Caps500 steps; past them a truncated hole with response_cap’s reason and fix (no cause key is sent)
WhoA read token gets system: null, system_hidden: true on the side (0.18.0) and a hidden hole. A hidden hole with a count is the child runs a panel token’s scope left out, and may stand beside it

Capability traces (obsdb.DB.Traces). A panel token lists only the traces every span of which carries its public id; scope is checked first.

ParameterValues
since, untilRFC 3339, on the trace’s earliest span (SQLite narrows on spans_start, migration 0019). A bare day: 400 since must be RFC 3339: …
serviceExact, any span of the trace
public_idOne public id
tag.<key>, flowTraces holding a span that carries the pair (0.20.0)
not_run1: the GenAI traces that make no run: a GenAI span, no weft run and no derived run (0.20.0). Not a boolean: 400
id_prefixTraces whose id starts with it, byte for byte (0.20.0)
before, before_id, limitPaging

200 {total, traces, next_before, next_before_id}. Each trace:

FieldMeaning
trace_idThe join key with run_ids
root{span_id, name}, or null with badge: "gap", reason and fix when only child spans arrived
service, start, end, duration_ms, span_count, errorThe root’s service, else the earliest span’s; the span window
run_idsEvery run id in the trace, never null
root_run{id, agent, prompt_preview, status}: the first id without /, else the shortest; omitted when unread or out of scope
failed_runs, failed_runs_cappedFailed runs among the root run and its core children; failed_runs_capped when the count stopped at 500, a floor

A trace can appear on two pages; dedupe on trace_id.

Any trace, weft or not: {spans, run_ids, not_run?}, the spans in the span shape without run_id (weft.run.id is in attrs). run_ids lists the weft runs and the derived runs the trace makes; when it makes none, not_run is {reason, fix} (0.20.0). A panel token needs every span to carry its public id, else 403. 404 no trace <id>.

Sessions grouped over their own turns (runs whose id is <session>-t<turn>, or runs linked to no run), playground runs left out. Since 0.18.0 a thread/pool child session is a row of its own, counted in total, with its lineage parent_session, parent_turn, parent_call and parent_run; a client after top-level sessions only skips rows with a parent_session. A panel token is pinned to its public id.

ParameterValues
qEvery term must appear in the title, first turn’s prompt, id, public id or agent (obsdb.SessionQuery.Q)
agent, public_idExact
id_prefixSessions whose id starts with it, byte for byte (0.20.0)
awaiting, failed, compacted1: the newest turn is an open park; a turn failed; the session was compacted (0.18.0)
statusThe newest turn’s outcome: succeeded, failed, running or interrupted; the other outcome words are a 400 (0.18.0)
lineage, since, tag.<key>, flowchild or fork; sessions seen since an RFC 3339 time; turns carrying the pair (0.18.0). Since 0.20.0 a tag scopes the turns a session is grouped over, so a partly tagged session counts its tagged turns alone
before, before_id, limitPaging, on last_seen

200 {total, sessions, next_before, next_before_id}. Each row has id, public_id, agent, turns, first_seen, last_seen and status. status is the newest turn’s outcome: succeeded, failed, running, interrupted, cancelled, ended, parked or resumed. Before 0.18.0 a cancelled or busy-ended turn read failed and a parked one succeeded. The row also has usage, title (the newest turn’s weft.session.title), first_prompt and content_off (the first turn stored no content). Its cost fields are the turns’ own plus delegated. Since 0.18.0 each row also carries its turn facts (obsdb.SessionTurnFacts, both backends), each omitted when zero or empty. pending is the newest turn’s pending calls when it is an open park. failed_turns counts failures; ended_turns (the turns a busy policy ended) and cancelled_turns (the other cancelled turns) are never failures. resumes counts the turns that resume a parked one. outcomes lists the newest 40 turns’ outcome words, oldest first, and forked_from_session is a fork’s <origin>#<entry>.

The filters map onto obsdb.SessionQuery: tag.<key> is Meta, awaiting, failed, compacted, status, lineage and since its fields of the same names. Studio lists a page’s delegated sessions with SessionQuery.Parents, one tree level per read, and reads a session’s forks in one SessionQuery.IDs query. Sessions and traces.

The session row plus runs: its turns as run rows. A panel token sees its own public id’s turns and a row recomputed from them. Since 0.18.0 it answers a thread/pool child session too, and adds delegated (each delegated session with its cost) and the delegated tree’s delegated_usage and delegated_sessions_cost_usd, beside its own cost, never folded in. A session is priced up to 10,000 runs, a level’s reads bounded at 20 pages; past either the figure is unknown with a reason. Delegated sessions at any depth that a panel token may not see are one hidden hole in delegated_holes, with a count (count_floor: true when the walk stopped past 500, the count then a floor), and the delegated cost is then unknown with a reason. A panel token reads an unknown session id as another public id’s: 403, here and on the timeline, entries and export routes. 404 no session <id>.

The delegated block’s fields, beside the session row and runs (0.18.0):

FieldMeaning
delegatedThe sessions this one delegated directly, each a session row with its lineage and its own cost, newest first; [] when none. At most 100 rows
delegated_moretrue when more than 100 sessions were delegated directly, so delegated is cut. The figures below still read past the 100
delegated_unknowntrue when a read of the direct level failed: delegated is then empty or partial, never complete
delegated_usageThe whole delegated tree’s usage, at any depth, own plus their subagents’; never folded into the session’s usage
delegated_sessions_cost_usdThat tree’s cost; null when not known, 0 when nothing was delegated
delegated_sessions_cost_knownWhether that figure is known. A failed read, more than 500 delegated sessions, an unpriced run or a hidden session makes it unknown
delegated_sessions_cost_reasonWhy it is unknown, or why a known figure may overstate a cached prompt (a session reported no cache split); omitted otherwise
delegated_sessions_cacheexact when every delegated session’s own cost reported its cache split exactly, else not_reported; omitted when nothing was delegated
delegated_holesThe hidden hole for sessions a panel token may not see, with count and count_floor; omitted when none

A client tells a complete list from a cut or failed one by delegated_more and delegated_unknown. It tells a full bill from a partial one by delegated_sessions_cost_known.

The session’s turns in order and its state-log marks in record-time order, at most 2,000; past the cap a truncated hole with cause: "response_cap". The document’s top level:

FieldMeaning
session_id, public_id, agent, statusThe session; public_id omitted when it has none
turnsEvery turn in turn order: run_id, turn, agent, status, started, finished, last_seen, steps, usage and marks, the count filed under it. pending, prompt_preview, resumed_from, resumed_by, stopped_by, error_type and summarizer appear when set
marksThe marks read, in record-time order, at most 2,000
lanes[{lane, marks}]: each lane’s count of the marks read. The six named lanes always, other only when a mark sits on it
marks_totalThe session’s whole mark count, beside the capped marks
forksOne per fork mark read: {session_id, entry, run_id, turns, status}, the forked session as Studio stored it (turns 0: it ran none yet). hidden for a panel token, unknown past 20 forks or on a failed read. Omitted when it forked none
summarizerThe session’s whole summarizer bill: usage and its cost priced at read time. Omitted when it summarized nothing; never folded into a turn’s usage
holesnot_recorded, stripped, hidden and truncated, as below
Capability timeline; without it, 501 (0.18.0). The marks come from obsdb.SessionEventReader over the session events index (SQLite’s session_events, ClickHouse’s weft_session_events): every thread record and compaction marker of the session, those filed under no run included.

A mark’s at is the record’s time, which orders the marks; fact_at is the body’s own time on the session’s clock, absent on a compaction marker. Each mark carries at, fact_at, record, kind, event, lane (approvals, grants, compaction, steer_queue, branch_fork, pool or other), run_id and turn (both null for a session-level mark), entry, content_mark and fields, the body’s fields. content is the body’s content object; to a read-scoped panel token it is withheld and content_hidden: true says so. A decision mark carries actor: the weft.approval.actor of the turn that resumed the run the mark is filed under. It is never that run’s own actor, which names who decided the run before it. When the resume names several deciders, actor is narrowed to the call’s own by key_id, else by a content reader’s who. Otherwise it is the resume’s whole list, with actor_of: "resume". It is metadata, so every token reads it; absent while no stored turn resumed the run. The holes: not_recorded (only where a turn parked or resumed, since a plain send writes no record), stripped, hidden (a panel token’s counts are exact) and truncated.

The same marks paged: offset, limit (at most 1,000) and next_offset; run narrows them to one run’s. Capability timeline (0.18.0).

?format=jsonl downloads the conversation as <session>.session.jsonl, streamed (0.18.0): a session line {format, session_id, public_id, agent, turns, marks}, every turn’s run export in turn order (at most 200), the state log’s session_mark lines (at most 2,000), session_hole lines, and a closing session_end line {turns_exported, marks_exported, bytes}. Past 64 MiB, counting every line before the holes, the export stops with a truncated hole, cause response_cap; a read that fails mid-stream is a plain truncated hole. A read-scoped panel token’s marks are content_hidden and its requests hidden.

The reverse of public/{public_id}. Every panel token, read or playground: 403 the session-to-public-id lookup answers the dev token only, never a panel token, with badge hidden and the dev_token_only reason and fix. 200 {session_id, public_id}; an empty public_id carries badge not_recorded with the no_public_id reason and fix. No cause key is sent. 404 for an unknown session.

Resolves a public id to its newest session: 200 {session_id}. A panel token for another public id: 403. 404 no public id <id>.

A session’s runs, by DELETE /api/runs/{id}’s rule and scope of deletion (obsdb.DB.DeleteSession). 200 {deleted: "session", session_id, note}; 404 no session <id>. The session page’s delete session… calls it.

The effective pricing table: capability pricing, every identity. 200 {source, path?, dated, note?, models} in the file’s own shape, so the answer saves as a WEFT_PRICING file; path to the server-or-loopback rule. Cost.

Server-sent events: capability live. Watch runs live walks through a stream.

AspectBehaviour
SelectorExactly one of run, session, public_id, all (all=1 or all=true), or agent alone. Since 0.20.0 a tag.<k>=<v> or flow= filter alone is valid too: the stream is every run (a panel token’s public id), filtered. Beside another selector, agent= narrows it. None, or two: 400 exactly one of run, session, public_id, agent or all is required, or a tag.<k>=<v> / flow= filter alone (2 given)
Filterstag.<k>=<v> and flow= (0.20.0): a run frame passes when the run’s metadata carries every pair; a record or attempt frame when its run passed, or its own attributes carry every pair
kindsA comma list of event, delta, messages, run, attempt; default event,run, also for an empty value (kinds=). An unknown kind, or a list naming none (kinds=,), is 400. Heartbeat records are never forwarded, nor a messages record that is a compaction view
ResumeLast-Event-ID only. Not a non-negative integer: 400. With the header present, any value, Studio first replays the selector’s stored event and messages records, then the live frames, deduplicated on run, kind and position per connection
sigA live grant, for EventSource, which cannot send headers. Bad, expired, or for another stream: 401 bad or expired live grant for this stream: request a new one with POST /api/live-grant
Whoall=1: server or loopback, else 403 the all selector streams every run: it needs the server token, or setup A on a loopback Host (live_all in /api/meta). A panel token: its own public_id, runs and sessions only, and every frame is checked against its public id. agent alone is 403 for a public id’s token (beside its public_id it narrows); a tag-only token may use it alone, its tags then filter the stream. A filter naming another value of one of the token’s tag keys is 403; its stream ends at the token’s expiry with event: expired
200text/event-stream, Cache-Control: no-cache, X-Accel-Buffering: no. HEAD answers the headers only (without X-Accel-Buffering) and subscribes to nothing
CapsA 30 s deadline on each frame write; a ping every 15 s. An all=1 resume replays runs running or last seen in the past hour, newest 500 (obsdb.RunQuery.LastSeenAfter); session, public_id and agent resumes page through every run they cover, 500 a page
event:id:data
recordthe hub’s frame sequence, the resume cursor (none when backfilled){run_id, session_id, public_id, kind, pos, time, trace_id, span_id, event, attrs?}; kind is event, delta or messages; event is the record body
runsequence{run: <run row, cost included>}
attemptsequenceOne try of a model call, from its attempt span as it lands: {run_id, session_id, public_id, step, attempt, layer?, status, error_type?, provider?, model?, start, end, wait_ms?, retry_after_ms?, trace_id, span_id}. wait_ms is weft.attempt.wait_ms, the wait before this attempt was sent (absent on a first try); retry_after_ms is the provider’s ask. Live only, never backfilled
pingnone{} every 15 s
overflownone{}: the subscriber’s queue overflowed; Studio closes the stream
backfill_errornone{run_id, kind}: a resume could not read one run’s stored records
expirednone{}: a panel token’s expiry

A backfilled frame, captured (Last-Event-ID: 0, trimmed: one frame, the hash cut):

event: record
data: {"run_id":"c5c6be88c1cdb9e00b58780ccc1db0bd","session_id":"","public_id":"","kind":"event","pos":0,"time":"2026-10-18T14:44:33.045661597Z","trace_id":"95722f4da1c2f6ef1595b77f15fba570","span_id":"","event":{"type":"run_start","id":"c5c6be88c1cdb9e00b58780ccc1db0bd","model":{"provider":"wefttest","name":"script"},"agent":"support-bot","instructions_hash":"57e8f4…"}}
AspectBehaviour
Body{"run"|"session"|"public_id"|"agent": "…", "all": true, "kinds": "event,run"}, or the same in the query, not both (400 name the stream in the body or in the query, not both). Since 0.20.0 the stream parameters also take /api/live’s filters, "tag.<k>": "…" and "flow": "…", alone or beside a selector, and agent beside another selector narrows it. Each member is a string but all, a boolean; any other member is ignored. A body that is not that JSON is 400 body must be JSON: {"run"|"session"|"public_id"|"agent": "…" or "all": true, "tag.<k>"|"flow": "…", "kinds": "event,run"}
WhoThe caller’s own bearer, or setup A with none; the same scope rules as /api/live, checked at minting
200{"sig": "weft_lg.…", "exp": "…"}, Cache-Control: no-store
Window60 s, never past a panel token’s own expiry. Reusable within the window, since EventSource reconnects with the same URL; each stream opened in time runs until it is closed
BindingHMAC over the identity, the selector and the sorted kinds (all=1 and all=true are the same stream), then, since 0.20.0, each filter pair in key order (flow is the weft.flow pair) and a narrowing agent. A grant opens only the stream with that exact filter: /api/live with another filter, or none, is 401. Keyed by the Token; without one, a random key per process
Status200, 400, 401, 403, 413, 500

Captured: {"sig":"weft_lg.…","exp":"2026-10-18T14:46:50.581848302Z"} (the signature cut). Then open /api/live?run=<id>&kinds=event,run&sig=<sig>.

Panel tokens, hand-off and the panel files

Section titled “Panel tokens, hand-off and the panel files”
AspectBehaviour
Capabilityauth: registered only with a Token; without one, 404
WhoThe server token only; anyone else: 401 minting a panel token requires the server token
Body{public_id?, tags?, ttl?, playground?}: public_id or tags required. tags (0.20.0) is a run metadata map: at most 16 pairs, keys and values 1 to 256 bytes, no weft.* key but weft.flow. ttl is a positive Go duration, default 1h, no maximum. playground: true asks for the playground scope, with a public id alone
200{token, public_id, tags?, scope, exp}; scope is read or playground; the token is weft_pt.<base64url claims>.<base64url HMAC-SHA256 under the Token>
400An unknown field (0.20.0): body must be JSON with public_id, tags, ttl and playground ("playground": true mints a playground token). No scope: public_id or tags is required. A bad tag: tags: at most 16 pairs (N given), tags: every key and value must be non-empty …, tags: "k": a key or value is at most 256 bytes, tags: "weft.x" is a weft record attribute, not run metadata: …. Tags with the playground: a token with tags is read-only: "playground": true takes a public id alone. A bad TTL: ttl must be a positive duration (e.g. "1h")

Captured (the token cut): {"token":"weft_pt.eyJw…","public_id":"pub_jane","scope":"read","exp":"2026-10-18T15:00:50.53471257Z"}. Secure the devtools panel.

AspectBehaviour
Capabilityhandoff, with a Token only
toA path under Studio’s base, at most 2,048 bytes: one leading /, no scheme, host, fragment, backslash, white space or ./.. segment. Else 400
Playground token303 to <base><to>#token=<read token>: a fresh read token for the same public id, valid 5 minutes, never past the caller’s own expiry
Server token303 to <base><to>#token=<the server token>: since 0.20.0 the dev token lands signed in, as weft open --with-token does. No read token is minted
Read token403 a read-scoped token cannot widen: …, checked before to
JSONWith Accept: application/json: 200 {location, exp?} instead of the redirect
HeadersEvery answer, refusals included: Cache-Control: no-store, Referrer-Policy: no-referrer

The devtools panel’s script, embedded from dist/panel/panel.js. No auth, no host check: it is static and sits outside /api. 200 text/javascript; charset=utf-8, Cache-Control: no-cache; 500 when the bundle is missing from the build. Its group names no capability. Install the panel.

Capability panel-config, always on, unauthenticated. 200 {endpoint, version, capabilities}, Cache-Control: no-store: endpoint is the scheme (https only on a TLS connection; proxy headers are not read), the request’s Host and the base. Served only when the Host passes the setup A host rule and any Origin is the same host, a loopback origin or an AllowOrigins entry; otherwise 404, not 403, so a panel that cannot use it removes itself. Captured:

{"endpoint":"http://127.0.0.1:7331/","version":"v0.20.2","capabilities":["requests","steps","export","logs","diff","traces","search","stats","manifests","spans_tree","timeline","pricing","delete","proposals","live","scope_tags","ingest","auth","panel_token_tags","handoff","panel-config","runtimes","preview","target_check","runtime_forget","run_commands","breakpoints","steer","cancel","playground"]}

Every path no route claims. Files under assets/ are Cache-Control: public, max-age=31536000, immutable (a missing one is 404 no asset <path>); a path naming another embedded file (favicon.svg) serves that file with no-cache; every other path answers the single-page shell, text/html, no-cache, with <base href> set to Studio’s base and studio.Title as its title. No auth and no host check: the API behind it is what is walled. A method other than GET or HEAD is 405 the studio UI is static: GET only. Studio’s pages lists the paths the shell routes.

POST /v1/traces and POST /v1/logs are an OTLP/HTTP receiver (ingest.Traces and ingest.Logs in package studio/ingest, 0.7.0), capability ingest unless studio.NoIngest(). They sit outside /api, so the API’s Token does not apply. Send records from any language.

AspectBehaviour
Content-Typeapplication/x-protobuf or application/json (protojson). Else 415 Content-Type must be application/x-protobuf or application/json
Content-Encodingnone, identity or gzip. Else 415; a bad gzip stream: 400
Sizeingest.MaxBody: 16 MiB after decompression; above it 413 request body exceeds 16 MiB after decompression
WhoWith studio.IngestToken(tok): Authorization: Bearer <tok> on every POST, loopback included. Without one: a loopback socket peer only, refused when the request carries Forwarded, X-Forwarded-For, X-Real-Ip, or an Origin that is not allowed. Every refusal: 401 ingest requires Authorization: Bearer <ingest token>. /api/meta’s ingest_open says which applies
PipelineDecode, publish every record to the live hub (deltas and attempt frames included), then write. A write failure: 503 unavailable, so the exporter retries. On a database that publishes no run frames of its own (ClickHouse), the receiver also publishes a run frame for every run the batch touched, derived runs included (0.15.0)
200An empty export response in the request’s format: zero bytes of protobuf, or {} as JSON; partial_success is never set
Error bodyEvery refusal is Studio’s JSON error, {"error": {"code", "message"}} as application/json, even to an application/x-protobuf request: never an OTLP google.rpc.Status. A protobuf-only exporter cannot decode it; act on the status code
Other400 for an undecodable body; a 4xx is counted in /api/meta’s ingest.refused and logged as a rate-limited WARN; an unknown path under v1/ is 404
Terminal window
curl -s -w ' %{http_code}\n' -X POST -H 'Content-Type: application/json' \
--data '{"resourceSpans":[]}' http://127.0.0.1:7331/v1/traces
{} 200

Registered only under studio.Playground(true) (weft studio turns it on; --no-playground turns it off). Studio enqueues each command for a connected runtime, which runs it in the app: The playground. Bodies are capped at 4 MiB.

Capability playground; any identity. 200 {runtimes}, newest last_seen first:

FieldMeaning
id, host, pid, cwd, service, envThe runtime. cwd only to the server-or-loopback rule, never to a panel token
studio_url, weft_versionThe Studio the runtime’s link dialled, under cwd’s rule, absent in process (0.19.0); the weft the runtime was built with
connected_since, last_seen, connectedconnected: a live command stream now; a dropped runtime stays listed with false until pruned
restoredListed from the store after a Studio restart and not registered since
sessions, breakpoints_ownIt registered runtime.Sessions; its breakpoints also park the app’s own runs (built with runtime.Breakpoints())
agents[{name, manifest_hash, model_provider?, models, resolver, defaults, tools: [{name, side_effects, allow, approval?}], instructions}]. manifest_hash is the registered agent’s weft.manifest.hash (0.19.0); model_provider its own model’s provider (wefttest for a test script); approval marks a tool built with RequireApproval. defaults is absent for a runtime older than the option lab. A read token gets no instructions, no defaults.tool_choice.name and no defaults.stop
breakpoints, breakpoints_set_at, breakpoints_surface, breakpoints_byThe breakpoint set (never null); when Studio set it and through which surface (runtimes, or api for a PUT that named none), kept in the command store across restarts (0.20.0); and where a non-empty set came from: studio, runtime (its registration carried it) or store (restored after a restart)

Captured from a scratch app holding the link (trimmed: cwd and times removed):

{
"runtimes": [{
"id": "rt_4bccd920952a6381", "host": "build-01", "pid": 3019082, "service": "refb1app", "env": "",
"connected": true, "sessions": false, "breakpoints_own": false,
"agents": [{
"name": "support-bot", "models": [], "resolver": false,
"defaults": { "max_steps": 10, "parallelism": 4, "thinking": "", "tool_choice": { "mode": "auto" } },
"tools": [{ "name": "lookup_order", "side_effects": "safe", "allow": false }],
"instructions": "You are a support agent."
}],
"breakpoints": []
}]
}

Starts a run or a replay on a runtime: capability playground. Run experiments and Replay a run.

FieldValues
runtimeRequired: a registered runtime id
agentAn agent the runtime registered
command_idOptional idempotency key, [A-Za-z0-9._:-]{1,128}; Studio mints cmd_ plus a ULID
inputThe turn’s user message (with from_step 0 only)
source{run_id, from_step}: the run to replay and the step to re-run from
transcript_edits[{kind, step, call_id?, tool_result?, content?, args?, index?}]; kind is tool_result, reply, user, tool_args (checked against the step’s catalog schema) or insert; no kind is the pre-F2 reading. They need a source and from_step > 0
overridesinstructions, tools_enabled, model, thinking (off, low, medium, high), options {max_steps, parallelism, temperature}, params {top_p, max_tokens, stop, seed}, tool_choice {mode, name}, park_on, only_tools: narrowing or neutral only. only_tools applies when non-empty, else tools_enabled; when both are empty ([]) or absent the run gets every tool, so a command cannot turn every tool off
enginelive (default) or scripted (the source run’s recorded turns, zero tokens)
side_effectssubstitute (default), park or allow
threadephemeral (default) or fork (a new session with lineage; needs runtime.Threads on the runtime)
cross_agenttrue replays a source run recorded by another agent on this one (0.19.0). Without it that is a 400: source run R is agent A; this command targets agent B: send agent "A" to replay it as recorded, or cross_agent: true to replay it as B anyway
experiment_id, public_idThe experiment the run joins: any id of [A-Za-z0-9._:-]{1,128}, saved or not; the public id a panel token must send as its own
StatusWhen
202{"command_id": "cmd_…", "state": "queued"}; poll commands/{id}
400A refusal naming its rule: unknown engine warp, a scripted engine with an instructions or model override, edits without a source. Also temperature must be between 0 and 2, a tool not in the manifest, a derived source run (badge derived). A runtime too old for the request is refused too: runtime predates the option lab: upgrade weft/runtime to use params, tool_choice, park_on, only_tools, runtime predates transcript edit kinds: upgrade weft/runtime to use user, tool_args, insert edits, runtime predates replay across a compaction: …; upgrade weft/runtime, …
403A read token (this token is read-only: …); a playground token outside its public id, or with experiment_id; a widening override (max_steps may only lower the agent's cap, only_tools may only narrow tools_enabled: …, tool X is not opted in for real side effects)
404unknown runtime <id>, unknown agent <name>, unknown source run <id>
409command id X was already used
503runtime <id> is not connected

The 400 rules a hand-written body meets, by field (POST /api/playground/preview turns the scripted engine’s override, edit and step-count refusals into warnings; a missing source stays a 400 there too):

FieldRefused with
command_id, experiment_idcommand_id must be 1 to 128 characters of [A-Za-z0-9._:-], experiment_id must be 1 to 128 characters of [A-Za-z0-9._:-]
source.from_stepNegative: source.from_step must be 0 or more. An input with from_step > 0: input replaces the turn's user message only when from_step is 0: … (edit step 0’s message with a user edit instead)
engine: "scripted"No source: the scripted engine replays a source run's recorded turns: a source run is required. An instructions or model override: scripted engine with an instructions override would silently replay the old answer (WEFT-PLAYGROUND §5.5) (and the model form). Transcript edits: … transcript edits need engine live. from_step equal to the source’s step count: the scripted engine has no recorded turn for step N: the source never answered it (use engine live)
thread: "fork"No source: fork mode forks a source turn's session: a source run is required. No or empty input: fork mode continues the conversation: an input is required. from_step > 0: fork mode re-runs no steps (from_step is the ephemeral verb); send an input instead. Any other mode: unknown thread mode X
overrides.optionsA closed set: max_steps, parallelism, temperature; any other key is unknown option <key>. max_steps and parallelism must be whole numbers from 1 to 1,000,000 (<key> must be a whole number from 1); temperature 0 to 2
overrides.paramstop_p must be between 0 and 1, max_tokens must be positive, stop takes at most 4 sequences, got N, stop sequences must be non-empty; any seed
overrides.thinkingunknown thinking level X

Capability playground. 200 {command_id, state, run_id, status?, error, reason?, created, updated}: state is queued, accepted, rejected, finished or lost; status is succeeded or failed once finished; error is the run’s error, a rejection’s reason or why the command was lost, else null. reason (0.19.0) reads a scripted engine’s miss out of error: {kind: "scripted_miss", step, components, message}; absent for any other error. A panel token reads only its own public id’s commands, a read token included. 404 unknown command <id>. Captured:

{"command_id":"cmd_01M57QNZ1KYYPGTDH17SDAEV4C","state":"finished","run_id":"pg_01M57QNZ1KRRJ82F3TMR6C9VG4","status":"failed","error":"weft: run failed at step 0: model stream: wefttest: model script exhausted (agent made more model calls than the script provides)","created":"2026-10-18T16:47:02.451313998+02:00","updated":"2026-10-18T16:47:02.452318302+02:00"}

A parked run’s decision: capability playground. Body {call_id, decision, reason?, content?}; decision is approve (the handler runs), deny (with the reason) or resolve (content is the result). Breakpoints and decisions.

StatusWhen
202{command_id, state: "queued"} for a runtime-started run; for an app-owned turn under runtime.Sessions, {command_id, state, run_id, runtime_id}
400unknown decision X, an approval needs a call_id, run <id> is not parked: …, call C is not pending on run R (pending: …)
403A read token; out of scope; an app-owned turn
404unknown run <id>
503The runtime is not connected. Studio mints the approval’s command id, so there is no reused-id 409

Capability steer. Body {"message": "…"}; without it, 400 steer body: message is required. A runtime-started run: 202 {"steered": true}, best effort, no command row, and no state check: a run that already finished still gets the 202. An app-owned turn under runtime.Sessions: 202 {command_id, state, run_id, runtime_id}; without it, 403 app-owned turn. A parked app turn is refused at once with 409: no running turn to steer: run R is parked: decide its pending calls (approve/deny) instead. So is one whose row reads succeeded or failed: … already finished (succeeded). 403 for a read token or out of scope; 404 unknown run <id>; 503 when the runtime is not connected.

Capability cancel; no body; the same auth as steer. Best effort: the link’s cancel frame for the command holding the run.

StatusWhen
202{run_id, command_id, runtime_id, state: "cancelling"}
403A read token; out of scope; an app-owned turn without a runtime.Sessions runtime (app-owned turns)
404unknown run <id>
409Parked (run R is parked: decide its pending calls (approve/deny) instead), or finished (run R already finished …). An app-owned turn under runtime.Sessions is never cancelled from here: cancel is not supported on an app turn: run R is the app's own turn
503runtime X is not connected

Capability breakpoints. Body {"tools": [...], "surface"?: "runtimes"}; an empty list clears. surface (0.20.0) names the page that sent the set, read back as breakpoints_surface; it must match [a-z][a-z0-9_-]{0,31}, else 400 surface must be a short lowercase word ([a-z][a-z0-9_-]{0,31}), e.g. runtimes. Server or setup A only: every panel token gets 403 breakpoints park every future run of the runtime: the server token, not a panel token. 200 {"tools": [...]}: the set is delivered to the runtime and stored. The runtime parks those tools on every run it starts and, with breakpoints_own, on the app’s own runs built with runtime.Breakpoints(). A clear answers {"tools": null} (captured). 400 for a tool no agent of the runtime registered; 404 unknown runtime <id>; 503 when not connected, and nothing is stored.

Forgets a runtime that is gone: its row and its breakpoint set leave the list and the command store, and its commands and routes stay as history. 204 once it is gone. 409 runtime <id> is connected: only a runtime that is gone is forgotten, or … still has queued or accepted commands: forget it once they resolve. 404 for an id nothing registered. Runtime-wide, so a panel token gets 403. Capability runtime_forget (0.19.0). Forget a runtime.

The replay’s exact first request beside the recorded step’s, and their diff: pure assembly, no model call and no runtime needed.

AspectBehaviour
Capabilitypreview
BodyThe body of POST /api/playground/runs, with a source
WhoScoped. A read token may preview its own public id; its system prompt, tools and view messages read hidden
200{source, agent, engine, runtime, will_send, was_sent, diff, compacted_at, warnings, unchecked, scripted_hit, scripted_key_match}
scripted_hit, scripted_key_matchWhatever the engine (0.19.0): per step from from_step through the first miss, {step, hit, because}, whether the scripted engine holds a recorded answer. scripted_key_match sums it up: {ok, because, step, message?}, the first missing step and the sentence a failed scripted run’s command reads too
will_send, was_sent{system, messages, tools, model, params, thinking, tool_choice}, with system_source, tools_source and params_source (override, agent or recorded), and system_badge, messages_badge and tools_badge where a block is a hole; a side may carry badge, reason, fix for the request as a whole
warnings, unchecked[{kind, message}]; the overrides only a registered agent could check
400No source (a preview needs a source run: …), thread: "fork", from_step past the last step, a derived source (badge derived)
409The source transcript does not rebuild; the message only, no badge

wefttest replay fixtures rebuilt from the run’s records, returned, never written by Studio.

AspectBehaviour
Capabilityplayground
Body{run_id, tools?}; tools keys a run recorded before request records
200{run_id, agent, files: [{name, body}]}
400fixture body: run_id is required; a derived run (badge derived)
403A read token (badge hidden), checked before the body; out of scope
404unknown run <id>
409The transcript cannot be fixtured: the hole as badge (stripped, gap or derived). Without a badge: the run recorded no assistant turns to fixture

Capability playground; the server token or setup A only: every panel token gets 403, reads included. limit: 50 by default, at most 200. 200 {experiments, total}, most recently updated first; each saved with its whole command (engine, side_effects, thread, from_step, source_run_id, transcript_edits, variants with their overrides and modes, inputs) plus created, updated, run_count, succeeded, last_run and cost. /api/runs and /api/search filter its runs by experiment_id.

Creates or replaces a saved experiment by id ([A-Za-z0-9._:-]{1,128}, the weft.experiment.id its runs carry); fields left out are cleared. At least one variant and one input. 200: the experiment’s detail document, with runs: null; 400 naming the rule (engine must be live or scripted, …); 403 for any panel token.

The experiment and runs: its top-level runs as run rows, oldest first, read 20 pages of 500, so at most 10,000. 404 unknown experiment <id>; 403 for any panel token.

A run the app started itself, not a playground command, is an app-owned turn. Approvals, steer and cancel on it go through the app’s runtime.Sessions when a connected runtime of the run’s service registered it; otherwise they are 403 with a fix beside the error. The cases, in the order Studio checks them:

CaseMessagefix
The service’s Sessions runtime disconnectedapp-owned turn · read-only: the app's runtime <rt> of service <svc> disconnected — last seen <time>restart the app: its runtime link registers again
A runtime, no Sessionsapp-owned turn · read-only: run <id> is the app's own, and no connected runtime of its service <svc> acts on the app's sessionsset runtime.Sessions(resolver) at runtime.Install in the app (service <svc>): …
None here; this process’s link dialled another Studio (server or loopback only)app-owned turn · read-only: no runtime of service <svc> is connected here — the app's link dialled <url>open the panel there (data-endpoint), or link in-process: runtime.Local(srv)
No runtime of the service connectedapp-owned turn · read-only: no runtime of service <svc> is connectedopen the runtime link in the app: WEFT_ENV=dev (or runtime.Enabled(true)) at runtime.Install, with runtime.Sessions(resolver)
A Sessions runtime, but not a session turn with a public idapp-owned turn · read-only: run <id> is not a turn of a session with a public idA plain Generate’s park: resume it in your app; to decide here, run it as a session turn with thread.PublicID(...) (weft/thread). A session turn without a public id: run the agent through weft/thread with thread.PublicID(...): runtime.Sessions resolves a session by its public id

Decide an app’s own turns covers the setup.

Three routes the app’s weft/runtime calls to hold the playground link: not for browsers or scripts. Capability runtimes; server to server (every panel token: 403). Bodies are capped at 8 MiB, since a registration carries one manifest per agent. Connect your app to the playground.

weft/runtime (Go) is the only runtime-link client today. The wire below is documented for future clients in other languages; none ships yet.

RouteBodyAnswer
POST /api/runtime/register{runtime_id, host, pid, cwd?, instance?, service, env, weft_version, budget, threads, sessions, breakpoints_own, breakpoints, agents, heartbeat_ms}; each agent {name, manifest, models, resolver, limits, defaults, side_effects, allow}200 {runtime_id, commands_url}. 400 without runtime_id or agents. An id another process holds (a live stream, or queued or accepted work) is answered <id>-<pid>, which the client adopts. Without instance, Studio WARNs once: a client must send it to keep at-most-once across restarts
GET /api/runtime/commands?runtime=<id>—SSE. On open: ping, the stored breakpoint set, then queued commands after Last-Event-ID (a cmd_ id Studio never minted re-sends nothing). Frames run, approve, breakpoints, steer, session, cancel (no id: line), ping every 15 s. A new stream replaces the old. 400 without runtime, 404 for an unregistered id, 405 for HEAD
POST /api/runtime/acks{command_id, state, run_id?, status?, error?, reason?} (reason, 0.19.0: {kind, step, components}, what the runtime knows of why its run failed, such as scripted_miss); state is accepted, rejected or finished200, empty. A repeated accepted ack is the heartbeat, every minute. In order: 400 ack body: command_id is required; 404 unknown command <id>; 400 ack body: unknown state X; 409 command <id> was marked lost before this accepted ack (…): it must not run

What a runtime client sends to POST /api/runtime/register. Go types Registration, AgentRegistration, AgentLimits, AgentDefaults and Budget; weft/runtime mirrors them, with the JSON pinned by tests.

KeyTypeMeaning
runtime_idstringRequired (400 register body: runtime_id is required). Studio may answer another id, which the client adopts
host, pid, cwd?string, int, stringThe process; cwd is one input of the stable id
instance?stringRandom per link, kept across its reconnects; with host and pid it tells a reconnect of the same process from a second process
studio_url?stringThe Studio the link dialled, credentials stripped; "" in process (0.19.0). /api/runtimes serves it
service, env, weft_versionstringThe app’s service name, its WEFT_ENV, its weft version
budget{max_tokens_per_experiment, max_runs_per_experiment}The runtime’s per-experiment caps, both int64
threads, sessions, breakpoints_ownboolruntime.Threads set (fork mode works); runtime.Sessions set (app-owned turns route to it); an agent built with runtime.Breakpoints(). An older runtime sends false
breakpointsstring listThe breakpoint set the runtime holds now; a Studio that holds none for this id adopts it
agentslist, at least one400 register body: no agents when empty. One object per exposed agent, below
heartbeat_msint64The cadence of the repeated accepted ack; 0 (an older runtime) gets the finish watch only when its stream ends

Each agents entry:

KeyTypeMeaning
namestringThe agent’s name
manifeststringThe agent’s one-agent weft.Manifest document, as JSON text. Its tool names, input schemas, model name and instructions are read from it; a manifest that does not parse leaves the agent out of the remembered manifests
manifest_hash?stringSHA-256 (lowercase hex) of manifest as registered: the weft.manifest.hash the agent’s runs carry (0.19.0). Without it Studio hashes manifest itself
modelsstring listThe alternate models a command’s model override may name
resolverboolThe runtime holds a runtime.ModelResolver, so a model outside models is the runtime’s to decide
limits{max_steps, parallelism}The agent’s own lower-only bounds
defaults{max_steps, parallelism, thinking, thinking_budget?, temperature?, top_p?, max_tokens?, seed?, stop?, tool_choice {mode, name?}}The agent’s run defaults in the override vocabulary; thinking "" is the provider default; thinking_budget the default budget in tokens, absent when none; tool_choice.mode auto when none was set. A runtime older than the option lab sends the zero value
side_effectsobject, tool name → "safe" or "never"Each tool’s replay class (weft.Replay); unannotated is never
allowstring listThe tools opted in with runtime.AllowSideEffects

Each SSE frame’s data is one JSON object. Frames that carry an id: line use the command id there; the runtime acks run, approve and session frames by that id. Studio keeps no command row for breakpoints or steer, and the runtime acks neither.

Eventid:data (Go type)
runthe command idCommand: {command_id, agent, source, input, overrides, transcript_edits, engine, side_effects, thread, experiment_id, actor, public_id}. source is {run_id, from_step} or null; input a string or null; overrides and transcript_edits the POST /api/playground/runs shapes; actor is local, server or panel:<public id>
approvethe command idApprovalDecision: {command_id, run_id, call_id, decision, reason?, content?, actor?}; decision is approve, deny or resolve
sessionthe command idSessionCommand: {command_id, verb, public_id, session_id, run_id, call_id?, decision?, reason?, content?, message?, actor?}; verb decide carries call_id, decision, reason, content; steer carries message; cancel nothing more
breakpointsa fresh idBreakpoints: {tools}; an empty list clears. Sent on every stream open, before the backlog
steera fresh idSteerMessage: {run_id, message}
cancelnone{command_id}: the command whose run to cancel
pingnone{}, every 15 s

How a runtime answers a session frame it does not carry out. In the cases listed, nothing is written to the session:

AckReason
rejected, before the accepted ackThe runtime’s refusals: this runtime does not act on the app's sessions: runtime.Sessions(...) is not set; cancel is not supported on an app turn; no session for this public id; the session resolver answered session S for public id P, not the run's session S2. The session’s own: the app is writing this session; fork instead (the writer lease is taken); this session requires signed decisions: decide it in the app (thread.DecideSigned). A body check: unknown session verb …, a session command needs public_id, session_id and run_id, unknown decision …, a decision needs a call_id, a steer needs a message. A pending check: call … is not pending on session …, session … has no parked call: …, call … was parked by run …, not …. The resolver’s or the lease claim’s own error, as its text: session resolver timed out, session claim timed out, session resolver panicked: …. An ErrStale on the second open, or any other error the resolver returned, reads the same way
finished with status: "failed", after the accepted ackno running turn to steer for run <id> (…): whether a turn runs is known only under the session’s lock. the app is writing this session; fork instead: the lease was lost between the claim and the write. Any other error Decide or Steer returns, as its own text

Contract and code. The godoc of SessionCommand (studio/runtime/runtime.go:473-480) lists four refusals, all “before any write”, including no running turn to steer. The code holds six refusal texts (runtime/sessions.go:30-37), and it sends no running turn to steer, and sometimes the locked reason, as a failed finish after the accepted ack (runtime/sessions.go:104-107, 139-145).

Command states and timers:

TransitionRule
queued → acceptedThe runtime acks within Studio’s 30 s window (it validates, fetches the source and resolves the model within 25 s); no ack in time is lost, and a stream that ends loses its queued commands at once (runtime disconnected before the ack)
accepted → finishedA finished ack. Silent for max(10 min, 3 beats) after its stream ended or its last beat: lost. An accepted ack Studio did not take runs nothing
rejectedThe runtime refused it, with its reason
RestartCommands, routes, breakpoints and registrations persist through obsdb.CommandStore; a restarted Studio decides lost from the stored state and never re-sends an accepted command
IdsStable per service, cwd and agents: rt_ plus 16 hex digits of SHA-256

The Go side is package studio/runtime, the server these routes run on. studio.Server.Runtime returns its server under Playground(true), and runtime.Local(srv) drives it in process.

SymbolWhat it is
New(opts ...Option)Builds a RuntimeServer with the default timers (0.15.0: it took no options before, the framework module’s breaking line)
Option, WithStoreOptions; WithStore(obsdb.CommandStore) writes through and loads at New
RuntimeServerThe registry of runtimes. Fields AckDeadline (30 s: queued without an ack), FinishDeadline (10 min: accepted without word), PingEvery (15 s), Retention (24 h: terminal commands, run routes, a gone runtime holding breakpoints), WriteTimeout (30 s per frame). At most 10,000 command rows are kept in memory, the oldest terminal ones dropped first
RuntimeServer.Mount, RuntimeServer.MountGuardedMount the three routes, bare or each wrapped in a guard; Studio passes its server-to-server guard
RuntimeServer.Enqueue(runtimeID, Command) (Command, error)Queue a run frame. It validates the command id, its uniqueness and the connection (ErrInvalidCommandID, ErrDuplicateCommand, ErrUnknownRuntime, ErrNotConnected), not the command body: the playground route does that; it mints command_id when empty and returns the command as queued
RuntimeServer.EnqueueApproval(runtimeID, ApprovalDecision) (ApprovalDecision, error)Queue an approve frame, minting command_id. ApprovalDecision.PublicID is json:"-": never on the wire, it is the scope the command row and the resumed run carry, so a panel token can poll its own decision; empty takes the run’s recorded scope
RuntimeServer.EnqueueSession(runtimeID, SessionCommand) (SessionCommand, error)Queue a session frame for a runtime that registered Sessions, minting command_id; the row carries PublicID
RuntimeServer.Steer(runtimeID, runID, message) error, RuntimeServer.Cancel(runtimeID, commandID), RuntimeServer.CancelRun(runID) (CancelTarget, error)Best-effort steer and cancel frames. CancelRun finds the accepted command holding the run and returns a CancelTarget {run_id, command_id, runtime_id}
RuntimeServer.SetBreakpoints, RuntimeServer.BreakpointsOfDeliver and store a breakpoint set (not connected: nothing stored); read it
RuntimeServer.Command, RuntimeServer.CommandOfA command’s lifecycle row; the command as enqueued
RuntimeServer.Registration, RuntimeServer.Connected, RuntimeServer.SnapshotA runtime’s registration; whether it holds a stream; the /api/runtimes rows
RuntimeServer.RuntimeOf, RuntimeServer.PublicOfThe runtime that started a run, from its acks; the public id it was scoped to
RuntimeServer.SessionsRuntime, RuntimeServer.AnySessions, RuntimeServer.AnyOwnRunsThe runtime acting on a service’s sessions; whether any does; whether any parks the app’s own runs (/api/meta’s debug_scope)
RuntimeServer.Manifests() []ManifestSourceThe registrations’ manifests, live first, then the most recently registered; about 64 are remembered, in memory. The bound is soft: past it the oldest manifest no connected runtime holds is dropped, one per registration, and a held one never is
Registration.Agent(name)The named AgentRegistration of a registration, and whether it is there
AgentRegistrationOne agents entry (above). Methods IsAllowed(tool) (on allow), ManifestToolNames, ManifestToolSchemas, ManifestModelName, ManifestInstructions (read from manifest)
AgentLimits, AgentDefaults, BudgetThe limits, defaults and budget objects
ApprovalDecision, SessionCommand, SteerMessage, Breakpoints, CancelTargetThe frame payloads (above) and CancelRun’s answer
RegisterResponse{runtime_id, commands_url}: the answer to POST /api/runtime/register; runtime_id is the id the client adopts
Command, SourceSpecThe run frame’s payload (above). SourceSpec is its source, {run_id, from_step}: the run to re-run and the step to replay from. Command.Runtime, the runtime it was enqueued to, is json:"-"
CommandStatus{command_id, state, run_id, status?, error, created, updated}: what RuntimeServer.Command returns and GET /api/playground/commands/{id} serves. status is the finished run’s succeeded or failed, absent until finished; error a failed run’s error, a rejection’s reason or what made the command lost, else null
RuntimeView, AgentView, ToolViewThe rows of GET /api/runtimes that RuntimeServer.Snapshot returns. ToolView is one tool of a runtime’s agent: {name, side_effects, allow}, one per tool of the agent’s manifest: its replay class from the registration’s side_effects (safe or never) and whether runtime.AllowSideEffects opted it in
ManifestSource{service, manifest_hash, live, registered_at, runtime_id, agents}: one remembered registration manifest, a sources[] entry of GET /api/manifest. Version, the manifest documents’ weft format version, is json:"-" and so never on the wire
ManifestAgent{name, manifest_hash}: one agent of it, manifest_hash the weft.manifest.hash its runs carry. Entry, its object in the manifest, is json:"-"
RuntimeServer.Close, RuntimeServer.ShutdownStop timers and streams, drain the store (Close: a 5 s drain)
VerbDecide, VerbSteer, VerbCancelA session command’s verb: decide, steer, cancel
StateQueued, StateAccepted, StateRejected, StateFinished, StateLostThe command states
ErrUnknownRuntime, ErrNotConnected, ErrDuplicateCommand, ErrInvalidCommandIDMapped to 404, 503, 409 and 400
ErrUnknownCommand, ErrUnknownRun, ErrRunFinishedNo such command; no runtime started the run; its command is no longer in flight
ValidCommandIDThe [A-Za-z0-9._:-]{1,128} rule (0.8.0: a line break in a caller’s id could forge frames on the stream)

ExampleRuntimeServer mounts a server on a test mux, posts one registration and reads it back with Snapshot.

SinceChange
0.7.0The link: register, the SSE command stream, acks, the lost-command timers
0.8.0ValidCommandID, ErrInvalidCommandID, Retention, WriteTimeout, RuntimeView.Breakpoints; command rows’ status and error; a panel token may poll its own approval and steer the resumed run
0.15.0Stable runtime ids; cwd and instance in the registration; approvals, steer and cancel on an app-owned turn answer 202 or 403; New takes options

The package’s 0.19.0 and 0.20.0 additions:

NameWhat it is
RuntimeServer.CommandsOn(runID) → []RunCommandThe commands acting on one run, oldest first: GET /api/runs/{id}/commands. A RunCommand is a command’s status plus Verb (decide, steer, cancel), CallID, Decision and PublicID
RuntimeServer.Forget(id)DELETE /api/runtimes/{id}; ErrConnected for a runtime holding a live stream, ErrRuntimeBusy for one with queued or accepted commands
RuntimeServer.HoldsInstance(instance)Whether a link with that registration instance registered here, connected or not
RuntimeServer.SetBreakpointsFrom(id, tools, surface)SetBreakpoints naming the surface the set came through (0.20.0); "" reads BreakpointsSurfaceAPI, api
BreakpointsByStudio, BreakpointsByRuntime, BreakpointsByStoreWhere a runtime’s breakpoint set came from, RuntimeView.BreakpointsBy
Reason, ReasonOf(text), ScriptedMissReason(step, components), ReasonScriptedMissA command’s structured why: {kind, step, components, message}. ReasonOf reads a scripted miss out of an error text; ScriptedMissReason writes the same sentence for a miss predicted before Run
AckReasonAck.Reason: Reason without Studio’s sentence

The package examples ExampleReasonOf, ExampleScriptedMissReason, ExampleRuntimeServer_CommandsOn, ExampleRuntimeServer_Forget, ExampleRuntimeServer_HoldsInstance and ExampleAgentRegistration_ManifestModelProvider show each.

Packages: weft/studio · weft/studio/ingest · weft/studio/runtime · weft/obsdb