Skip to content

Agent runtime ​

A Console agent is more than one request and one answer. Behind Build → Agents sits a runtime that keeps a conversation as a session, writes everything that happens in it to an event log, can pause for a person, stop at a budget, hold files in a bucket you choose, run in the background, and tell your own systems about it with signed webhooks.

This section documents that runtime end to end: what each part is, where its switches are in Studio, what the client API looks like, and what the errors mean. Every claim here comes from the control plane's code; where an older document and the code disagreed, the code won.

Two ways to read this section

Operators and agent authors want the Guide pages — the Studio click-path, every setting with its default, and what it changes. Integrators want the API pages (Agent sessions, Webhooks, Agents). Each Guide page carries the same calls as curl and as @cognipeer/console-sdk so you can copy either.

The pieces ​

ConceptWhat it isPage
SessionOne conversation with an agent: its messages, files, spend and what it is doing now. The {id} in resp_{id} is the session id.Sessions
TurnOne user message and everything the agent does until it answers or stops.Session events
Event logAn append-only record of every turn: messages, tool calls, requests for a person, spend. Readable afterwards or followed live.Session events
ActionA request that pauses a turn until someone answers it: a tool approval, a question, or a tool that runs in the host page.Approvals & questions
Session budgetA cap on what the whole session may spend, with a choice between pause and stop.Session budgets
Session fileA document or image attached to a session, stored in a Document Store bucket you chose.Session files
RunA turn that was queued with background: true instead of holding the HTTP call open.Background runs
WebhookA signed, retried HTTP call from Console to your URL when something above happens.Webhooks
Sub-agentA second agent loop a turn hands a task to, with its own prompt, tools and model, that sends back one result.Delegation (sub-agents)
TemplateA ready-made agent from the catalog of 25 that becomes an editable draft in your project.Agent templates
ChannelA Slack app or Teams bot that lets people talk to one published agent where they already work (Enterprise).Slack and Microsoft Teams channels
FeedbackWhat a chat surface (a portal, an embedded widget, your own client) builds on an agent: thumbs, titles, regenerate and edit.Feedback & message actions
                        ┌─────────────── session ───────────────┐
 user message ─► turn ──┤  event log   (every step, 30 days)    │──► SSE / poll
                  │     │  files       (your bucket)            │
                  │     │  budget      (pause / stop)           │
                  │     └───────────────────────────────────────┘
                  │
                  ├─► tool needs approval / agent asks a question
                  │        └─► requires_action ──► person answers ──► turn carries on
                  │
                  ├─► session budget reached ──► budget_paused ──► raise it ──► turn carries on
                  │
                  └─► end_turn / limit / cancelled / error ──► idle
                           │
                           └──► webhooks: session.idled, action.required, budget.reached, agent_run.*, …

A turn that pauses is not lost. Whether it waited for a person or for a budget, the same turn carries on from where it stopped when the request is answered.

Where the switches are ​

Open Build → Agents, then an agent. Its tabs are Overview, Sessions, Build, Ship, Feedback and Usage. The runtime's settings live in the Build tab, as sections of one page that one Save Configuration button writes.

Build sectionWhat it controlsStored asTakes effect
CallbackWhere the result of an async run is POSTed when the request names no URL of its ownconfig.callbackWith the version that runs
Session budgetWhat a whole session may spend, pause or stop, and whether API clients may change itconfig.budgetWith the version that runs
VariablesNamed, typed values a caller sends next to the message, for calls from code and triggers, not for chat; see Variablesconfig.variablesWith the version that runs
FilesWhether people can attach files, which bucket, limits, how images are readconfig.attachmentsWith the version that runs: the draft in Studio, the published version for API and portal traffic
Approvals & questionsTool approvals, questions, timeouts, who may answerconfig.humanInTheLoopSame — publish again for API and portal traffic

Draft versus published

The runs API, the Responses and chat completions endpoints, A2A and portals run the published version of an agent (the draft only if it was never published); the Studio playground runs the draft. Send version to pin a version, or "version": "draft" to run the draft from the API. Files, approvals, budget and experience settings travel with the version, so a change you save in Build reaches API and portal callers only after you publish again. See Build and publish an agent for the publish flow.

New agents do not have to start empty: pick one of 25 ready-made agents in Agent templates, and split work across sub-agents when a task needs its own prompt, tools or model.

There are no per-agent execution settings any more: how long a call waits, how long a run may last and how many may be active are operator settings, see Background runs. Calling agents from other systems, with copy-paste examples for Open WebUI, n8n, the OpenAI SDK, CI pipelines and triggers, is in Agent integrations.

