Aleph
Gateway RPCMethods Reference

agent.*

Agent execution and control RPC methods

Agent methods control Aleph's core AI execution loop (the Think→Act harness). agent.* is the direct entry used by panels and external integrations; chat-oriented clients normally use the chat.* family — both share the same execution adapter underneath.

Methods

MethodDescription
agent.runStart a run (asynchronous; returns run_id immediately)
agent.statusPoll a run's state by run_id
agent.cancelCancel an in-flight run
agent.listList agents registered in the router

Historical aliases such as agent.history / agent.clear / agent.respondToInput / agent.events are not RPCs. Use chat.history / chat.clear for session reads and events.* for streaming.

agent.run

Start an agent run. The handler returns immediately with a run_id; the actual response is delivered as streaming events on the stream.* and agent.* topics.

Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "agent.run",
  "params": {
    "input": "Summarize today's news",
    "session_key": "agent:main:main",
    "thinking": "medium"
  }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "run_id": "run-uuid-123",
    "session_key": "agent:main:main",
    "accepted_at": "2026-03-15T10:00:00Z"
  }
}

Parameters:

ParameterTypeRequiredDescription
inputstringYesUser input; must be non-empty
session_keystringNoSession key; auto-derived if omitted
channelstringNoChannel identifier (e.g. "cli:term1")
peer_idstringNoPer-peer session isolation key
streambooleanNoWhether to emit streaming events (default true)
thinkingstringNoReasoning depth: off / minimal / low / medium / high / xhigh (default minimal)
attachmentsobject[]NoFile attachments (name / mime_type / base64 data)
agent_idstringNoExplicit target agent, bypasses channel binding
project_rootstringNoProject root, overrides the default workspace
model_overrideobjectNoPer-turn model override (see model_override)
exec_tierstringNoExecution tier chosen in the composer (first-turn only)
modestringNoSession mode: chat / work / code
voice_inputbooleanNoMark the turn as ASR-transcribed speech

Response fields:

FieldDescription
run_idUnique run identifier; pair with agent.status / agent.cancel
session_keyResolved session key
accepted_atRFC3339 UTC timestamp

agent.status

Look up the current state of a run by run_id.

Request:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "agent.status",
  "params": { "run_id": "run-uuid-123" }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "run_id": "run-uuid-123",
    "session_key": "agent:main:main",
    "status": "running",
    "elapsed_ms": 1247
  }
}

status is one of running / completed / failed / cancelled. An unknown run_id returns -32602 Invalid params.

agent.cancel

Cancel an in-flight run. The cancel token is forwarded to the execution adapter; the run stops at the next safe checkpoint and releases its resources.

Request:

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "agent.cancel",
  "params": { "run_id": "run-uuid-123" }
}

Response:

{ "jsonrpc": "2.0", "id": 3, "result": { "run_id": "run-uuid-123", "cancelled": true } }

cancelled indicates the cancel request was accepted; the transitional state until the run truly stops is visible via agent.status.

agent.list

List every agent registered in the AgentRouter plus the current default.

Request:

{ "jsonrpc": "2.0", "id": 4, "method": "agent.list" }

Response:

{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "agents": [
      { "id": "main", "name": "Main", "enabled": true, "is_default": true }
    ],
    "default": "main"
  }
}

Each entry exposes id / name / enabled / is_default, exactly as returned by AgentRouter::list_agents().

Streaming Events

After agent.run is accepted, the event bus delivers run lifecycle changes as WebSocket notifications (topic names come from GatewayEventFrame::topic_name()):

TopicDescription
run.acceptedRun queued and started
agent.reasoningReasoning-phase output
agent.reasoning.blockReasoning block (dual-process cognition)
agent.tool.startTool call begins
agent.tool.updateTool progress update
agent.tool.endTool call ends
agent.traceExecution-trace event
agent.response.chunkResponse text chunk
agent.context.gaugeContext-window utilisation
agent.run.completeRun completed successfully
agent.run.errorRun failed
agent.run.retryingFailure-driven retry
agent.ask.userask_user clarification request
agent.clarification.endedClarification round resolved
agent.uncertaintyModel uncertainty signal
agent.model.resolvedModel selection resolved

Non-streaming events share the same bus:

TopicDescription
session.updated / session.lifecycle.changedSession changes
running.set.changedActive-run set changes
channel.message / channel.typing / channel.status / channel.errorChannel events
config.changedConfiguration change
approval.requested / approval.resolved / approval.expiredApproval requests
cron.job.changed / heartbeat.task.changedScheduler task changes
team.changedTeam changes
acp.sessions.changedACP session changes
gateway.token.rotated / gateway.device.revokedGateway credential events
surface.notify / surface.approvalSurface notifications
runtimes.install.progressRuntime installation progress

Session Key Formats

The session_key parameter determines context isolation. See the Protocol page for WebSocket transport details.

FormatExampleDescription
Mainagent:main:mainShared cross-channel session
DMagent:main:telegram:dm:user123Per-user direct message
Groupagent:main:discord:group:guild-idGroup/channel chat
Taskagent:main:cron:daily-summaryCron or webhook task
Ephemeralagent:main:ephemeral:uuidTemporary, non-persistent

Thinking Levels

thinking controls how much reasoning the agent performs before responding.

LevelUse Case
offFast, direct answers
minimalSimple queries (default)
lowStandard conversation
mediumComplex tasks
highMulti-step reasoning
xhighDeep analysis

See Also

On this page