DocsAgentsRuntime & subagents

Runtime & subagents.

How an agent decomposes work, parallelizes via subagents, streams events, and verifies its own output. The runtime is what turns a single prompt into a structured, observable, replayable run.

§ 01The agent loop

Every Essarion agent follows the same outer loop. Tool call, result, reason, repeat — until the agent decides it is done, or hits a stop condition.

  1. The agent receives the user's prompt and the project context.
  2. It reasons about the next action and emits a tool call.
  3. The runtime executes the tool and returns a tool result.
  4. The agent reads the result, updates its plan, and either emits the next tool call or signals completion.
  5. On completion the agent writes a final response, saves any artifacts, and the run closes.

Every step in this loop is a typed event on the run timeline. There is no hidden chain-of-thought stage that doesn't show up in the record. The reasoning is internal; the actions and their outputs are not.

§ 02Tools available to agents

The tool surface is intentionally small. Each tool is a noun-verb pair the agent can call by name.

ToolPurpose
read_fileRead a file from the project drive or workspace.
write_fileWrite a file into the workspace area.
search_webSearch the open web for relevant pages.
execCommandRun a shell command in the agent's PTY.
execPythonRun a Python snippet in a managed interpreter.
browser_navigateNavigate the cloud Chromium to a URL.
browser_actPerform an intent-level action on the current page.
browser_extractPull structured data off the current page.
View_SkillsList the skill bundles available to this agent.
Read_SkillLoad the markdown for a named skill into context.
save_outputPersist a deliverable as an artifact on the run.
spawn_subagentsFan out work to one or more subagents.

Tools are identical across surfaces — there is one read_file the agent calls regardless of whether the file came from the drive, the workspace, or a subagent's output.

§ 03Subagents

The runtime can fan out work in parallel. An agent that needs to do five independent things at once spawns five subagents, lets them run concurrently, and joins their results.

Subagent tools

Examples

Where subagents matter most:

TipSubagents are isolated — each runs with its own knowledge base scope. They do not see each other's terminal output or chat. The parent agent is the only one with the full picture, which is what makes the synthesis stage meaningful.

§ 04Streaming events (SSE)

Every run emits a stream of typed events that any client can subscribe to. The same event stream that powers the workspace UI is available programmatically.

EventMeaning
startedThe run has been accepted and is now executing.
tool_callThe agent has invoked a tool — name and arguments are included.
tool_resultA tool has returned — output, duration, and success/failure are included.
terminal_outputA chunk of stdout/stderr from the agent's PTY.
browser_sessionA browser session has been opened, navigated, or closed.
artifact_createdThe agent has saved a deliverable through save_output().
surface_switchThe agent has changed which surface is in focus.
completedThe run finished successfully — final response and totals included.
errorThe run terminated with an error — code, message, and last-known state included.

For the wire format and an end-to-end SSE example see Streaming with SSE.

§ 05LLM routing

Agents run against a locked default model — a current-generation, GPT-class model held constant across users so behavior is consistent and reproducible. The platform does not silently swap models behind the scenes, and runs do not split themselves between models for cost optimization without disclosure.

Three things follow from that:

NoteLocked-default does not mean fixed-forever. As newer generations land, the default model is upgraded across the platform — but the change is visible, versioned, and announced, not silent.

§ 06Verification loops

Some agents run a final pass before declaring complete: re-reading their own output and checking it against a policy bundle. This is most common in jobs that ship a typed deliverable — contract summaries, executive briefs, RFP responses — where the deliverable has structural requirements (sections present, citations attached, totals reconciling).

The verification loop is itself an agent step: a tool call to validate, a tool result with pass/fail and a list of issues, optional re-work, and only then a completed event. If verification fails too many times, the run completes with the best draft and a flagged set of unresolved issues rather than retrying indefinitely.

§ 07Where to go next