Two places live outside the agent page:

  • Build → Agents → Webhooks (/dashboard/agents/webhooks) manages webhook endpoints. They belong to a project or the whole tenant, not to one agent.
  • Data → Document Store holds the buckets that session files are stored in, and Model Hub holds the input types that decide whether a model is shown images.

Conventions the client API follows ​

ConventionDetail
Base path and authhttps://<your-host>/api/client/v1 with Authorization: Bearer cpeer_…. A token sees only its own project.
Field namesThe agent family — Responses, runs, sessions, events, actions, session files — is snake_case (stop_reason, required_action, max_cost_usd). Webhook endpoint objects and webhook event payloads are camelCase (projectId, conversationId). The dashboard's own /api/… routes are camelCase. Tool args and free-form answers are never re-keyed.
IdentifiersRun run_{id}, response resp_{runId} (the same run; older resp_{conversationId} ids still work), action act_{id}, webhook event evt_{id}, webhook secret whsec_…. A session's id is the bare conversation id, with no prefix.
Errors{ "error": { "type": "…", "code": "…", "message": "…" } } on the runs API and the sessions routes, with extra snake_case fields where they help (pending_action_ids, spent_usd, max_cost_usd, action_status). The OpenAI endpoints answer the OpenAI envelope (message, type, param, code); A2A answers JSON-RPC errors.
Unknown valuesNew event types, stop reasons and webhook events can appear in later releases. Ignore the ones you do not know.

The same engine behind every door

The runs API, POST /responses, POST /chat/completions and A2A all start the same run. POST /agents/responses stays as an agents-only alias of POST /responses. See Calling agents from other systems.

Statuses at a glance ​

WhereValuesMeaning
Session runtime_statusidle, running, requires_action, budget_pausedWhat the session is doing now. idle includes a session that has never run.
Session / event stop_reasonend_turn, requires_action, limit, cancelled, error, budget_reachedWhy the last turn stopped.
Response statusqueued, in_progress, completed, incomplete, failed, cancelled, requires_actionqueued and in_progress come with a 202. incomplete = a limit or the session budget ended the turn before a final answer. A Responses stop_reason of a normal answer is completed; the session's is end_turn.
Run statusscheduled, queued, running, requires_action, succeeded, failed, canceledscheduled has a future start. requires_action is non-terminal and waits for a person.
Pending action statuspending, resolved, expired, cancelledAn action is answered at most once.

Defaults and limits ​

WhatValueWhere to change it
Session events kept30 daysAGENT_SESSION_EVENT_RETENTION_DAYS
Event data size16 KB, then truncated with _truncated: true—
Wait window of a synchronous call600 s, then 202 and the run continuesAGENT_SYNC_TIMEOUT_MS
Run ceiling (any run)30 minAGENT_BACKGROUND_MAX_DURATION_MS
Active default-class runs per tenant250 (inline, queued and running)AGENT_RUN_MAX_ACTIVE_PER_TENANT
Deferred runs2 running, 10 000 queued, wait up to 24 hAGENT_DEFERRED_*, see Run classes
Runs kept30 daysAGENT_RUN_RETENTION_DAYS
Approval waits1440 min (a day), 0 = neverApprovals & questions
Session files10 per session, 20 MB each, kept 30 days; agent-created files 10 per turn, 2 MB eachFiles
Webhook delivery8 attempts over about two days, 10 s timeoutEnvironment, see Webhooks
Webhook endpoints50 per tenant—

What's new ​

The agent platform release adds the runs API, triggers (schedule, once, manual and webhook) and run classes, complete Responses, chat-completions and A2A dialects (streaming, structured output, variables, cancel) and agent file outputs, and removes the Execution settings, agent schedules and the Assistants adapter. See Calling agents from other systems and the release notes.

The earlier agent runtime release (October 2026) added, in one go:

  • the session event log with a poll endpoint and a resumable Server-Sent-Events stream, and a live Activity tab in Studio;
  • human in the loop: tool approvals, questions to the user, tools that run in the embedding page, a requires_action Responses status, and input-required over A2A;
  • session budgets with pause and stop, client overrides, and tenant spend limits that now count agent spend;
  • webhooks under Build → Agents → Webhooks, with signing, retries, redelivery and secret rotation;
  • session files stored in a bucket of your project, images that travel by reference, and a view_image tool;
  • the sessions API: create an empty session, upload, ask, list, delete — and session_id on the Responses API;
  • model input types in the Model Hub, so an image is only sent to a model that reads images;
  • a snake_case client wire for everything in the agent family, and a rewritten OpenAPI specification.

An agent that uses none of it behaves as before: without approvals it never pauses, without a budget it never stops on one, and without a bucket it takes no attachments. The one thing to check is a client that sends input_file or input_image parts by habit — those used to be ignored and are now either used or refused, see Session files.

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub