Skip to main content

Agent Operations

This page documents every operation available for managing agent lifecycle and interaction. All operations are invoked via the REST API (POST /api/v1/invoke) or as MCP tools.

Work reaches an agent through a session — a persistent conversation thread. agent:request, agent:chat, and agent:message all attach to a session (minting a new one if you don't supply a sessionId). See Sessions for the full model.

Running Agents​

agent:request​

Send a tracked task to an agent. The task is recorded as a Job. This is the primary tool for agent delegation. It is best-effort synchronous: it waits up to timeout ms for the agent to finish.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier
inputobjectrequiredTask payload — the instructions/data the agent needs. Never empty.
timeoutinteger (ms)5000How long to wait synchronously. 0 returns a snapshot immediately (pure async).
responseSchemaobject—JSON Schema for the task result. Shown to the agent as the target shape, and advisory unless strict is set. Overrides the agent's config-level responseFormat for this task.
strictbooleanfalseEnforce responseSchema at completion. A complete_task result that doesn't conform is rejected back to the agent with the validation diagnostics, and the agent corrects it or fails the task.
sessionIdstring (hex)—Continue an existing session. Omit to mint a new one (returned in the response).
outputPathstring—A mutable lattice path for structural result handoff (w/pipeline/run1/chapter1, t/stage1, or an authorised DID-URL path). On successful completion the framework writes the worker's full result there — so a pipeline stage can hand off without the caller relaying the payload.
loadsobject—Context to pre-load for a new session — the session tier of the scope chain, as a map of lattice path to {budget} bytes. Valid only when this call creates the session; an error if the session already exists.
{
"operation": "v/ops/agent/request",
"input": {
"agentId": "Alice",
"input": { "task": "What vendors are overdue?" },
"timeout": 30000
}
}

If the agent completes within timeout, the response is its structured output. If not, you get a snapshot to poll:

{ "id": "0x1234...", "status": "STARTED", "agentId": "Alice", "sessionId": "0xabcd..." }

Poll for the result with grid:jobResult (grid_job_result), passing that id and a timeout. The response always carries the sessionId the task belonged to.

agent:chat​

Send a message and synchronously await the agent's next response on the session. The A2A SendMessage analogue — use it for conversational interactions where you want a reply.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier
messageanyrequiredMessage content — string, object, or any JSON value
sessionIdstring (hex)—Echo a previous sessionId to continue the conversation. Omit to start a new session. An unknown sessionId is rejected.
loadsobject—Context to pre-load for a new session — a map of lattice path to {budget} bytes. Valid only when this call creates the session.
{
"operation": "v/ops/agent/chat",
"input": { "agentId": "Alice", "message": "Summarise the vendor records" }
}

Response:

{ "agentId": "Alice", "sessionId": "0xabcd...", "response": "Three vendors are overdue..." }

Only one chat may be in flight per session — concurrent calls on the same session are rejected.

agent:message​

Send a fire-and-forget notification. The message is delivered into the session and consumed on the agent's next run — no agent response is returned (the call acknowledges with { "delivered": true }) and no Job is created.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier
messagestringrequiredNotification text
sessionIdstring (hex)—Deliver into an existing session. Omit to mint a new one.
{
"operation": "v/ops/agent/message",
"input": {
"agentId": "Alice",
"message": "New invoice uploaded to w/invoices/INV-2026-042"
}
}

Use messages for one-way alerts where no reply is needed.

agent:trigger​

A fallback kick that nudges the agent's run loop to execute a cycle. Not a result-getter — it carries no payload and makes no guarantee about output. Use it after a manual state edit, for diagnostics, or to resume a stuck agent. For results, await the relevant task or chat Job instead.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier
forcebooleantruetrue: run even with no outstanding work. false: no-op if idle (the scheduler fires deferred wakes with force=false).
waitboolean / numbertruetrue blocks until the cycle yields/completes, false returns immediately, a number sets a timeout in ms. Not a result-await.
sessionIdstring (hex)—Resolved and echoed back if supplied; trigger never creates a session.
{ "operation": "v/ops/agent/trigger", "input": { "agentId": "Alice", "force": false } }

Task Completion​

These are framework tools an agent transition calls (typically as an LLM tool call) to finish a task. The agentId and taskId are read from the request context — the framework populates them when dispatching a task transition, so neither is a parameter. Without a task in scope the call fails.

agent:complete-task​

Marks the in-scope task complete and delivers the result to the caller. Exposed to LLMs as the harness tool complete_task.

ParameterTypeDefaultDescription
resultany—The successful result to deliver. Open schema — any structured value.

agent:fail-task​

Marks the in-scope task failed. Exposed to LLMs as the harness tool fail_task.

ParameterTypeDefaultDescription
errorstringrequiredHuman-readable failure reason.

Lifecycle Management​

agent:create​

Create a new agent. See Creating Agents for full configuration details.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier. Must be unused — an existing agent is an error.
configobject / string / array—One config layer, or an ordered array of layers. A layer is an inline map or a string reference: template (template:worker), workspace path (w/templates/reader), asset ref (a/<hash>), or DID URL. Later layers override earlier ones — nested maps merge recursively, arrays replace. A resolved composition may carry state, used as the agent's initial state.
definitionobject—The agent definition, where it is supplied directly rather than composed from config layers.

Omit config entirely for the recommended skilled default. Pass config: {} only when you deliberately want a minimal configuration.

// Layers merge left to right
{ "operation": "v/ops/agent/create",
"input": {
"agentId": "Alice",
"config": ["template:worker", "w/agent-config/providers/anthropic", { "model": "claude-sonnet-5" }]
}
}

:::caution No overwrite agent:create no longer accepts overwrite — a request carrying it fails. To change an existing agent use agent:update (history-preserving); to replace one, call agent:delete with remove: true and then create it again. The same applies to agent:fork. :::

agent:update​

Update agent configuration or state without recreating. config is shallow-merged.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier
configobject—Configuration fields to merge
stateany—State to merge or replace

Framework-managed fields (status, tasks, timeline, sessions) are not affected.

{
"operation": "v/ops/agent/update",
"input": {
"agentId": "Alice",
"config": { "systemPrompt": "Updated instructions..." }
}
}

agent:fork​

Create a new agent from an existing agent's configuration and state.

ParameterTypeDefaultDescription
sourceIdstringrequiredSource agent to fork from
agentIdstringrequiredNew agent identifier
configobject / string—Config override (merged on top of source)
includeTimelinebooleanfalseCopy the source's timeline
{
"operation": "v/ops/agent/fork",
"input": {
"sourceId": "Alice",
"agentId": "Alice-v2",
"config": { "systemPrompt": "Try a different approach..." }
}
}

The forked agent starts SLEEPING with fresh tasks and sessions, inheriting the source's configuration (and timeline if requested). The source agent is untouched.

Use cases:

  • Branching exploration — fork with a modified system prompt to try a different approach
  • Scaling — fork a configured agent to handle parallel workloads
  • Recovery snapshots — fork before risky operations with includeTimeline: true

agent:suspend​

Manually pause an agent. Stops the agent until you resume it. Any run in progress is cancelled. Records who stopped it and why.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier

agent:resume​

Resume a suspended agent. Clears the error and returns to SLEEPING.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier
autoWakebooleantrueIf there is pending work, start the agent immediately

agent:delete​

Terminate an agent.

ParameterTypeDefaultDescription
agentIdstring—One agent to delete
agentIdsarray—Exact agent names to delete in one Job — no prefixes, no wildcards, maximum 100. Every id is validated before any deletion begins, so a bad name fails the whole call rather than half-completing it.
removebooleanfalsePermanently delete the record (frees the name)

Supply exactly one of agentId or agentIds.

By default the agent is marked TERMINATED — preserving its audit trail, and keeping its name taken. remove: true deletes the record entirely, freeing the name and making unreachable storage eligible for garbage collection. That is also the only way to reuse a name, since agent:create requires an unused one.

The agentIds form returns per-agent results under agents.

agent:cancelTask​

Remove a pending task from an agent's queue.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier
taskIdstringrequiredTask Job ID (hex)

agent:delete-session​

Delete a session on an agent — its history, pending messages, and metadata. This is how you hold a private conversation and remove it afterwards.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier
sessionIdstring (hex)requiredThe session to delete

Job records are not touched: callers hold their own Job ids and delete those separately through the jobs API. Any in-flight chat on the session is failed.

Operators can disable the operation entirely with adapters.agent.sessionDelete: false — worth knowing if a venue's retention policy says conversations are the record.

agent:rename-session​

Set or clear a session's free-form title. A titled session is far easier to pick out of a list than a raw id and timestamp.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier
sessionIdstring (hex)requiredThe session to title
titlestring—The title. Omit it, or pass an empty string, to clear it back to unset.

Inspection​

agent:info​

Get a lightweight summary of an agent.

ParameterTypeDefaultDescription
agentIdstringrequiredAgent identifier

Response:

{
"agentId": "Alice",
"status": "SLEEPING",
"config": { "operation": "v/ops/goaltree/chat", "model": "gpt-5.4-mini" },
"tasks": 2,
"timelineLength": 15,
"error": null
}

agent:list​

List all agents owned by the caller.

ParameterTypeDefaultDescription
includeTerminatedbooleanfalseInclude terminated agents

agent:context​

Assemble the exact context an agent would send to its model for one hypothetical call, without calling the model. You describe the call; the venue runs the same Spec through the same assembler a live transition uses, so what you see matches what the model would get by construction rather than by two code paths agreeing.

ParameterTypeDescription
agentIdstring (required)Agent to inspect
messagestring or objectA hypothetical inbox message — a string, or {message, caller?}. Renders as the current input, with venue attribution when the caller isn't the agent's own principal.
messagesarraySeveral inbox messages, same forms
pendingarrayJob results arriving this cycle, as {jobId, status, output}
taskanyA task input — rendered as the outstanding task (LLM Agent) or the goal (Goal Tree), with the task tools offered
sessionIdstring (hex)Render against a real session's conversation, exactly as a live transition on it would see

The response is the Level 3 input — model, messages, tools, cacheMarks — plus assembly diagnostics:

FieldMeaning
budget{bytes, used, remaining} — the model's declared context budget and what this call spends of it
marksMessage counts at each band boundary: head, live, conversation, toolLoop
labelsThe label dialect in force (see Tools and Context)
sessionTokensMeasured usage, when the session has any

With nothing to act on, the context shows the empty-state signal a wake-up would see.

{
"operation": "v/ops/agent/context",
"input": { "agentId": "Alice", "message": "which vendors are overdue?" }
}

agent:step​

Step an agent's harness through one iteration on a reply you supply — no model call. Describe the call exactly as for agent:context, and add assistant: the reply the model would have given, as a string or {content?, toolCalls?: [{id?, name, arguments?}]}.

The tool calls are dispatched the way a live cycle dispatches them — same routes, same capability checks, same authority — so the tools' side effects are real. Their results are rendered, and you get back the prompt the next inference would receive.

The agent itself is untouched: nothing persists to its session, timeline or tasks. complete_task / fail_task (LLM Agent) and complete / fail (Goal Tree) are validated as live but reported as a terminal outcome rather than resolving anything, and Goal Tree's subgoal is not run — it would start a child frame and call the model.

Field returnedMeaning
assistantThe reply as it would be recorded
turnsWhat this iteration appends to the conversation
calls[{id, name, arguments, result, isError?, ms}]
terminal{status: "complete" or "failed", value} when a control tool was called
done / responseWhether the cycle ends here, and with what
nextThe following prompt, as agent:context reports it

Together these two make an agent testable without spending an inference: agent:context shows what the model would see, agent:step shows what the harness would do with a given reply.

Deep Inspection via Lattice​

For detailed debugging beyond agent:info, read the agent's lattice state directly with covia:read / covia:list / covia:slice:

PathContents
g/<agentId>/sessionsIndex of sessions (keyed by session id)
g/<agentId>/sessions/<sid>/metaSession metadata — {parties, created, turns}
g/<agentId>/sessions/<sid>/frames/0/conversationThe session's conversation turns
g/<agentId>/sessions/<sid>/pendingPending (not-yet-consumed) messages for the session
g/<agentId>/tasksPending task Job IDs
g/<agentId>/timelineComplete audit trail (append-only)
{
"operation": "v/ops/covia/read",
"input": { "path": "g/Alice/timeline" }
}

Timeline Entries​

Each run appends a timeline entry recording every inference of the cycle — the standing context and tools once, then per inference what was newly sent, the reply verbatim (or error), and the tool calls it requested with their results and timings:

{
"start": 1782864000000,
"end": 1782864012000,
"op": "v/ops/goaltree/chat",
"sessionId": "0xabcd...",
"tasks": [{ "task": "Summarise vendor records" }],
"inferences": [
{
"ts": 1782864000100, "ms": 4200,
"op": "v/ops/langchain/anthropic", "model": "claude-sonnet-5",
"sent": [],
"reply": { "toolCalls": [{ "name": "covia_list", "arguments": { "path": "w/vendors" } }] },
"calls": [{ "id": "c1", "name": "covia_list", "result": {}, "ms": 12 }]
}
],
"result": { "answer": "Three vendors..." }
}

sent carries the messages added since the previous inference — the standing head and live surface are recorded once, on the inference that first sent them. A subgoal call carries its child frame's record (frame) in the same shape, so popped subgoals keep their history, and a cycle whose transition throws still writes its entry with the inferences that ran.

This is the audit trail: what the model was actually shown, what it actually said, and what actually ran as a result.

Error Handling and Recovery​

When an agent transition fails:

  1. The error is recorded in agent.error
  2. Status transitions to SUSPENDED
  3. Tasks, sessions, and pending messages are preserved
  4. The timeline is not updated (no entry for failed runs)

To recover:

  1. Inspect the error: agent:info agentId: "Alice"
  2. Fix the root cause (missing tool, bad credentials, capability issue)
  3. Resume: agent:resume agentId: "Alice"
  4. The agent returns to SLEEPING and processes pending work